Page 1 of 2
Misinterpreting C2M signed distances ?
Posted: Mon Oct 27, 2025 4:44 pm
by ADf
Thank you very much for the support provided on this forum.
I am currently comparing two structures: a reference model that is 100 units tall, and an experimental one approximately 20 units in height. The two structures are centered for the comparison.
The result of the C2M comparison shows an averaged -15 units distance at the top of the compared structure, which is significantly less than the -40 unit difference that would be expected based on their respective heights.
I previously performed the same comparison in MeshLab and obtained similar results using the vertex quality visualization.
I suspect I may be misinterpreting the output values from this type of mesh comparison, and would greatly appreciate any clarification or guidance you can offer.
Thank you in advance.
Re: Misinterpreting C2M signed distances ?
Posted: Wed Oct 29, 2025 7:27 am
by daniel
Yes, it's probably due to the fact that the distance is the distance to the nearest triangle (wherever it is). And not the distance in a particular direction. Also, the distance to a triangle is commonly defined like this:
https://www.geometrictools.com/Document ... angle3.pdf
What you want is probably the distance along a particular direction... To do this in CC, you would need to first convert the mesh to a dense point cloud (Edit > Mesh > Sample points), and then use the M3C2 plugin, using the sampled mesh cloud as the first cloud, and forcing the normal direction to be 'vertical' (assuming the shape is properly oriented with the height being 'z').
Re: Misinterpreting C2M signed distances ?
Posted: Thu Oct 30, 2025 2:47 pm
by ADf
Thank you for the explanation and for recommending the M3C2 plugin. I’ve tested it, but the computed distances still appear underestimated, despite adjusting several parameters, including forcing the normal direction to be vertical.
For context, the geometries are on the micrometer scale. Could this level of precision pose limitations in CloudCompare?
I’d like to share the file to illustrate the issue more clearly, but it seems attachments aren’t supported here. Is there an alternative way to provide it—such as a cloud link or preferred upload method?
Re: Misinterpreting C2M signed distances ?
Posted: Thu Oct 30, 2025 3:12 pm
by daniel
Well, if they are around 1e-6 or 1e-7, yes, it could create some numerical accuracy issues (but then you could simply scale the coordinates with 'Edit > Multiply/scale').
And you can send me files with any file sharing site (google, onedrive or wetransfer for instance) to
admin@cloudcompare.org
Re: Misinterpreting C2M signed distances ?
Posted: Fri Oct 31, 2025 11:03 am
by ADf
The objects are small, but not that small. That said I did try scaling up the object by a factor of 1000, but the results remained the same. I’ve sent the files to the provided email address, thank you.
Re: Misinterpreting C2M signed distances ?
Posted: Sat Nov 01, 2025 10:08 am
by daniel
Indeed the scale is not the issue here.
I tweaked the M3C2 parameters (shared with you by email).
And for the records, here are the results with the M3C2 plugin:

- m3c2.jpg (193.78 KiB) Viewed 18914 times
(so about +40units for the top points, and -36units for the bottom points)
Re: Misinterpreting C2M signed distances ?
Posted: Mon Nov 03, 2025 1:26 pm
by ADf
Thank you very much Daniel for looking at the file and searching suitable M3C2 parameters. I will work on it and see if I obtain similar output.
Re: Misinterpreting C2M signed distances ?
Posted: Thu Nov 06, 2025 4:43 pm
by ADf
I used the provided M3C2 parameters and found that switching to Multi-Scale calculation mode and aligning the structures at the bottom was actually more effective for the intended comparison. Now, we do obtain logical scale values. thank you very much for the help provided.
That said, the output values are mainly positive, even though the compared structure is actually smaller than the reference. I tried disabling the 'search only in the positive space' feature, but the results remained the same. Any idea how to obtain more relevant signed values?
Re: Misinterpreting C2M signed distances ?
Posted: Fri Nov 07, 2025 7:29 pm
by daniel
So the sign depends on the normal orientation (and the closest surface). So you might have to invert the normals? (but I don't know if it will always make sense)
Re: Misinterpreting C2M signed distances ?
Posted: Fri Feb 27, 2026 2:48 pm
by ADf
Following up on this topic, is there a way to fuse the results of multiple M3C2 comparisons? For example, performing comparisons along several preferential directions (X, Y, and Z), then merging the results into a single cloud while preserving the values (e.g. merged histograms) and a consistent color scale?