From 0b8e11e8bfa373c22f0efa14417bb87bc566551b Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 8 Mar 2026 22:31:18 -0700 Subject: [PATCH] [dxf] improve manhattan check robustness --- masque/file/dxf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/masque/file/dxf.py b/masque/file/dxf.py index da35531..d7bc7e8 100644 --- a/masque/file/dxf.py +++ b/masque/file/dxf.py @@ -304,13 +304,13 @@ def _mrefs_to_drefs( b = rep.b_vector if rep.b_vector is not None else numpy.zeros(2) rotated_a = rotation_matrix_2d(-ref.rotation) @ a rotated_b = rotation_matrix_2d(-ref.rotation) @ b - if rotated_a[1] == 0 and rotated_b[0] == 0: + if numpy.isclose(rotated_a[1], 0) and numpy.isclose(rotated_b[0], 0): attribs['column_count'] = rep.a_count attribs['row_count'] = rep.b_count attribs['column_spacing'] = rotated_a[0] attribs['row_spacing'] = rotated_b[1] block.add_blockref(encoded_name, ref.offset, dxfattribs=attribs) - elif rotated_a[0] == 0 and rotated_b[1] == 0: + elif numpy.isclose(rotated_a[0], 0) and numpy.isclose(rotated_b[1], 0): attribs['column_count'] = rep.b_count attribs['row_count'] = rep.a_count attribs['column_spacing'] = rotated_b[0]