nmwsharp / potpourri3d

An invigorating blend of 3D geometry tools in Python.
MIT License
439 stars 35 forks source link

Geodesic Loop through a Specific Point? #9

Open deGravity opened 2 years ago

deGravity commented 2 years ago

I am attempting to compute a geodesic loop through a specific point, but when I use either find_geodesic_loop or find_geodesic_path_poly, the returned path does not contain any of the input points. What I would like is to find a loop through a given point, and use the seed path (loop) to determine the isotopy group of the path.

This image shows what I get currently. The red points are what I input to either find_geodesic_loop or find_geodesic_path_poly. The red line is the result of both of those methods, while the blue line is what I'm hoping for; a loop that starts and ends at the point pointed to in green.

Is there a way to achieve this?

geodesic_loop

nmwsharp commented 4 months ago

(long delayed response in case others hit this problem)

I think you might be able to get this result via find_geodesic_path_poly() , by passing a list [start_point, a, b, start_point], where a,b are additional vertices along the back side of the arm. This will find a geodesic from start_point returning back to itself, but constructing the initial path to go through some extra vertices along the back side of the arm will ensure you get the loop you want.

Note that in this case, the path will be a geodesic everwhere except at start_point --- it will likely have a sharp kink at that vertex. If you're hoping to construct a loop which is as-geodesic-as-possible while still passing through a target vertex, you'd need to change the underlying algorithm termination criteria, although I think it could be done with a fairly simple change.