Ellipse by Circumference


Rhino v4

Any way to draw a 1X by 2X ellipse by inputting a value that would equate to a desired circumference?


(Wim Dekeyser) #2

Based on Wikipedia it would appear that your desired circumference would approximately be found when you make the major of your 1x2 ellipse to be C/2,422112 where C is the circumference. Please double check :wink:. And note that this does not give you an exact solution.


This draws the ellipse on your current CPlane origin:

Call Main()
Sub Main()

    Dim c, s, strEllipse
    c = Rhino.GetReal("Ellipse 1:2 circumference")
    If IsNull(c) Then Exit Sub
    If c < Rhino.UnitAbsoluteTolerance() Then Exit Sub
    s = c / Sqr(93 + (0.5 * Sqr(3)))
    strEllipse = Rhino.AddEllipse(Rhino.ViewCPlane(), 1.0, 2.0)
    Rhino.ScaleObject strEllipse, Array(0, 0, 0), Array(s, s, s)
End Sub




That works perfectly.


When using the flow command for text it’s really useful to be able to draw a circle [using the] circumference [command] so you can get stuff to fit easily. It’d be really handy if there was an option for this with regard to an ellipse too.

Sometimes a specific shape and size doesn’t need to be exact so being able to use the ellipse by corners command but with a circumference restraint would be really useful.

Is that’s possible?




I guess yes. Need to find out how to draw it in realtime once the circumference is entered but i am busy atm.



Hi Andy,

you might try this script: EllipseCornerCircumference.py (3.3 KB)



Wow! That’s really powerful, thanks!!