Keep point indices after segmenting and merging

Feel free to ask any question here
Post Reply
zvict
Posts: 2
Joined: Fri Apr 28, 2023 4:42 am

Keep point indices after segmenting and merging

Post by zvict »

Hi,

I'm new to CloudCompare, I searched the forum but didn't find an exact answer. I'm trying to edit(rotate and translate) a part of a point cloud, and I want to keep the indices of the points after editing. What I'm doing right now is first segmenting the part I want to edit using 'Edit/Segment', this tool gives me a new point cloud with new indices, and after I edit this point cloud I want to merge ('Edit/Merge') it back and export as one point cloud, but I found some point indices changed after merging. So is there a way to keep the indices before and after segmenting and merging?

For example, I have a point cloud with 4 points indexed '0, 1, 2, 3, 4' that represents a stick man, where points 1, 2 represent the head that I want to edit, so after I segment points 1, 2 out I get two point clouds indexed '0, 1, 2' and '0, 1' where the latter one is the head. And when I merge the two point clouds is there a way to keep the indices in the original point cloud '0, 1, 2, 3, 4' rather than concatenate the two point clouds where the indices become '0, 3, 4, 1, 2' or '1, 2, 0, 3, 4'?

Thanks in advance!
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Keep point indices after segmenting and merging

Post by daniel »

Well, it all depends on the order in which the clouds are segmented and then merged back together.

When the cloud is segmented (with the scissors tool) you might have a chance to keep the order as long as the indices of the 2 groups are not 'interlaced' and the points that are visible at the time you apply the segmentation are the ones with the lowest indexes. In this case, you will end up with two clouds, and with points in the same order as they were originally stored.

Then when you merge, it's a matter of selecting first the point cloud with the lowest indexes (originally).
Daniel, CloudCompare admin
zvict
Posts: 2
Joined: Fri Apr 28, 2023 4:42 am

Re: Keep point indices after segmenting and merging

Post by zvict »

Thanks for the response!

I think in this case I need to make sure they are not 'interlaced' before editing. Is there a way to show the point indices in the original point cloud of the selected points when using the scissors tool?

*update: I guess I figured out how to do this, I first set the class of the selected points and then export the point cloud without segmenting the selected part with the class labels.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Keep point indices after segmenting and merging

Post by daniel »

Yes, you can add a scalar field with the point indexes (with 'Edit > Scalar fields > Add point indexes' or something similar)
Daniel, CloudCompare admin
Post Reply