Grasshopper

algorithmic modeling for Rhino

How to determine offset when the length of the desired offset curve is known

I'm trying to determine the required offset of a given ellipse, knowing the starting ellipse and the length of the required offset curve.

In this example, I know my starting ellipse, and I know that the length of the resulting offset must be equal to 7x the length of the starting ellipse.

From that, how would I determine the offset distance?

I'm sure there is a way to do this, but I've just got a brain block...

Views: 1450

Replies to This Discussion

Hi Norm,

Your final curve (the one that has circumference 7 times larger than initial ellipse) is circle?
If that is so, than the solution of the problem is just in ellipse circumference formula. I took the fourth one(Infinite series 2) from here:

Attachments:

Thanks djorde... No, the outside curve is not a circle.  It is the curve that would result from taking the offset of the ellipse.  So the outside curve is not an ellipse, nor a circle -- it is the offset of an ellipse.  You can see what I'm doing in this attached gh. 

In the below image you can see the calculated ratio of offset curve to ellipse curve (6.661244).  What I need to determine is effectively the reverse... given an ellipse, and the resulting offset curve length (7x ellipse length), what is the offset value needed to get that desired offset curve length?

Attachments:

btw... thanks for the link to finding the length circumference of an ellipse.  I had no idea it was so complicated and exacting.  I just always cheat by using the Grasshopper "length" component :)

Sorry for misunderstanding the type of the final shape.

If we leave out the equations, we could easily do this with Galapagos:

Attachments:

My gosh... thanks djordje!  I have never used Galapagos and didn't really know what it was for.  It worked great :)  It does take a little bit of time to run so it can be a somewhat slow model if doing many variations -- but sure is better than pick and shovel!

Thanks so much for your help.

no need for galapagos... this is pretty straight forward with a little scriping

Attachments:

Nice iterative process, Hannes.  And cool that you used the doc tolerance for the length fit tolerance. Thanks! 

Hi Norm,
in this case you can calculate the right offset distance directly from the length of the ellipse.

The offset is 2*Pi*o longer than the ellipse (o = offset distance). In your example the offset has to be six times longer than the ellipse. So you can say:

2*Pi*o = 6*l        (l = ellipse length)

solve for o:

o = 3*l/Pi

You can do this with simple Grasshopper components:

Cheers!

...and the definition

Attachments:

Nice Thomas.
What is the math behind the 2*Pi*o = 6*l ?

Danke.

Thanks!

I have calculated the circumference of the ellipse:

ellipseLength = 4*a*E(Sqrt(1-b^2/a^2)) = l


Then I calculated the length of the offset:

offsetLength = 2*Pi*o + 4*a*E(Sqrt(1-b^2/a^2)) = 2*Pi*o + l

Now we can say:

offsetLength = 7*ellipseLength
2*Pi*o + l = 7*l
2*Pi*o = 6*l

Excellent and elegant, TJO!  I plugged this in and it worked beautifully and quick.  And because of this my model is more responsive and dynamic :)

Also, because of this formula, I can then modify it slightly to use a parameter input for the desired length multiplier of the offset curve.  Here's my slightly modified formula...

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service