How to extract cloud points perimeter?

Feel free to ask any question here
DA523
Posts: 166
Joined: Mon May 25, 2020 4:02 pm

How to extract cloud points perimeter?

Post by DA523 »

Is there any tool or plugin in CC to auto extract cloud points perimeter?
Mesh.zip
(1.26 MiB) Downloaded 1155 times
perimeter.png
perimeter.png (115.39 KiB) Viewed 16060 times
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to extract cloud points perimeter?

Post by daniel »

Have you tried the 'Tools > Fit > Facet' tool?

Part of the result should be the contour.
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to extract cloud points perimeter?

Post by daniel »

Oh, and of course, you can do nice contour extraction with the 'Cross section' tool (https://www.cloudcompare.org/doc/wiki/i ... le_contour)
Daniel, CloudCompare admin
DA523
Posts: 166
Joined: Mon May 25, 2020 4:02 pm

Re: How to extract cloud points perimeter?

Post by DA523 »

I tried every thing but no luck because perimeter points has different z level .
Fortunately , my cloud points are always dense (generated by mesh sample points) this why I think it is not default to find perimeter point with some algorithm
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: How to extract cloud points perimeter?

Post by WargodHernandez »

It should not matter if they are not on the same Z level, I think the confusion is terminology, in the cross section tool under extract contours, the thing you are asking for is called "Extract envelope" rather than extract contours.
extractEnvelope.JPG
extractEnvelope.JPG (92.59 KiB) Viewed 15970 times
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: How to extract cloud points perimeter?

Post by WargodHernandez »

Also if you want the points near the envelope, you can use the Cloud to Primitive distance tool to evaluate each point to the polyline that represents the envelope
extactenvelopeDistance.JPG
extactenvelopeDistance.JPG (46.36 KiB) Viewed 15969 times
You can then filter the cloud based on that distance.
DA523
Posts: 166
Joined: Mon May 25, 2020 4:02 pm

Re: How to extract cloud points perimeter?

Post by DA523 »

This helps a little but Z values of polyline does not match Z of perimeter of mesh?
XY are OK

The goal of extracting of mesh perimeter is to build with minimum manual intervention more realistic cover for mesh instead of close hole function in Blender and FreeCAD etc
This cover is to be used as upper cloud points for volume (2.5Dvolume) calculation in CC and GIS etc

cont.png
cont.png (97.71 KiB) Viewed 15966 times
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: How to extract cloud points perimeter?

Post by WargodHernandez »

you could extract z coord to a scalar field for storage, then set all Z values to 0, then extract envelope, then measure distance to primitive, then restore the Z coord from the scalar saved earlier
DA523
Posts: 166
Joined: Mon May 25, 2020 4:02 pm

Re: How to extract cloud points perimeter?

Post by DA523 »

you could extract z coord to a scalar field for storage, then set all Z values to 0, then extract envelope, then measure distance to primitive, then restore the Z coord from the scalar saved earlier
I will try this approach.

However, I found that polyline contour sometimes is not accurate in xy plane especially if there is big variation in mesh Z
see in image below
.
polyline.png
polyline.png (136.93 KiB) Viewed 15898 times
.
But playing with grid step & min. vertex count makes result polyline accurate in xy plane
.
22.png
22.png (97.4 KiB) Viewed 15889 times
2.png
2.png (53.22 KiB) Viewed 15889 times
.
a.zip
(447.55 KiB) Downloaded 929 times
grid.zip
(1009.13 KiB) Downloaded 915 times
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: How to extract cloud points perimeter?

Post by WargodHernandez »

I had good success following what I told you, zeroing out the Z value getting the contours then restoring the Z values. only extra step I didn't mention was to interpolate the original clouds SF values to the vertices of the extracted contours and restore the Z SF to the vertices as well to get the contours to follow up to the original locations.
both_A_And_Grid.JPG
both_A_And_Grid.JPG (123.76 KiB) Viewed 15877 times
Attachments
a.zip
Your example file modified with the method described above
(538.52 KiB) Downloaded 907 times
grid.zip
Your example file modified with the method described above
(1.59 MiB) Downloaded 939 times
Post Reply