Page 1 of 2

How to extract cloud points perimeter?

Posted: Tue Jul 20, 2021 11:08 pm
by DA523
Is there any tool or plugin in CC to auto extract cloud points perimeter?
Mesh.zip
(1.26 MiB) Downloaded 1142 times
perimeter.png
perimeter.png (115.39 KiB) Viewed 15969 times

Re: How to extract cloud points perimeter?

Posted: Wed Jul 21, 2021 8:30 am
by daniel
Have you tried the 'Tools > Fit > Facet' tool?

Part of the result should be the contour.

Re: How to extract cloud points perimeter?

Posted: Wed Jul 21, 2021 8:30 am
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)

Re: How to extract cloud points perimeter?

Posted: Wed Jul 21, 2021 11:05 am
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

Re: How to extract cloud points perimeter?

Posted: Thu Jul 22, 2021 7:57 pm
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 15879 times

Re: How to extract cloud points perimeter?

Posted: Thu Jul 22, 2021 8:02 pm
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 15878 times
You can then filter the cloud based on that distance.

Re: How to extract cloud points perimeter?

Posted: Thu Jul 22, 2021 8:35 pm
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 15875 times

Re: How to extract cloud points perimeter?

Posted: Thu Jul 22, 2021 8:42 pm
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

Re: How to extract cloud points perimeter?

Posted: Fri Jul 23, 2021 9:54 am
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 15807 times
.
But playing with grid step & min. vertex count makes result polyline accurate in xy plane
.
22.png
22.png (97.4 KiB) Viewed 15798 times
2.png
2.png (53.22 KiB) Viewed 15798 times
.
a.zip
(447.55 KiB) Downloaded 912 times
grid.zip
(1009.13 KiB) Downloaded 888 times

Re: How to extract cloud points perimeter?

Posted: Fri Jul 23, 2021 4:21 pm
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 15786 times