From a7d8f602a6f60a0c117615c0493315e4de9dd9e2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 21 Jul 2014 23:13:21 +1000 Subject: Py/API: Improve intersect_line_line with parallel lines Now comparing the distance between line-intersection points to see how close lines are - doesn't fail in the parallel case. --- source/blender/python/mathutils/mathutils_geometry.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index b289f735192..20d69caf02d 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -229,6 +229,11 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject } result = isect_line_line_v3(v1, v2, v3, v4, i1, i2); + /* The return-code isnt exposed, + * this way we can check know how close the lines are. */ + if (result == 1) { + closest_to_line_v3(i2, i1, v3, v4); + } if (result == 0) { /* colinear */ -- cgit v1.2.3