MATLAB: Trimesh and trisurf produces a very bad triangulation results?!!

trisurf

Hello! I am trying to model a closed surface, but trimesh and trisurf produces a very bad plot, how can I improve it?: is there any other functions to use instead ?! Thank you!! Note: below is the code I am using:
figure(1)
trisurf(t,p(1,:),p(2,:),p(3,:));title('ploted using trisurf ')
figure(2)
trimesh(t,p(1,:),p(2,:),p(3,:));title('ploted using trimesh ')

Best Answer

hello! the problem was that the triangles contained not only the nodes but also their domain number (inside or out side the object) so when I used only the nodes of the triangle it worked perfectely using:
(I meant by bad it generates parallelogram instead of triangles)
figure(1) trisurf(t(1:3,:),p(1,:),p(2,:),p(3,:));title('ploted using trisurf ')
Related Question