diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-31 06:06:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-31 06:06:23 +0400 |
commit | 11c988ba00f2991850050ff4c2e3cb34c2546047 (patch) | |
tree | e61413337f5e8b92284569f06b553516b2675536 /source/blender/python/mathutils | |
parent | 29f6616d609fbd92cf313b0fdec555c2fcb4ede0 (diff) |
Simplify line/plane intersection, add line_plane_factor_v3().
Remove no_flip option for isect_line_plane_v3(), its quite specific and only used for ED_view3d_win_to_3d().
Diffstat (limited to 'source/blender/python/mathutils')
-rw-r--r-- | source/blender/python/mathutils/mathutils_geometry.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index 2d4aa988db2..54e9ccf4a70 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -568,22 +568,19 @@ PyDoc_STRVAR(M_Geometry_intersect_line_plane_doc, " :type plane_co: :class:`mathutils.Vector`\n" " :arg plane_no: The direction the plane is facing\n" " :type plane_no: :class:`mathutils.Vector`\n" -" :arg no_flip: Always return an intersection on the directon defined bt line_a -> line_b\n" -" :type no_flip: :boolean\n" " :return: The point of intersection or None when not found\n" " :rtype: :class:`mathutils.Vector` or None\n" ); static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObject *args) { VectorObject *line_a, *line_b, *plane_co, *plane_no; - int no_flip = 0; float isect[3]; + if (!PyArg_ParseTuple(args, "O!O!O!O!|i:intersect_line_plane", &vector_Type, &line_a, &vector_Type, &line_b, &vector_Type, &plane_co, - &vector_Type, &plane_no, - &no_flip)) + &vector_Type, &plane_no)) { return NULL; } @@ -603,7 +600,7 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec return NULL; } - if (isect_line_plane_v3(isect, line_a->vec, line_b->vec, plane_co->vec, plane_no->vec, no_flip) == 1) { + if (isect_line_plane_v3(isect, line_a->vec, line_b->vec, plane_co->vec, plane_no->vec) == 1) { return Vector_CreatePyObject(isect, 3, Py_NEW, NULL); } else { |