From 7ddd9d2ce0994e4aa3ea5aeda9ed1116d71e670e Mon Sep 17 00:00:00 2001 From: Sebastian Hoogen Date: Tue, 14 Apr 2015 08:37:53 +0200 Subject: [PATCH] check BoundingBox before calling distToShape to find intersecting edges. issue #2050 --- src/Mod/Draft/DraftGeomUtils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/DraftGeomUtils.py b/src/Mod/Draft/DraftGeomUtils.py index 2305c5f6c..ae7683db3 100755 --- a/src/Mod/Draft/DraftGeomUtils.py +++ b/src/Mod/Draft/DraftGeomUtils.py @@ -277,7 +277,9 @@ def findIntersection(edge1,edge2,infinite1=False,infinite2=False,ex1=False,ex2=F return [] # Lines aren't on same plane # First, try to use distToShape if possible - if dts and isinstance(edge1,Part.Edge) and isinstance(edge2,Part.Edge) and (not infinite1) and (not infinite2): + if dts and isinstance(edge1,Part.Edge) and isinstance(edge2,Part.Edge) \ + and (not infinite1) and (not infinite2) and \ + edge1.BoundBox.isIntersection(edge2.BoundBox): dist, pts, geom = edge1.distToShape(edge2) sol = [] for p in pts: