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.
This commit is contained in:
2014-07-21 23:13:21 +10:00
parent 31e1a31fee
commit a7d8f602a6

View File

@@ -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 */