From bab0c366a7fdccb6f77b9af817bd690ad214b9e1 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 24 Feb 2014 12:19:36 -0300 Subject: [PATCH] Draft: used distToShape in DraftGeomUtils - fixes 1439 --- src/Mod/Draft/DraftGeomUtils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mod/Draft/DraftGeomUtils.py b/src/Mod/Draft/DraftGeomUtils.py index fa05fc2e3..f2553c1c5 100755 --- a/src/Mod/Draft/DraftGeomUtils.py +++ b/src/Mod/Draft/DraftGeomUtils.py @@ -282,6 +282,14 @@ def findIntersection(edge1,edge2,infinite1=False,infinite2=False,ex1=False,ex2=F else : return [] # Lines aren't on same plane + # First, try to use distToShape if possible + if isinstance(edge1,Part.Edge) and isinstance(edge2,Part.Edge) and (not infinite1) and (not infinite2): + dist, pts, geom = edge1.distToShape(edge2) + sol = [] + for p in pts: + sol.append(p[0]) + return sol + pt1 = None if isinstance(edge1,FreeCAD.Vector) and isinstance(edge2,FreeCAD.Vector):