3d plot

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

 Respuesta aceptada

Andrew Newell
Andrew Newell el 14 de Sept. de 2011

0 votos

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');

4 comentarios

developer
developer el 14 de Sept. de 2011
thanks actually i have already seen it before but if it doesnot define define how can i do this step in 3D coordinate
triplot(dt(t{:},:),x,y,'Color','r');
Andrew Newell
Andrew Newell el 15 de Sept. de 2011
Don't use triplot - see my edit above.
developer
developer el 15 de Sept. de 2011
But its only for 'dt' i guess not for the vertex attachment portion 't'?
developer
developer el 15 de Sept. de 2011
you have used tetramesh for showing 'dt' but not 't'

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Delaunay Triangulation en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 14 de Sept. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by