line weight of 0mm is resolved as 0.02mm in the frontend of the drawing add-on
A line weight of 0mm is resolved as 0.02mm, this prevents backends
to draw nothing if line weight is 0mm.
Valid DXF line weights are fixed values: 0mm, 0.05mm, 0.09mm...
fixes
@@ -533,6 +533,7 @@ class RenderContext:
see: :attr:`ezdxf.lldxf.const.VALID_DXF_LINEWEIGHTS`
"""
+ def lineweigth():
aci = entity.dxf.color
# Not sure if plotstyle table overrides actual entity setting?
if (0 < aci < 256) and self.plot_styles[
@@ -557,6 +558,12 @@ class RenderContext:
else:
return float(lineweight) / 100.0
+ # A line weight of 0mm is resolved as 0.02mm, this prevents backends
+ # to draw nothing if line weight is 0mm.
+ # Valid DXF line weights are fixed values: 0mm, 0.05mm, 0.09mm...
+ return max(0.02, lineweigth())
+
+
def default_lineweight(self):
""" Returns the default lineweight of the document. """
# todo: is this value stored anywhere (e.g. HEADER section)?
