Extract coordinates for faces or triangles

Feel free to ask any question here
Post Reply
RVall
Posts: 4
Joined: Thu Nov 11, 2021 12:16 pm

Extract coordinates for faces or triangles

Post by RVall »

Hello All -
I am new to CC and am learning my way to do things in CC. I have a ply mesh file that is triangulated. When I opened it in CC, I see there are 36752 faces/triangles in the mesh. I want to export the XYZ coordinates for all these faces/triangles. Is it possible to extract these coordinates in CC? OR, is there an alternative approach to extract these coordinates? I could not attach my mesh file here as it is .ply file. Many thanks for the suggestions.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Extract coordinates for faces or triangles

Post by daniel »

Normally, below the 'mesh' entity, you have a point cloud entity named 'vertices'. You can select this entity and save/export it as a point cloud (typically to the ASCII/text format, that will let you retrieve the vertex coordinates easily).
Daniel, CloudCompare admin
RVall
Posts: 4
Joined: Thu Nov 11, 2021 12:16 pm

Re: Extract coordinates for faces or triangles

Post by RVall »

Thank you, Daniel. I do not see any option "Vertices" below the mesh. I have attached a screenshot of my CC. Also, I want the XYZ coordinates for every triangular in the mesh BUT not the XYZ coordinates of the point cloud.
Attachments
Screenshot 2021-11-15 at 14.23.54.png
Screenshot 2021-11-15 at 14.23.54.png (1.48 MiB) Viewed 14194 times
RVall
Posts: 4
Joined: Thu Nov 11, 2021 12:16 pm

Re: Extract coordinates for faces or triangles

Post by RVall »

I just found "Vertices" below the mesh. However, it is showing only one XYZ coordinate value: Example below:

-365.65100098 855.71899414 336.13699341 145 84 196 11.000000

I expect that every triangle has 3 sets of XYZ coordinates to represent one triangle. I would like to get these 3 sets of XYZ coordinates for all triangles. Many thanks.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Extract coordinates for faces or triangles

Post by daniel »

'Modern' meshes share the vertices among triangles (to reduce the memory consumption, and to manage the connectivity between the triangles...

If you want 3 vertices by triangle, you can export the mesh to the 'STL ascii' format (export to STL, and then choose 'ASCII' mode). You'll be able to open the file and you'll see the 3 vertices that compose each triangle in a human readable format.
Daniel, CloudCompare admin
RVall
Posts: 4
Joined: Thu Nov 11, 2021 12:16 pm

Re: Extract coordinates for faces or triangles

Post by RVall »

Thank you, Dani. It worked. I can see XYZ values for 3 vertices for all triangles in the mesh. many thanks.
Post Reply