Page 1 of 1

Handle point intensity

Posted: Thu May 17, 2018 2:50 pm
by IroClo
I am trying to create my own plugin for CC and i want to calculate some values according to the intensity of the cloud points.
How can i reach this value (intensity), as well as coordinates, in order to loop over the whole point cloud and apply my functions?

I had a look at other plugins but i am very confused. Could you please help me if i wanted for example to aplly a function like :

a= b*I

to each point of the point cloud?

Where a,b are known and I is the intensity?

Thank you very much!

Re: Handle point intensity

Posted: Sat May 19, 2018 10:57 pm
by daniel
You have to identify the right scalar field (either you use the active one, or you simply look for the scalar field named "Intensity", or you let the user select it - but you'll need a dedicated interface to do it).

Then you can get the ith value of the scalar field with 'getValue' (called directly on the right scalar field instance). And you can access the ith point coordinates with 'getPoint' (called on the cloud).