필터 지우기
필터 지우기

Display the Vertex and Triangle labels on a meshes plot

조회 수: 5 (최근 30일)
Alan
Alan 2020년 10월 15일
댓글: Alan 2020년 10월 15일
Hello, I have a 3D sphere triangle meshes figure as follow , and I want to lable vertex and triangle numbers on the sphere triangle meshes. By doing this, I can easily know how many triangles in this 3D sphere and which three vertex numbers represent the specified mesh number. For example, when the vertex vector is (7, 9, 14), through this vertex vector, I can visulize the number of the corresponding mesh number is 7. We suppose the vertex is p and triangle is t.

채택된 답변

KSSV
KSSV 2020년 10월 15일
x = rand (10,1);
y = rand (10,1);
tri = delaunay (x, y);
triplot (tri, x, y);
hold on;
plot (x, y, "r*");
nodes = [1:length(x)]' ; % nodes
ele = [1:size(tri,1)]' ; % elements
text(x,y,num2str(nodes),'color','b')
text(mean(x(tri),2),mean(y(tri),2),num2str(ele),'color','k')
  댓글 수: 1
Alan
Alan 2020년 10월 15일
Thanks so much for the great answer. This is what I want. I modified the 2D answer into 3D and got the right answer. Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by