Adaptive template geometry scripting: command to draw an ellipse arc?

Hello ansys community,
I am wondering if there is a command to draw an ellipse or a portion of it (just one of its arcs) in MotorCAD adaptive template geometry. So far, I've only found the possibility to draw circular arc sections. I am aware of the possibility that one could approximate this via bezier curves but I found this a little cumbersome.
Thanks for your reply.
BR
Richard
Answers
-
Hi Richard,
At the moment, the best way to approach this would be to generate points along the ellipse (either with an additional library, or directly from the equation of an ellipse), and pass these to 'return_entity_list' from 'ansys.motorcad.core.geometry_fitting'. This takes a list of points as an input, and returns a list of lines and arcs that approximate the shape within a defined tolerance.
So for example if you had a list of x,y points along your ellipse in xylist, this would populate curve_entities with a list of curves that approximates the ellipse:
linetolerance = 0.01
arctolerance = 0.01
curve_entities = return_entity_list(xylist, linetolerance, arctolerance)The entities in curve_entities can then be added to a region with region.add_entity.
We hope to add some 'wrapper' functions to make this easier in the future, but hopefully this should allow you to do what you want.
0