Separate multiple triangulation.ConnectivityList based on connectivity
6 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!