Method to compute spacing between points

Feel free to ask any question here
thierry
Posts: 15
Joined: Tue Sep 17, 2019 7:20 am

Method to compute spacing between points

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

Re: Method to compute spacing between points

Post 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)
Daniel, CloudCompare admin
thierry
Posts: 15
Joined: Tue Sep 17, 2019 7:20 am

Re: Method to compute spacing between points

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

Re: Method to compute spacing between points

Post by daniel »

Yes!
Daniel, CloudCompare admin
thierry
Posts: 15
Joined: Tue Sep 17, 2019 7:20 am

Re: Method to compute spacing between points

Post 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
Attachments
approx_density.PNG
approx_density.PNG (1003.05 KiB) Viewed 10365 times
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Method to compute spacing between points

Post 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?
Daniel, CloudCompare admin
thierry
Posts: 15
Joined: Tue Sep 17, 2019 7:20 am

Re: Method to compute spacing between points

Post by thierry »

It works ! Thanks a lot.
thierry
Posts: 15
Joined: Tue Sep 17, 2019 7:20 am

Re: Method to compute spacing between points

Post by thierry »

Does the remove dupicate tools usable in command line ? i don't find it :-/
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Method to compute spacing between points

Post 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 ;)
Daniel, CloudCompare admin
thierry
Posts: 15
Joined: Tue Sep 17, 2019 7:20 am

Re: Method to compute spacing between points

Post by thierry »

Unfortunatly not :-(
Post Reply