Page 1 of 2

Method to compute spacing between points

Posted: Tue Sep 17, 2019 7:55 am
by thierry
Hi everybody,

I have a simple question, is there a method to compute spacing between points in the same cloud in CC ?

Thank you.

Re: Method to compute spacing between points

Posted: Wed Sep 18, 2019 8:11 pm
by daniel
Yes, this is called 'density'. Either you compute the density in a given radius, or what we call 'approximate density', which is actually proportional to the distance to the nearest neighbor. In the 2.11.alpha version, these measures can be computed thanks to the 'Tools > Other > Compute Geometric features' tool.

See https://www.cloudcompare.org/doc/wiki/i ... le=Density (for previous versions)

Re: Method to compute spacing between points

Posted: Thu Sep 19, 2019 7:47 am
by thierry
Hello Daniel and thanks for your answer

So i f I understand well the wiki, the approx density compute the spacing as the R radius while N=1 right ?

So all I'll have to do is a reverse calculus of the scalar field value as, with the surface density:

S = N / (Pi.R2) while N = 1
> R = SQRT(Pi/S)

I will got the spacing to the nearest neighboors, I am correct ?

Best regards

Re: Method to compute spacing between points

Posted: Thu Sep 19, 2019 6:31 pm
by daniel
Yes!

Re: Method to compute spacing between points

Posted: Fri Sep 20, 2019 2:50 pm
by thierry
Great ! thank you.

But a new wild question appears!

That's troubling because after using the approx density I've got a whole part of my cloud under NaN values, see PNG in attachments.

Is this normal ?

BR

Re: Method to compute spacing between points

Posted: Fri Sep 20, 2019 7:51 pm
by daniel
How strange...

I just realized that the "Approx density" tool was not accessible in the latest 2.11.alpha version... it will be hard to debug.

The only reason I would see is that some points are duplicated. Then the distance to the closest neighbor is zero, and the density is infinite (= NaN).

Can you try to use the tool 'Tools > others > remove duplicate points' first and see if some points are removed? And then compute the (approx) density again?

Re: Method to compute spacing between points

Posted: Sat Sep 21, 2019 1:34 pm
by thierry
It works ! Thanks a lot.

Re: Method to compute spacing between points

Posted: Sat Sep 21, 2019 2:44 pm
by thierry
Does the remove dupicate tools usable in command line ? i don't find it :-/

Re: Method to compute spacing between points

Posted: Sat Sep 21, 2019 7:16 pm
by daniel
Hum, probably not, it's rarely useful... Well, it's always technically possible to add the option if you have some C++ development skill (or know someone who could do it ;)

Re: Method to compute spacing between points

Posted: Tue Sep 24, 2019 6:53 pm
by thierry
Unfortunatly not :-(