From eb6b3f35ed1aea9e81d1347287d2e9f27bce9e5e Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Thu, 11 Aug 2022 17:50:43 +0200 Subject: [PATCH] Draft: add tolerance to boundbox check in intersections.py --- src/Mod/Draft/draftgeoutils/intersections.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/draftgeoutils/intersections.py b/src/Mod/Draft/draftgeoutils/intersections.py index e858f40b98..db9d7f718b 100644 --- a/src/Mod/Draft/draftgeoutils/intersections.py +++ b/src/Mod/Draft/draftgeoutils/intersections.py @@ -107,7 +107,9 @@ def findIntersection(edge1, edge2, # First, check bound boxes if (isinstance(edge1, Part.Edge) and isinstance(edge2, Part.Edge) and (not infinite1) and (not infinite2)): - if not edge1.BoundBox.intersect(edge2.BoundBox): + bb1 = edge1.BoundBox + bb1.enlarge(pow(10, -precision())) # enlarge one box to account for rounding errors + if not bb1.intersect(edge2.BoundBox): return [] # bound boxes don't intersect # First, try to use distToShape if possible @@ -117,7 +119,7 @@ def findIntersection(edge1, edge2, sol = [] if round(dist, precision()) == 0: for p in pts: - if p not in sol: + if p[0] not in sol: sol.append(p[0]) return sol