Repository navigation
Is it possible to defined a filled circle/ellipse? #1161
Answered
by
mozman
johnthagen
asked this question in
Q&A
Answered by
mozman
Sep 12, 2024
Replies: 1 comment
|
You have to create a See import ezdxf
doc = ezdxf.new("R2000")
msp = doc.modelspace()
msp.add_ellipse((0, 0), major_axis=(0, 10), ratio=0.5)
hatch = msp.add_hatch(color=2)
edge_path = hatch.paths.add_edge_path()
# each edge path can contain line, arc, ellipse and spline elements
# important: major axis >= minor axis (ratio <= 1.)
edge_path.add_ellipse((0, 0), major_axis=(0, 10), ratio=0.5)
doc.saveas("solid_hatch_ellipse.dxf")
|
0 replies
Answer selected by
johnthagen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

You have to create a
HATCHwith anEdgePathas boundary.See
HATCHtutorial, 3rd example: https://ezdxf.mozman.at/docs/tutorials/hatch.htmlEdgePath.add_line()EdgePath.add_arc()EdgePath.add_ellipse()EdgePath.add_spline()