Grasshopper

algorithmic modeling for Rhino

I'm hoping someone can suggest a way to solve a small problem.

I have some curves, not quite parallel to each other, and I want to adjust the curves so that the distance between pairs of them is a specified constant. (BTW, I realize that there may be no perfect solution to this in many cases. But I'm happy with a close approximation.)

Enclosed is the current scheme, based on CrvCP, that works well UNLESS the curves are so twisted that CrvCP finds a closest point on a different "section" of the curve. (Shown in the example: the green curve passes too close to the red curve in one area, throwing the whole thing off).

I'm trying to find a reasonably elegant way to solve this problem, and beating my head against the proverbial wall. It seems that doing this operation on successive sections of the curves is a good approach, but I can't quite conceive how to do that. Can anyone suggest a direction to take? I'm hoping there's an approach to this problem I haven't noticed yet...

Thanks for any insights,

Dave Johnson

Views: 290

Attachments:

Replies to This Discussion

Doing this gives better results with your example, but will probably cause problems with other cases.

Hmm, interesting. This neatly sidesteps the problem, all right, but my initial reaction was that it will get progessively less accurate along the length of the curve. However, since the curves in my problem set are all closed, maybe this will work well. I'll experiment, thanks for the nudge!

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