Shortest Path API / Algo

Discussions concerning programming of SOFTIMAGE©
Post Reply
houGenie
Posts: 9
Joined: 02 Feb 2021, 22:24

Shortest Path API / Algo

Post by houGenie » 08 Feb 2021, 13:35

Hi,

perhaps someone can help me. I am programming a plugin for softimage and I need a way to find the shortest path from a selection (source + destination polygon). Softimage does contain this functionality with the Alt Key. But I did not find any C++ Class or Command to do this from a script or C++. Is it even exposed in the API?
If not, what would be the best way to implement a shortest path functionality? I know this is a complex topic. There are several algorithms which can help (for example A* and so on). But perhaps there are some hints how the Softimage implementation works? Or some nice links for polygon selection specifically with an algorithm for normal polygon meshes (not planes ;-)).

Thank you in advance!

houGenie
Posts: 9
Joined: 02 Feb 2021, 22:24

Re: Shortest Path API / Algo

Post by houGenie » 09 Feb 2021, 11:43

Okay, I have looked for the A* algorithm. But the main point of it is to calculate the heuristic distance between two polygons on a mesh. This is simple on a plane but how would you do that for a complex polygon model? Any hints?

Bravlin Pechatnik
Posts: 19
Joined: 03 Nov 2013, 07:02

Re: Shortest Path API / Algo

Post by Bravlin Pechatnik » 09 Feb 2021, 16:35

Its your lucky day man ))) The one guy spote your post. Another one share this shit. Feel free to use.


houGenie
Posts: 9
Joined: 02 Feb 2021, 22:24

Re: Shortest Path API / Algo

Post by houGenie » 09 Feb 2021, 22:35

Bravlin Pechatnik wrote: 09 Feb 2021, 16:35 Its your lucky day man ))) The one guy spote your post. Another one share this shit. Feel free to use.

Fantastic, thanks! It is the same implementation which I build in python. Interestingly it uses also the Euclidian distance for the hscore, which is surely wrong in many cases. I think in this cases the shortest path is not the shortest path. It would be interesting in which form it deviates from the XSI implementation. Where did you get this code from?

Thank you!

Post Reply

Who is online

Users browsing this forum: No registered users and 67 guests