2
$\begingroup$

so I'm trying to get the shortest path between two empties using the "Shortest edge paths" node, but I can't figure out how to get the vertex of the mesh where the object is located. I already tried with "Field at Index" and the "Transfer Attribute" node, but that didn't work.

This is the setup I tried with: enter image description here

As I understand it, I have to somehow get a matching input in B of the equal node for it to work properly, right?

Can someone please explain what I need to get it correct?

Thanks in advance

$\endgroup$
3
  • 1
    $\begingroup$ I haven't watched the whole video yet, but Kaizen Tutorials has done a detailed tutorial on using it here. It's only available in Blender 3.4 Alpha of course! $\endgroup$
    – John Eason
    Commented Aug 28, 2022 at 16:25
  • $\begingroup$ @JohnEason Thank you for your reply! The video is very informative in general and goes in the direction of what I need, but I still can not figure out how to solve the problem of having just a single path between two objects and not multiple as he shows in the video. $\endgroup$ Commented Aug 28, 2022 at 16:52
  • 1
    $\begingroup$ I'm no expert on geometry nodes. Perhaps someone else here can point you in the right direction! I see that Joey Carlino also posted a video on using it here on the same day. Perhaps that one has more useful info for you. $\endgroup$
    – John Eason
    Commented Aug 28, 2022 at 16:58

2 Answers 2

4
$\begingroup$

Oh, I'm a bit late for the party and my approach is very similar to Crantisz' answer. It's not a real difference but my solution uses... Vector Math! ;-) ... maybe it's still helpful for someone.

This new Shortest Edge Paths node can be a bit confusing, especially when there are more than one start and end point involved. I recommend creating a little playground for visualization.

screenshot geometry nodes

Finding which point is near a given Empty object is straightforward. You calculate the distance between the Empty and the Position of the points that you have. If the distance is zero then it's a perfect match. Due to the limited numerical accuracy of the floating point numbers, the comparision is exactly with zero but +/- tolerance. This tolerance value is called Epsilon for the Compare (Equal) node. Finally, in conjunction with the Vector Math (Distance) node, it defines a search radius.

Let's put it into a node group because we need it twice, one time for the start empty and another time for the goal empty:

node group "is next to object"

The node group works like a filter to sort out the mesh vertices that should be used as the start of the shortest paths. It's kinda like a callback in a programming language.

$\endgroup$
3
$\begingroup$

You can use geometry proximity to find the nearest vertexes like this:

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .