Jump to content

vex question - haspointattrib - isolating objects


MadMax50

Recommended Posts

Hello

I am not sure if this is the place for vex questions, I couldn't find any designated forum for it. 

I am trying to isolate some objects that intersect with a curve. I have attempted to use the "haspointattrib" function for this, but it seems as if I may not understand how to use it properly regardless of my research. I was expecting the function to return 1 or 0 depending on if it had the "touch" attribute, and then I would isolate the pig heads based on that value to isolate what I need. ....  Would someone be able to help me with this, or perhaps let me know what the best possible solution would be to just isolate the pig heads that touch the curve ?

 

I know I can do an attrib transfer with some grouping but that may select pig heads that are also not interesecting. with the curve exactly

Please and thank you

attrib_detect.jpg

detect_attrib_and_isolate.hip

Link to comment
Share on other sites

Hi @MadMax50,

after the intersect node, fuse and attribute promote can create an array for grouping the intersecting geometry with VEX:

int index[] = detail(1, 'index', 0);

foreach(int i; index){
    setpointgroup(0, 'in', i, 1, 'set');
}

The best place for VEX related questions on odforce is probably the scripting section: https://forums.odforce.net/forum/28-scripting/ 

group_intersect.hipnc

  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

I would just pack each pighead.
Do a group based on the distance function, and transfer that group over when unpacking.
Then it just has to calculate over a few points instead of all that geometry.

  • Thanks 1
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.

Guest
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...