diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-07-21 17:13:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-07-21 17:22:10 +0400 |
commit | a7d8f602a6f60a0c117615c0493315e4de9dd9e2 (patch) | |
tree | 3e476f08e46845b2c367907272e84babef230e08 /source | |
parent | 31e1a31feed3adbfba85ed319447fc13e9b454ee (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/mathutils/mathutils_geometry.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 */ |