Jump to content
Sign in to follow this  
Nicholas Yiallouris

Grouping Points in an Array

Recommended Posts

I currently have an array of points gathered at VOP level, and I'd like to group those points in to deferent group names.

So for instance:

[1, 34, 5] into group 1

[2, 12, 67] into group 2

I'm thinking I may need a for each...

And as a matter of interest could one test if a point was part of a certain array?

 

thanks

 

 

Share this post


Link to post
Share on other sites

you can use find() function to test if an item is in an array or not http://www.sidefx.com/docs/houdini15.0/vex/functions/find

you can use setpointgroup() function or VOP node to set group membership on non-current point http://www.sidefx.com/docs/houdini15.0/vex/functions/setpointgroup

or i@group_groupname = 1; if you are doing it for current point

Share this post


Link to post
Share on other sites

Thanks anim but after a bit of tinkering it alludes me.

I'm only getting my head into VEX, I add an inline VEX node into my VOP and type this:  int [] find(arraytype array; type search), but now I'm stumped.

I've basically got an array called "test_pcFind" that looks like this [1,169,513] and all  I want to do is test if these three point's are part of the same array so I can group them.

Any thoughts anyone?

 

 

Share this post


Link to post
Share on other sites

here is example file with 4 ways to get group from array (Point VOP, Point Wrangle, Detail VOP, Detail Wrangle)

ts_array_to_group.hip

  • Like 3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×