trimesh not working with 2D triangulation object

%Tri is a triangulation object of a 2D mesh
trimesh(Tri) %throws error "The triangulation must reside in 3D space."
%However the following code works
pts = Tri.Points;
tria = Tri.ConnectivityList;
trimesh(tria,pts(:,1),pts(:,2),'Color','k')
%note the use of 'Color' as a Name-Value argument, Neither 'FaceColor' or
%'EdgeColor' work with this call, returning:
% Error using plot
% Unrecognized property FaceColor for class Line.
%or
% Error using plot
% Unrecognized property EdgeColor for class Line.

2 comentarios

Matt J
Matt J el 13 de Abr. de 2023
Editada: Matt J el 13 de Abr. de 2023
Since Tri is not posted, we cannot run the code or examine its inputs.
%attached file includes Tri object
load('trimesh_input.mat')
trimesh(Tri)
Error using trimesh
The triangulation must reside in 3D space.

Iniciar sesión para comentar.

Respuestas (1)

Srija Kethiri
Srija Kethiri el 21 de Abr. de 2023

0 votos

Hi Ian,
The function ‘trimesh’ has an issue working with the 2D triangulation object. This issue is under investigation, and it might get fixed in the future releases.

1 comentario

Ian Townend
Ian Townend el 21 de Abr. de 2023
Thanks for the feedback. The explicit workaround I noted in my original submission, means that trimesh can be used - its just not as elegant.

Iniciar sesión para comentar.

Categorías

Productos

Versión

R2022b

Preguntada:

el 13 de Abr. de 2023

Comentada:

el 21 de Abr. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by