Build solution with DistanceComputationTool::computeCloud2MeshDistance

Any question about the database & algorithms library 'CCLib'
Post Reply
hugzer
Posts: 2
Joined: Fri Jan 04, 2019 6:46 pm
Location: Nantes, France

Build solution with DistanceComputationTool::computeCloud2MeshDistance

Post 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 ?
daniel
Site Admin
Posts: 7701
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Build solution with DistanceComputationTool::computeCloud2MeshDistance

Post 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
Daniel, CloudCompare admin
hugzer
Posts: 2
Joined: Fri Jan 04, 2019 6:46 pm
Location: Nantes, France

Re: Build solution with DistanceComputationTool::computeCloud2MeshDistance

Post 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.
Post Reply