Creating a Regular Delanuy Triangulation.

1 visualizzazione (ultimi 30 giorni)
apex116
apex116 il 29 Ott 2018
Commentato: apex116 il 1 Nov 2018
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

Risposta accettata

jonas
jonas il 29 Ott 2018
Modificato: jonas il 29 Ott 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 Commento
apex116
apex116 il 1 Nov 2018
yes that solved the problem. Thank you for your help, much appreciated.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Triangulation Representation in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by