How to plot a subset of triangles after DelaunayTri
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have computed a Delaunay triangulation using DelaunayTri(). Then I extracted big triangles based on a threshold, how can I reconstruct these triangles and plot it in a figure ?
thanks
0 commentaires
Réponse acceptée
Simon
le 9 Déc 2013
Hi!
If you have a triangulation you can of course plot specific triangles (if you know them) with
TRI = dt.Triangulation;
X = dt.X;
ind = [1,2,3,4,5];
triplot(TRI(ind, :), X(:, 1), X(:, 2));
5 commentaires
Simon
le 12 Déc 2013
I used the code:
x = rand(20,1);
y = rand(20,1);
dt = DelaunayTri(x,y);
figure(1)
triplot(dt);
ID = 1;
TRI = dt.Triangulation;
X = dt.X;
[ind, ~] = ind2sub(size(TRI), find(TRI==ID));
figure(2)
triplot(TRI(ind, :), X(:, 1), X(:, 2));
Works without problems.
Voir également
Catégories
En savoir plus sur Read, Write, and Modify Image dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!