Kangaroo Pathfinder with terrain holes(obstacles)

I want to make pathfinder
But paths get stuck around the hole.
To prevent this, I want to make repulsive force between Polylines and Curves.
Then the paths will be distanced from the holes, creating clear routes.
I’ve tested scripts and other resources created by users around here like @DanielPiker before.
But nothing worked.

How can I avoid the potholes and get to my destination?

  1. Current State


2) Result I want


3) Script

Q. Path Finder with Holes.gh (137.8 KB)
4) Script gh file

The easiest way is to offset the hole shapes, trim the surface with these, and do the path finding on this reduced surface:
Q. Path Finder with Holes.gh (142.0 KB)


Setting the Grab range to something more suited to your model scale also allows you to drag the paths to a different side if desired.

1 Like

Thank you Daniel! Great way to do it!

I’ve done a lot of research on how to get around the holes… I researched more and more… I finally made it!

Create a pipe around the edges of the hole, and use ‘SolidPointCollid’ to block points from crossing the borders.
and use ‘SolidPointCollid’ to block points from crossing the borders

But like you said, I have to Grab out the path if I set the route to cross the middle of the hole. So it would be good to set the route to avoid the hole as soon as possible

Thank you so much for helping me whenever I was in trouble :grin: