3d plot
1 次查看(过去 30 天)
显示 更早的评论
Hello,
dt = DelaunayTri(x,y);
figure
triplot(dt);
hold on
t = vertexAttachments(dt,1);
triplot(dt(t{:},:),x,y,'Color','r');
hold off
This is if i have x and y, how can i do it for x,y and z?
Thanks in advance
0 个评论
采纳的回答
Andrew Newell
2011-9-14
EDIT: Define U=[x(:) y(:) z(:)], then use
dt = DelaunayTri(U);
Plot it using a command like
tetramesh(dt, 'FaceColor', 'cyan');
EDIT 2: Here is an example in which the vertex attachments for vertex 1 are highlighted.
x = rand(20,1); y = rand(20,1); z=rand(20,1);
Plot all the tetrahedra.
U=[x(:) y(:) z(:)];
dt = DelaunayTri(U);
h=tetramesh(dt, 'EdgeColor', 'cyan','FaceColor','none'); hold on
Find simplex attachments and extract the vertex numbers
t = vertexAttachments(dt,1);
tri_attach = dt.Triangulation(t{:},:);
ii = unique(tri_attach(:));
Now plot the tetrahedra for the attached vertices
U = U(ii,:);
dt = DelaunayTri(U);
tetramesh(dt, 'EdgeColor', 'red','FaceColor','none');
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Delaunay Triangulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!