algorithmic modeling for Rhino
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...
Tags:
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:
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?
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 :)
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
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
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...
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by