Showing posts with label pciterate. Show all posts
Showing posts with label pciterate. Show all posts

Thursday 22 March 2018

point cloud open, point cloud iterate, point cloud import, while loop VOPS

I'll probably never memorise the proper VEX code for iterating points in a point cloud:

pcopen(something something what?)

So lets look at how to do a basic VOPS setup.

  1. Lay down a "Point Cloud Open" node. Connect the P attribute into P.. and then most likely you'll want to plug Opinput1 into the "file" input. "File" refers to the points you are running over. Set the radius and max number of points to whatever you want. They are probably going to be useful promoted to SOP level.
  2. Make a "Point Cloud Iterate" node. Plug the result "handle" of the Point Cloud Open node into this. The "handle" is a list of all the points that are within the radius you specified earlier. The iterate node is generally used in conjunction with a ....
  3. "While" loop node. The iterate node's handle is used as the opening condition for the While loop. As long as we're running through the points within range, the loop will continue. So plug the Iterate's "Success" output into Condition.
  4. Attach the "handle" from Point Cloud Open to one of the other While Loop inputs. This is important!
  5. Attach anything else you want processing into the other inputs of the While Loop. Eg. Maybe Cd? Or a constant value.
  6. Within the While loop, make ANOTHER "Point Cloud Iterate". We're going to use this is to ensure the While loop ENDS. Hook up the "handle" you attached in step 4, into the input of the iterate. Then connect it's output to the While Loop's End block condition.
  7. OK! The loop is fine now. We can use a "Point Cloud import" node to get any data we want. We'll use the "handle" value from step 4 again as an input. Make sure to set the parameters correctly. Eg. if a value is a float,vector,integer etc.
  8. Do what you want...maybe import the X position of a point and add it to the red of Cd?
  9. Plug any outputs into the While Loop End's box
  10. Connect the outputs to things. It might be the global output, or to some bind-exports.
And that's the basics!