You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error in matplotlib img export of nested polylines in 1.1.X #939
Describe the bug This example from the documentation used to act as expected in v1.0.3 but in v1.1.0 and v1.1.1 the internal polygons (islands) are not rendered as cutouts when using ezdxf.addons.drawing.matplotlib.qsave. For clarity: it appears as if the modelspace can be exported as a DXF with the hatch correctly depicting the cutout islands in a shape - the maybe has only comes from the image export. I haven't been able to isolate what changes might be causing the issue.
To Reproduce
A small snippet that can display the issue (taken from the example linked above):
import ezdxf
from ezdxf.addons.drawing import matplotlib
# hatch requires the DXF R2000 or later
doc = ezdxf.new("R2000")
msp = doc.modelspace()
hatch = msp.add_hatch(
color=1,
dxfattribs={
"hatch_style": ezdxf.const.HATCH_STYLE_NESTED,
# 0 = nested: ezdxf.const.HATCH_STYLE_NESTED
# 1 = outer: ezdxf.const.HATCH_STYLE_OUTERMOST
# 2 = ignore: ezdxf.const.HATCH_STYLE_IGNORE
},
)
# The first path has to set flag: 1 = external
# flag const.BOUNDARY_PATH_POLYLINE is added (OR) automatically
hatch.paths.add_polyline_path(
[(0, 0), (10, 0), (10, 10), (0, 10)],
is_closed=True,
flags=ezdxf.const.BOUNDARY_PATH_EXTERNAL,
)
# The second path has to set flag: 16 = outermost
hatch.paths.add_polyline_path(
[(1, 1), (9, 1), (9, 9), (1, 9)],
is_closed=True,
flags=ezdxf.const.BOUNDARY_PATH_OUTERMOST,
)
matplotlib.qsave(msp, "nested_polylines.png")
Expected behavior
Expected behavior is to have the inner polyline removed from the outer polyline as shown:
Actual behavior is to only display the outer polyline (or perhaps to also render the inner polyline but also filled).
@dev-hack95 Thank you for your offer, but the regression introduced in version 1.1 is already fixed. The issue is only open to allow the original author to test the fix. If no comment is posted within a week, i will close the issue by myself.
The development takes place on the master branch and this branch is always in a releasable state. The stable branch is the state of the latest release.
Activity
fix regression #939
dev-hack95 commentedon Oct 18, 2023
Can i contribute in this, actually i am working on this library and want to know better and also good at matplotlib
dev-hack95 commentedon Oct 18, 2023
which is the branch btw
mozman commentedon Oct 18, 2023
Hi!
@dev-hack95 Thank you for your offer, but the regression introduced in version 1.1 is already fixed. The issue is only open to allow the original author to test the fix. If no comment is posted within a week, i will close the issue by myself.
The development takes place on the master branch and this branch is always in a releasable state. The stable branch is the state of the latest release.
dunaden001 commentedon Oct 23, 2023
Sorry for the delay, pulled and tested the tagged commit and it does appear to solve the issue.
Update ezdxf (#6)