Grasshopper

algorithmic modeling for Rhino

Hi everybody,

I'm looking for a solution in GH (with or without VB) to get the closest point on a curve to another curve. Finally both curves are referenced from Rhino. Somehow I don't know how to do, but I imagine that there must be a solution. The only way I'm imagining it now is to iterate the t-value on both curves and always mesuring the distance from the points on the two curves to finally sort out the minimal distance. This would be a solution but just an approximative one.
I'd be very glad if someone would have a solution for that problem!

Thanks a lot!

Views: 4413

Replies to This Discussion

Hi Martin,

By using the Pull Point Component you can find the closest point on another item of geometry. The example I've shown below measures every point on one curve to the closest point on another then Sorts them and the point lists to get the least distance.


Note that by default the List Item is ZERO in GH v0.7
Hi Danny,
thanks a lot for your definition!! It works perfectly!
I've just to figure out a way to make it work when I have multiple selection for one curve component... But I guess I'll manage to do that somehow with graft or something similar!

Thanks again!
Do you want to find the closest point on every other curve or just the nearest curve?
I've managed both scenarios so if you're having any problems give me a shout
Wow you're quick I was just writing following while you made the next comment:

The aim is to get the closest points on a bunch of curves to a single curve. But I don't need any closest point within the bunch of curves. Like in this image:

I'm a bit disappointed now :( but had fun coming up with the solution if you needed every curve's closest point to every other curve:

But for what you want you already hit the nail on the head pass the target curves through a graft component
Thanks again! Actually only crafting the target curves wasn't working because there was a conflict in the sorting component. I solved the problem with a small VB component which generates a tree after the curve subdivision depending on the number of target curves.

Interesting. I think the Pull Component has a bug in 0.6.0059 as it only outputs 1 path {0;0} (N=501) instead of 3 Paths in v0.7:

Yeah that could be a reason. I've downgreaded again to version 0.6.0059 because my engine crashed in v0.7 at several points and I don't have the time to try to fix these problems as I'm doing this stuff for a university course (architecture) and we have a pin-up quite soon... :-)
So thanks again for your very quick help!!

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service