trimesh not working with 2D triangulation object

4 次查看(过去 30 天)
%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 个评论
Matt J
Matt J 2023-4-13
编辑:Matt J 2023-4-13
Since Tri is not posted, we cannot run the code or examine its inputs.
Ian Townend
Ian Townend 2023-4-14
%attached file includes Tri object
load('trimesh_input.mat')
trimesh(Tri)
Error using trimesh
The triangulation must reside in 3D space.

请先登录,再进行评论。

回答(1 个)

Srija Kethiri
Srija Kethiri 2023-4-21
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 个评论
Ian Townend
Ian Townend 2023-4-21
Thanks for the feedback. The explicit workaround I noted in my original submission, means that trimesh can be used - its just not as elegant.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Delaunay Triangulation 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by