Jump to content

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?





Link to comment
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

Link to comment
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?



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...