Grasshopper

algorithmic modeling for Rhino

Hi guys,

 

Is there a way to find the shortest distance between any two curves ?

 

Cheers,

 

Arthur

Views: 16560

Replies to This Discussion

This sounds like a job for Galapagos! But I have a feeling you want to do this with many many curves!?
Attachments:
nice!
The shortest line between the two curves must be perpendicular to each, right? So here's a crazy idea: treat one of the curves as a point - "from its perspective" the other curve is a lofted surface. Find the closest point to this surface and remap it to get the result:


This is probably nonsense in terms of memory usage but still it's a fun mental exersise :)
Attachments:
Here's how I've done this in the past.

Hey Danny,

 

this solution is depending on the DevideCrv N. Like it is set onto a iteration of 500 ( in your example). Isn´t it?

So if I want to have it exactly (I know this is about presetings). I need to take a higher slider value. If I check the result with the Rhino CrvDeviation there always seems to be a bit of a difference.

I guess I do need to take galapagos, do I?

 

Best Regards

 

DeDackel

Here is an iterative "dichotomic" method using Hoopsnake. (for 2 curves only)

Attachments:

Another simpler version

 

Attachments:

Thanks Systemiq,

I've been trying to figure this out all morning.

 

Is there away of doing for more that two curves? 

Probably, thinking about it.

Thanks for this.

Although im trying to do this for a series of profile curves against one rail curves. Ive tried matching the tree structure and still to no avail. any assistance?

Hi Arthur

there is a Curve Method:

public bool ClosestPoints(       
Curve otherCurve,   
out Point3d pointOnThisCurve,        
out Point3d pointOnOtherCurve)

cheers to]

 

Hi all,

very intriguing topic here. Different patterns intersect here. It's great to see programming, mathematical, numerical and evolutionary methods at work here.

I like all of them really, as they prove the inventiveness of people! :)

Following To's advice, these scripts obtain the same result in Python, C# and Vb.Net. Just a few lines. Probably they will be replicated similarly in Grasshopper components soon.

 

- Giulio
____________
giulio@mcneel.com
McNeel Europe

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service