Select two points from group for "find shortest path"

   3545   4   0
User Avatar
Member
26 posts
Joined: June 2016
Offline
This must be a trivial problem but I'm so far unable to solve it:

I want to define the start and end point for a find shortest path SOP based on a group of points I have created. I'm still very unexperienced with VEX, so a VEX based solution is as welcome as a pure SOP based one. Thank you :-)

Attachments:
points.png (37.3 KB)

User Avatar
Member
4528 posts
Joined: Feb. 2012
Offline
If you have the group, you can refer to a specific element inside the Group fields or use VEX to filer this group and save the start and end point as a detail attribute and read this directly.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
29 posts
Joined: Dec. 2016
Offline
In the basic Group SOP you can just type in the point number of the point you want to be your start or end.

Attachments:
Path_Example.hiplc (68.1 KB)

User Avatar
Member
26 posts
Joined: June 2016
Offline
pusat
If you have the group, you can refer to a specific element inside the Group fields or use VEX to filer this group and save the start and end point as a detail attribute and read this directly.

Can you point me to some reference for this? My knowledge about VEX is terribly basic, but I really want to improve :-)

RandomGex
In the basic Group SOP you can just type in the point number of the point you want to be your start or end.

Hey thank you for your example file. However, what you are doing with the “start” and “end” group is to define by point id the points which are in the groups. I want to add each point randomly, based on the content of an already existing group, into a new group. So basically:

GroupA: 300 Points
GroupB: 1 Point randomly selected from GroupA
User Avatar
Member
4528 posts
Joined: Feb. 2012
Offline
I wrote this in VEX that does what you are asking:
http://orbolt.com/asset/animatrix::selectRandom::1.00

Then you can use the resulting group in your Group field parameter.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
  • Quick Links