Page 1 of 1

Handle point intensity

Posted: Mon May 18, 2020 12:53 pm
by kittysoman2013
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: Thu May 21, 2020 7:01 am
by daniel
You really have to look at other plugins and parts of the code ;)

But basically you have either to rely on the fact that the user has selected the right scalar field (in which case you can just get the 'active scalar field', or look through the scalar fields attached to the cloud and select the one you are interested in (based on its name?). I would personaly prefer the first solution.

Then you can query the number of values and get or set each scalar field value one by one.

Re: Handle point intensity

Posted: Thu May 21, 2020 4:43 pm
by WargodHernandez
Have you looked into scalar field arithmetic function? It sounds exactly like what your wanting to reimplement.