add test for make_path() from circular lwpolyline with inverted extrusion
@@ -447,6 +447,38 @@ S_SHAPE = [
]
+# original data for issue 414:
+# [
+# (-43710.28841108403, 19138.631023711587, 0.0, 0.0, -1.0),
+# (-43710.28841108403, 19139.079023711445, 0.0, 0.0, -1.0),
+# ]
+
+
+def lwpolyline_issue_414() -> LWPolyline:
+ # simplified data for testing
+ points = [(-10.0, 1.0, 0.0, 0.0, -1.0), (-10.0, 1.45, 0.0, 0.0, -1.0)]
+ pline = LWPolyline.new(
+ dxfattribs={"extrusion": (0, 0, -1), "const_width": 0.45}
+ )
+ pline.append_points(points)
+ pline.close()
+ return pline
+
+
+def test_make_path_from_polyline2d_with_bulges_and_inverted_extrusion():
+ pline = lwpolyline_issue_414()
+ vertices = list(pline.vertices_in_wcs())
+ assert vertices[0].isclose((10, 1, 0))
+ assert vertices[1].isclose((10, 1.45, 0))
+
+ p = make_path(pline)
+ box = tools.bbox([p])
+ assert p.start.isclose((10, 1, 0))
+ assert p.is_closed is True
+ assert box.extmin.isclose((9.775, 1.0))
+ assert box.extmax.isclose((10.225, 1.45))
+
+
def test_lwpolyline_s_shape():
from ezdxf.entities import LWPolyline
