How generate a patch object with tetramesh?

I have a triangulation object and I'm trying to create a patch from it using tetramesh, but once I use tetramesh it gives me double instead of patch. How can I get a patch from triangulation that is meshed with tetrahydrons?

3 comentarios

d = [-1 1];
[x,y,z] = meshgrid(d,d,d); % A cube
x = [x(:);0];
y = [y(:);0];
z = [z(:);0]; % [x,y,z] are corners of a cube plus the center.
dt = delaunayTriangulation(x,y,z);
Tes = dt(:,:);
X = [x(:) y(:) z(:)];
h = tetramesh(Tes,X);camorbit(20,0);
size(h)
ans = 1×2
1 12
class(h)
ans = 'matlab.graphics.primitive.Patch'
h(1)
ans =
Patch with properties: FaceColor: 'flat' FaceAlpha: 0.9000 EdgeColor: [0 0 0] LineStyle: '-' Faces: [4×3 double] Vertices: [12×3 double] Show all properties
Doesn't look like a double to me...
azarang asadi
azarang asadi el 3 de Mzo. de 2021
which release is yours?
Walter Roberson
Walter Roberson el 3 de Mzo. de 2021
R2020b.

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 3 de Mzo. de 2021

0 votos

In R2020a and earlier:
Record the vector returned by tetramesh(), and call handle() on it. The result you get back will be a patch array.
In R2020b, the value returned is a patch array directly.

Más respuestas (0)

Categorías

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

Productos

Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by