Can xyzdist VEX function be used on specific primitives without making a group per prim?

   1986   2   1
User Avatar
Member
31 posts
Joined: Dec. 2006
Offline
Hi,
I want to use:
http://www.sidefx.com/docs/houdini/vex/functions/xyzdist.html [www.sidefx.com]
And I see that it can be limited to work on specific primitive groups but in my case I want to run it only on 1 primitive each time it's called. I can see that technically I could make a group per primitive but that would seem clunky and expensive.
Is there another way to do this? Seems like I might be able to make an expression to specify the primitive.

Otherwise, should I used a different method to find closest position (not point) on a primitive?
Thanks
User Avatar
Staff
6198 posts
Joined: July 2005
Offline
Groups can be ad hoc groups, so don't need to be created ahead of time.

So you can use the group “53” (note a string holding 53, not the integer 53) to find distance to primitive 53. sprintf(“%d”, primnum) can be used to generate such a group.

A big warning, however: internally it will have to create a group for all those primitives. So while it won't be as clunky, there may be more expense than you expect if every point creates a different group.
User Avatar
Member
31 posts
Joined: Dec. 2006
Offline
Thanks for the quick reply. I'll try that out and see how it goes. If it's too heavy I may have to write a closest distance to curve function manually as it's curve primitives that I want to test.
Thanks again
  • Quick Links