Ransac - export just meshes

For any question about plugins!
marcin1212
Posts: 1
Joined: Thu Feb 01, 2024 12:44 pm

Ransac - export just meshes

Post by marcin1212 »

Hi Guys,
I'm trying to play with the RANSAC plugin, finding all of the cylinders within a point cloud. I get many recognized cylinders, however I'm struggling with exporting them wihtout points (just mesha/geometry).
Is there a simple way to export all found shapes from the tree, but without points?
Marcin
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Ransac - export just meshes

Post by daniel »

Right click on the top level entity in the DB (at least the one that contains all the cylinders), and then use the option 'Select children by type and/or name'.
Daniel, CloudCompare admin
clem
Posts: 5
Joined: Wed Oct 29, 2025 11:25 am

Re: Ransac - export just meshes

Post by clem »

The export with that method has the following format:

Name Points meanX meanY meanZ SF#1 name SF#1 valid values SF#1 mean SF#1 std.dev. SF#1 sum
Cylinder_0001 1106729 -174.136 -1305.54 5.38732 Intensity 1106729 82.9177 36.7795 9.18E+07
vertices 50 -174.117 -1305.12 5.48924
Cylinder_0002 944320 -181.715 -1305.41 5.36241 Intensity 944320 93.1268 40.5955 8.79E+07
vertices 50 -181.725 -1305.12 5.43941

It doesn't have any information on the primative shape size. Is there a way to export the radius and height too? Or at least the name of the CC object, which is in the form "Cylinder (r=1.2323423/h=2.34554)"
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Ransac - export just meshes

Post by daniel »

Isn't the first column the name of the entity already?
Daniel, CloudCompare admin
clem
Posts: 5
Joined: Wed Oct 29, 2025 11:25 am

Re: Ransac - export just meshes

Post by clem »

The name in the export does not have radius and height information, only a sequential number
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Ransac - export just meshes

Post by daniel »

Which version of CloudCompare do you use?
Daniel, CloudCompare admin
clem
Posts: 5
Joined: Wed Oct 29, 2025 11:25 am

Re: Ransac - export just meshes

Post by clem »

v2.13.1
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Ransac - export just meshes

Post by daniel »

Ok, I see that it's the mesh below the cloud which has the radius and height in its name.

So a trick would be to select all the meshes (you can right click on the top group and use 'Select children by type and/or name' if there are too many).

Then use the 'Edit > Mesh > Sample points' method (with a few points, e.g. 10 000, no need to have too many here I believe).

This will create as many clouds with the same name as the meshes. You'll be able to use batch export on these.
Daniel, CloudCompare admin
clem
Posts: 5
Joined: Wed Oct 29, 2025 11:25 am

Re: Ransac - export just meshes

Post by clem »

That is helpful and worked to get the original radius and height of each cylinder. An improvment would be to get the current radius and height directly from the primative attributes. For some shapes, I need to adjust the height after RANSAC fitting so the actual height no longer matches the name (see attached screen shot).

Is there a way to access/export the primative attribute table?
Attachments
RANSAC export changing attribute issue.png
RANSAC export changing attribute issue.png (414.36 KiB) Viewed 32785 times
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Ransac - export just meshes

Post by daniel »

You mean programmatically?
Daniel, CloudCompare admin
Post Reply