Adding a directed Path Cost to Find ShortestPath SOP

   529   2   1
User Avatar
Member
6 posts
Joined: April 2018
Offline
Hi Everyone!

I am in the process of learning Houdini and I love this program very much. But atm I want to create a specific generative effect with the find shortest path SOP which hase stumped me for ideas.
I would like to have another "parameter" that weights the path so, that the vessel would grow more in one direction (see sketch "Direction Parameter "V"")instead of them growing in every direction. I am not sure how I would go about creating this "parameter".
There is a "Directed Primitives" constraint in the find shortest path SOP, but i haven't figured out how to use that. My intuition says I have to create a vector for each edge... If someone has an idea how to create this effect, I would be very grateful for some insight!
Here is a sketch of what I want to achieve and what I have so far.

Unfortunately my HIP file is too large for an upload.

Attachments:
Setup_Sketch.jpg (617.3 KB)
Vessel_Setup_Current.png (4.4 MB)

User Avatar
Member
477 posts
Joined: July 2005
Offline
Here are some ideas:

Each primitive should exactly contain 2 points (start and end). Replace each primtive by two (new) primitives, where both have opposite directions. Now calculate the angle between each primtive direction (endpoint - startpoint) and the given direction. Based on this calculation value, you can set an angle based primitive cost (using a ramp for example). After this remove the "expensive" paths.
Edited by Aizatulin - Jan. 16, 2024 10:40:29

Attachments:
shortest_path_direction_influence.hipnc (141.3 KB)

User Avatar
Member
6 posts
Joined: April 2018
Offline
Hey Aizatulin,

Damn, thats a very nice implementation but the VEX Code in the "set_new_pts_costs_by_dist_and_dir" will take some time for me to undestand, but I think I understand the bigger idea behind it! Thanks very much!
  • Quick Links