Separate multiple triangulation.ConnectivityList based on connectivity
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Donald Hume
le 3 Août 2022
Réponse apportée : Donald Hume
le 3 Août 2022
Hello, I have a triangulation object which when plotted using the patch command produces multiple non-enclosed faceted surfaces.
I would like to find a way to separate out all discrete surfaces into distinct triangulation.ConnectivityList or triangulation objects. I started implementing this using the triangulation function isConnected(), which only considers connectivity along a single edge and ultimately begs for a recursive solution. I wondered if there was a simpler or already implemented solution to accomplish this task.
I've extended the example in triangulation doc to include two distinct faceted surfaces. Thanks in advance for your help!
P = [ 2.5 8.0 1
6.5 8.0 1
2.5 5.0 1
6.5 5.0 1
1.0 6.5 1
8.0 6.5 1];
P = [ P;
2.5 8.0 3
6.5 8.0 3
2.5 5.0 3
6.5 5.0 3
1.0 6.5 3
8.0 6.5 3]
T = [5 3 1;
3 2 1;
3 4 2;
4 6 2];
T = [T;
11 9 7;
9 8 7;
9 10 8;
10 12 8]
TR = triangulation(T,P)
h1 = patch('faces',TR.ConnectivityList,'vertices',TR.Points);
set(h1,'FaceColor',[.89 .855 .788], 'FaceLighting','gouraud','EdgeColor','none','FaceAlpha',0.5,'SpecularStrength',.1);
lighting phong;
axis equal
xlabel('x');ylabel('y');zlabel('z')
view([0 40])
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Delaunay Triangulation 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!