Grasshopper

algorithmic modeling for Rhino

Dividing a curve w/ adjustable "start point" and wraparound

The problem: I want to take an open 3D curve and divide it into fixed length segments, but I want to be able to adjust the positions of the divisions with a slider, and have them wrap back onto the curve if needed, so that the lengths of the divisions is maintained. (There may be odd length segments at the beginning and end of the curve, of course, but the segments in between should be the same fixed length.)

With a closed curve, the analog operation would be adjusting the seam before dividing.

Does anybody have an idea of how to accomplish this? I have a feeling I'm missing something obvious.

I tried just using DivLength, then adding a slider value (0.0-1.0) to the resulting curve parameters. For any parameters that exceeded 1.0, I just subtracted 1 to make them wrap back to the start. (The curve was reparameterized, of course.) But the resulting lengths aren't correct, naturally: parameters don't necessarily correspond to length. I enclosed this first naive attempt in case it's useful.

Thanks for any suggestions.

Views: 7164

Attachments:

Replies to This Discussion

Try the Paneling Tools for Grasshopper. It has a component called "Divide Length with Reference" which, I believe, does exactly what you want.

hows this

Attachments:

Taking Michael's solution one step further:

well done !

Thanks, Michael, that's just the push I needed: Of course! Divide the curve in 2 at the parametric "start" point, then use divlength on each of the halves. D'oh!

I took it one step further, like Sameer, and did both halves at once, then took the further step of merging all the resulting points and converting back to a list of parameters on the original curve, see enclosed.

Thanks, both of you!

Attachments:

your welcome, btw the addition of curve closest point is not doing any different then the most recent screenshot I posted. They result in the same format by simply flattening p output of divide length.

I need to end up with t parameters on the original curve, so I used CCP to do that, but I'm sure there are lots of other ways to get there...

Thanks again.

i see as for t params yes.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service