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

采纳的回答

jonas
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 CenterFile Exchange 中查找有关 Triangulation Representation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by