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!