From 1dc7d5bd56eacf2514b700f205c9bd7ad044e22b Mon Sep 17 00:00:00 2001 From: jan Date: Sat, 13 Feb 2021 15:46:22 -0800 Subject: [PATCH] 2-element paths are not polygons --- masque/file/dxf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masque/file/dxf.py b/masque/file/dxf.py index f30a314..62993f9 100644 --- a/masque/file/dxf.py +++ b/masque/file/dxf.py @@ -216,7 +216,7 @@ def _read_block(block, clean_vertices: bool) -> Pattern: width = attr.get('const_width', 0) shape: Union[Path, Polygon] - if width == 0 and numpy.array_equal(points[0], points[-1]): + if width == 0 and len(points) > 2 and numpy.array_equal(points[0], points[-1]): shape = Polygon(layer=layer, vertices=points[:-1, :2]) else: shape = Path(layer=layer, width=width, vertices=points[:, :2])