Creating a Regular Delanuy Triangulation.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, I would like to create a Delanuy Triangulation like below:
Only difference with my code is that the x and y intervals are different.
Here are the steps I have taken so far. I have set the limits to the triangulation:
minX = 2.58 * 1E5;
maxX = 2.8 * 1E5;
minY = 1.82 * 1E5;
maxY = 1.93 * 1E5;
I have then calculated the distance between the limits:
Xdiff = maxX - minX;
Ydiff = maxY - minY;
Set the ratio between the two:
Ratio = Ydiff/Xdiff;
I have then prescribed the number of x points and then multiplied the number of y points by the previous ratio.
NumPointsX = 220;
NumPointsY = NumPointsX * Ratio;
I then calculate the intervals:
XSep = Xdiff/NumPointsX;
YSep = Ydiff/NumPointsY * Ratio;
using the interval and limits, I can then assign an even number of x and y points.
x = (minX:XSep:maxX)';
y = (minY:YSep:maxY)';
and then I use the Delanuy Triangulation.
DT = delaunayTriangulation(x,y);
Upon doing so, I am unable to obtain a connectivity list and believe there is an error in my code. I don't know if anyone could help me with this issue so that I can create a regular Delanuy triangulation.
Many Thanks
Paul
댓글 수: 0
채택된 답변
jonas
2018년 10월 29일
편집: jonas
2018년 10월 29일
The triangulation is not where your problem is. Before you triangulate, you need to have a grid, which you do not. Try plotting x against y and you can see that you a straight line. You probably want to use meshgrid for creating your grid.
[X,Y] = meshgrid(x,y);
DT = delaunayTriangulation(X(:),Y(:));
DT =
delaunayTriangulation with properties:
Points: [48841×2 double]
ConnectivityList: [96800×3 double]
Constraints: []
You can then simply plot
triplot(DT)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Triangulation Representation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!