Creating a Regular Delanuy Triangulation.

1 view (last 30 days)
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

Accepted Answer

jonas
jonas on 29 Oct 2018
Edited: jonas on 29 Oct 2018
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)
  1 Comment
apex116
apex116 on 1 Nov 2018
yes that solved the problem. Thank you for your help, much appreciated.

Sign in to comment.

More Answers (0)

Categories

Find more on Triangulation Representation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by