Grasshopper

algorithmic modeling for Rhino

Divide Distance problem.

Hi everyone! I'm trying to divide ellipse in to same size segments. The way i decided to do that is to divide measured length of an ellipse in to desired number of segments and send this data to DivdeDistance component, but as u can see i've got a little problem with length of the last segment. Hope for your help! Thank you!)

Views: 4036

Attachments:

Replies to This Discussion

Use Divide by Length rather than by Distance..

And Use A/B rather than A\B..

Tnx! but DivLength does not give me precise length of every straight segment, what is very important for me!!!

divDist seems to be exact what i need, but i can't solve the problem with the last segment. I'm little bit confused about the way of resolving such a simple task...

Hi Markiian,

this is a very difficult problem that in some cases might not have a solution. When you divide by linear distance between points, it matters a great deal where your first division point is. By changing the start-point or the division distance even slightly, you might end up with a radically different result. This instability of the divide-by-distance algorithm decreases as the division distance gets smaller compared to the level of detail of the curve. Curves without inflection points also suffer less. The only way to do this in Grasshopper without resorting to VB/C#/Python is to use Galapagos, as you need to optimize the distance of a non-linear system.

I'll try and post a file after lunch.

--

David Rutten

david@mcneel.com

Actually it just took a few minutes. Open the attached file, double click the Galapagos object, switch to the Solver tab and press Go.

--

David Rutten

david@mcneel.com

Attachments:

An alternative to using Galapagos is to use Kangaroo, see the attached definition:

Attachments:

Thanks a lot i was not familiar with galapagos, but it seems to be a good resolution. Thank you again! Can you suggest any useful  practical examples of using this component?

I'd go fo the Kangaroo solution in this case. You don't need to define a range and kangaroo will solve automatically everytime you change the definition upstream, you dont need to open and run anything and it's faster.

I don't know Markiian's level of experience with Kangaroo, but in my case, I'll need more explanation on how to make this work.

Did you miss the GH file I attached 4 posts above?

Yes, I did. Still confused. :(

But it does work when you open that file, right?
If so, i guess you mean you can make it work but you don't understand the logic behind it.

No, it doesn't work:

Which line should be input into the component?

• View All