I’m interested in drawing elliptical arcs (i.e. parts of ellipses) in Rhino. Currently, I’ve tried splitting an ellipse into four parts (not necessarily into quadrants), like so:
However, upon checking the object type and using IsEllipse, IsArc in rhinoscriptsyntax, I get some unexpected results:
rs.IsEllipse: True rs.IsArc: False
which means I can’t sense that it’s an arc, and that it still registers as an ellipse. What would be a surefire way to generate an elliptical arc that Rhino can sense, and how do I check if a curve geometry is an elliptical arc using RhinoPython / Rhinoscriptsyntax / Rhino common? Would I need to do some math bits first in order to check if it is elliptical?
Thanks for the suggestion. Upon testing, it appears to still identify both ellipses and elliptical arcs as ellipses, so I’d need to constrain it a bit more for arcs. As for issues:
Unfortunately, it also identifies circular arcs as ellipses (which I know is technically correct, since circles are ellipses where focus 1 == focus 2 == center and so on). Any suggestions for a further constraint that uses Rhino Common or Rhinoscriptsyntax? I’ve developed my own checking function for circles vs. ellipses that distinguishes between the two, but would like to know if Rhino already has something similar (as it makes life a lot easier).
How do I reconstruct an elliptical arc using Rhino Common and rhinoscriptsyntax, and what information do I need? This will affect which data about elliptical arc I will be storing. I am aware of AddArc3Pt, AddArc, AddArcPtTanpt, but these appear to be primarily for circular arcs.
Also, yes, constructing one from a non-uniformly scaled circular arc (as well as cutting an ellipse up) seems to work. I’ll post some results here once I have something more conclusive.
Not sure if I’m missing something else here, but isn’t the only difference between ellipses and elliptical arcs the fact that the former is a closed curve? i.e. rs.IsCurveClosed() or the RhinoCommon method .IsClosed() .
As for constructing elliptical arcs, a convenient way to do so for smaller angular spans is by directly specifying the degree-2 rational Bezier form via 3 control points and varying the weight of the middle point.
Thanks for the suggestion. I’ve managed to get this working up to a certain point, and right now I’m stuck with trimming off the bits of the curve outside the elliptical arc’s domain. Do you have any suggestions for how to do this using Trim or Split?
To illustrate, I’m trying to get arcs that look like this:
My current solution is to generate the ellipse, then turn it into a Nurbs Curve and try to trim/split it from there. However, I’ve tried Split, but it doesn’t give back the elliptical arc as per my original start and end points. I also think I might not be using Trim correctly, as I get the following error:
Message: expected CurveEnd, got float
If Trim is the better solution, what kind of data type should I be using for the interval input of rs.TrimCurve? (I’m able to get the start and end point coordinates of my elliptical arc.)