fix for own regression in r44361 (broke BM_vert_in_face)

also fix py api: bmesh.utils.face_split(face, v1, v2)
This commit is contained in:
2012-02-25 14:56:37 +00:00
parent f8d55b5bf0
commit 69cf6adb84
3 changed files with 27 additions and 5 deletions

View File

@@ -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);
}
}

View File

@@ -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)
{

View File

@@ -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) {