I have 3D points that represent a cuboid saved in F which I extracted from an image. F is 8x3 double array. When I converted the data to a triangulated mesh and plotted it, I got this incorrect shape, see the image below. It should produce a cuboid with 6 faces, but the resulted one has 8 faces. Anyone can help me how to fix the problem to plot the correct shape? However, when I write the values of x,y, and z manually (see the code below the image), the code plots the shape correctly.
The code is:
[elements,nodes] = boundaryFacets(shp);
geometryFromMesh(model,nodes',elements');
pdegplot(model,'FaceLabels','on','FaceAlpha',0.5)