Grasshopper

algorithmic modeling for Rhino

Is there a way to find the farthest point on a curve as opposite to closest point on curve?

Views: 6677

Replies to This Discussion

Maybe just divide the curve with a lot of points. Then do a distance check of all the points with your orgin point and use the sort component to get the farthest one.

Is the solution that Matthijs suggested (divide the curve into a bunch of points and then do a distance check between all of the points) still the best method to finding the farthest (or furthest?) point on a curve?  Is there another solution?

Probably. I'm sure there's smart ways of doing it, but that'll require all sorts of loops and recursions.

I tried creating an inverted curve (by mirroring control-points in a sphere), but it only works on NurbsCurves and only when they have lots of control-points, and even then it sometimes gets confused when the point is very near the curve.

--

David Rutten

david@mcneel.com

Attachments:

Dividing the curve in N subcurves, then taking the subcurve which is the "farthest" one (by using middle point). Repeat until the length is under a tolerance.

Not perfect but should work.

Attached an example working with Anemone:

Attachments:

Another way of doing this. A bit primitive and slow, but does not involve scripting and is using very few components. Hoopsnake can be replaced with other loopers.

Works best when start points is on a curve.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service