diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-25 18:56:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-25 18:56:37 +0400 |
commit | 69cf6adb845f1a77886a8b80cfe559361bb96964 (patch) | |
tree | 1800b42b298900acbea2a37a5770492af4bbf831 | |
parent | f8d55b5bf0e911161825836795d4f111581b9601 (diff) |
fix for own regression in r44361 (broke BM_vert_in_face)
also fix py api: bmesh.utils.face_split(face, v1, v2)
-rw-r--r-- | source/blender/bmesh/intern/bmesh_queries.c | 25 | ||||
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 3 | ||||
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_utils.c | 4 |
3 files changed, 27 insertions, 5 deletions
diff --git a/source/blender/bmesh/intern/bmesh_queries.c b/source/blender/bmesh/intern/bmesh_queries.c index 06f90d04bd3..2eb9e6e918f 100644 --- a/source/blender/bmesh/intern/bmesh_queries.c +++ b/source/blender/bmesh/intern/bmesh_queries.c @@ -101,7 +101,26 @@ BMLoop *BM_face_other_loop(BMEdge *e, BMFace *f, BMVert *v) int BM_vert_in_face(BMFace *f, BMVert *v) { - return bmesh_radial_find_first_faceloop(BM_FACE_FIRST_LOOP(f), v) != NULL; + BMLoop *l_iter, *l_first; + +#ifdef USE_BMESH_HOLES + BMLoopList *lst; + for (lst = f->loops.first; lst; lst = lst->next) +#endif + { +#ifdef USE_BMESH_HOLES + l_iter = l_first = lst->first; +#else + l_iter = l_first = f->l_first; +#endif + do { + if (l_iter->v == v) { + return TRUE; + } + } while ((l_iter = l_iter->next) != l_first); + } + + return FALSE; } /* @@ -551,7 +570,7 @@ float BM_edge_face_angle(BMesh *UNUSED(bm), BMEdge *e) return angle_normalized_v3v3(l1->f->no, l2->f->no); } else { - return (float)M_PI / 2.0f; /* acos(0.0) */ + return DEG2RADF(90.0f); } } @@ -581,7 +600,7 @@ float BM_vert_edge_angle(BMesh *UNUSED(bm), BMVert *v) return M_PI - angle_v3v3v3(v1->co, v->co, v2->co); } else { - return (float)M_PI / 2.0f; /* acos(0.0) */ + return DEG2RADF(90.0f); } } diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index aeccdc6ebbc..74255495e87 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -708,6 +708,9 @@ PyDoc_STRVAR(bpy_bmvert_calc_edge_angle_doc, ".. method:: calc_edge_angle()\n" "\n" " Return the angle between 2 connected edges.\n" +"\n" +" :return: The angle between both edges in radians.\n" +" :rtype: float\n" ); static PyObject *bpy_bmvert_calc_edge_angle(BPy_BMVert *self) { diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c index 7dbf57ab260..19832b67962 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.c +++ b/source/blender/python/bmesh/bmesh_py_utils.c @@ -327,7 +327,7 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args) BMFace *f_new = NULL; BMLoop *l_new = NULL; - if (!PyArg_ParseTuple(args, "O!O!|O!:face_split", + if (!PyArg_ParseTuple(args, "O!O!O!|O!:face_split", &BPy_BMFace_Type, &py_face, &BPy_BMVert_Type, &py_vert_a, &BPy_BMVert_Type, &py_vert_b, @@ -362,7 +362,7 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args) bm = py_face->bm; f_new = BM_face_split(bm, py_face->f, - py_vert_a->v, py_vert_a->v, + py_vert_a->v, py_vert_b->v, &l_new, py_edge_example ? py_edge_example->e : NULL); if (f_new && l_new) { |