Drawing an elliptical (surface) arc

I have the normal parameters to draw an ellipse – center point, major/minor axis, rotation – and this works fine, using EllipseGraphics. I’d like to draw only a portion of the outline of the ellipse, say, from +45 to -45 degrees. I found this geometry library but all the methods are marked private and the most promising one (“pointOnEllipsoid”) is not documented or exported. If I could sample points along the path of the ellipse, I could draw a polyline. If it’s easier to somehow clip/mask EllipseGraphics instead, that be fine too.

Do any of the methods in the linked geometry library solve your issue? If there’s a good use case for exposing it to the public API then that’s not out of the question.

I don’t think clipping/masking the full ellipsoid is an easier path, but have you looked at the partial ellipsoid geometry? https://sandcastle.cesium.com/index.html?src=Partial%20Ellipsoids.html

Thanks Omar! I’m not sure about the linked library because the parameters on the methods aren’t documented, but it looks like probably the non-exported pointOnEllipsoid is the primitive I’d need. (Really, a simple iterative wrapper “pointsOnEllipsoid”, plural, would be idea :smiley: )

That said, the Partial Ellipsoids demo looks really interesting and might be useful for several of my shape requirements. The “wedge” really caught my eye. If I can use a very low cone value, I can probably approximate a 2D ellipse, then the clock values let you show just a “slice” of it. I’ll have to play with it a bit to translate major/minor axis plus orientation into radii (as Cartesian3) plus a transformation Quaternion, but it’s a great start.

I edited the existing example into this demo, which looks good but does produce some visual glitches:

I guess the tesselation for the fill uses a slightly different calculation than the outline wireframe?

1 Like