Page 1 of 1

Build solution with DistanceComputationTool::computeCloud2MeshDistance

Posted: Fri Jan 04, 2019 7:09 pm
by hugzer
Hi everyone,
For a school project I have to realize a solution/script in C++ that use computeCloud2MeshDistance to compare a PC with a mesh.
I have, in input, a xyz file that contains the point cloud and a off file that contains the mesh and I want only the final average distance between my two compared entities.There is no need to make a GUI.
I understand this function is available in DistanceComputationTool.h and named computeCloud2MeshDistance. I don't understand the way to put in function's input my two files, PC and mesh. The function want a GenericIndexedCloudPersist and GenericIndexedMesh.
I tried to understand the I/O operation system with AsciiFilter class but it's doesn't solve my problem...
Anyone have an idea ?

Re: Build solution with DistanceComputationTool::computeCloud2MeshDistance

Posted: Sun Jan 06, 2019 4:06 pm
by daniel
Hum,

If you want to use CC_CORE_LIB directly, then you have to develop your own C++ program that links this library, then create CCLib::PointCloud and CCLib::SimpleMesh entities and load your data inside, and then call this method.

But a much easier way to do this is to use CloudCompare's command line mode: http://www.cloudcompare.org/doc/wiki/in ... _line_mode

Re: Build solution with DistanceComputationTool::computeCloud2MeshDistance

Posted: Mon Jan 07, 2019 12:32 pm
by hugzer
Thanks Daniel,
Command line wiki was very useful."CloudCompare -o cloud1.bin -o mesh.obj -c2m_dist" command generated scalar distance fields but is it a way to generate only a simple file with average C2M distance ? I want only the average of scalar fields.
Maybe it is a way to implement my own command line based on yours to get only mean distance with unsigned values ?
Have a nice day.