Page 1 of 1

Mesh vs. Pointcloud

Posted: Mon Jan 13, 2014 10:34 am
by freemountain
Hey there,
I am looking for a way to get distances between points and a referenced mesh. A table with the distance for each point to the closest face of the mesh would be the aim. Is there a way to do this?
Thanks for your help!

Re: Mesh vs. Pointcloud

Posted: Mon Jan 13, 2014 12:32 pm
by daniel
Indeed: just select a point cloud and a mesh, call the "Tools > Distances > Cloud/Mesh dist." method (click on the "Compute" button once the tool dialog is displayed). You'll get a scalar field on the cloud corresponding to the distance of each point to the nearest triangle.

Eventually you can export ("File > Save") the cloud and its distances as an ASCII file (you'll get "X Y Z distance" per line for each point).

Re: Mesh vs. Pointcloud

Posted: Tue Jan 14, 2014 7:59 am
by freemountain
Bonjour Daniel,
I could figure it out before you answered, the export as a .txt or rather .xyz was the probleme;)
I do have another question, though but don't want to start a new thread as it might be answered quickly again: Can you tell me about the roughness calculation? How is that done as I haven't seen it in comparable software, yet. I was close to asking someone to write something like that for me in Matlab but now I see, it already works. Do you use a standard deviation from a convex hull??

Re: Mesh vs. Pointcloud

Posted: Tue Jan 14, 2014 8:55 am
by daniel
Roughness computation is very... simple: see http://www.cloudcompare.org/doc/wiki/in ... =Roughness

Re: Mesh vs. Pointcloud

Posted: Tue Jan 14, 2014 9:35 am
by freemountain
Seems truely... simple! I get the kernel size and I get the LS plane but my brain can't connect the two. Is a new surface generated by the sphere around each vertice?

Re: Mesh vs. Pointcloud

Posted: Tue Jan 14, 2014 9:54 am
by daniel
No we simply compute the distance between the point and the plane fitted on its neighbors. If the surface is flat, then the point is very close to the corresponding plane. Otherwise, if the surface is very rough, the plane can be in about any direction and will pass through the center of gravity of the neighbors. And the point will be more likely quite far from it (therefore the roughness measure will be statistically higher).

Re: Mesh vs. Pointcloud

Posted: Tue Jan 14, 2014 5:22 pm
by freemountain
were do I get that plane from? Is it generated automatically when hitting the roughness button...its inactive after loading a single mesh/pointcloud. Thanks for your help! merci beaucoup

Re: Mesh vs. Pointcloud

Posted: Tue Jan 14, 2014 7:40 pm
by daniel
In fact the "plane" is computed for each point: we consider a small neighborhood around it (for instance the 6 neighbors around each point) and we compute the best fitting plane that pass through those points. The plane is not "created", we just compute its parameters. Then we compute the distance between the central point and this plane and this gives us the roughness value for this point. The process is repeated for each point.

Re: Mesh vs. Pointcloud

Posted: Wed Jan 15, 2014 8:57 am
by freemountain
One last question (hopefully;)): Is there also a tool (e.g. slicing tool) to cut out and erase points that are at a certain height above the mean surface of a plane? I just need the roughness of some 0,5cm above the ground, everything else will spoil the mean value and the histogram. Besides being quoted you deserve some kind of gift for that program!

Re: Mesh vs. Pointcloud

Posted: Wed Jan 15, 2014 10:00 am
by daniel
You have multiple ways to do this:
  • either your plane is simple (like "z=0") and you can simply convert the Z values to a scalar field (with "Tools > Projection > Export coordinate(s) to scalar field") then segment the cloud based on the Z values (with "Edit > Scalar fields > Filter by value")
  • or you can ask CC to compute the "mean plane" (if it suits your need) with "Tools > Fit > Plane" and then compute the distances between the points and this plane and eventually segment the cloud based on the distance values (still with "Edit > Scalar fields > Filter by value")
  • you can do the same as above by creating your own plane with the 'Primitive factory' ("File > Primitive factory'")
  • eventually you can use the "Cross section" tool (in the main toolbar, next to the 'scissors' and the 'red arrows' icons) to manually define a box - potentially oblique - and export the points falling inside as a new cloud