Skip to content

Commit

Permalink
check BoundingBox before calling distToShape
Browse files Browse the repository at this point in the history
to find intersecting edges. issue #2050
  • Loading branch information
5263 authored and yorikvanhavre committed Apr 14, 2015
1 parent f6638d4 commit 7ddd9d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Mod/Draft/DraftGeomUtils.py
Expand Up @@ -277,7 +277,9 @@ def getLineIntersections(pt1,pt2,pt3,pt4,infinite1,infinite2):
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:
Expand Down

0 comments on commit 7ddd9d2

Please sign in to comment.