Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/bmesh/bmesh_py_types.c
| Show First 20 Lines • Show All 1,876 Lines • ▼ Show 20 Lines | static PyObject *bpy_bmface_calc_tangent_vert_diagonal(BPy_BMFace *self) | ||||
| BPY_BM_CHECK_OBJ(self); | BPY_BM_CHECK_OBJ(self); | ||||
| BM_face_calc_tangent_vert_diagonal(self->f, tangent); | BM_face_calc_tangent_vert_diagonal(self->f, tangent); | ||||
| return Vector_CreatePyObject(tangent, 3, NULL); | return Vector_CreatePyObject(tangent, 3, NULL); | ||||
| } | } | ||||
| PyDoc_STRVAR(bpy_bmface_calc_center_mean_doc, | PyDoc_STRVAR(bpy_bmface_calc_center_mean_doc, | ||||
| ".. method:: calc_center_median()\n" | ".. method:: calc_center_mean()\n" | ||||
| "\n" | "\n" | ||||
| " Return median center of the face.\n" | " Return mean center of the face.\n" | ||||
| " This is the average of face vertex locations.\n" | |||||
| "\n" | "\n" | ||||
| " :return: a 3D vector.\n" | " :return: a 3D vector.\n" | ||||
| " :rtype: :class:`mathutils.Vector`\n" | " :rtype: :class:`mathutils.Vector`\n" | ||||
| ); | ); | ||||
| static PyObject *bpy_bmface_calc_center_mean(BPy_BMFace *self) | static PyObject *bpy_bmface_calc_center_mean(BPy_BMFace *self) | ||||
| { | { | ||||
| float cent[3]; | float cent[3]; | ||||
| BPY_BM_CHECK_OBJ(self); | BPY_BM_CHECK_OBJ(self); | ||||
| BM_face_calc_center_mean(self->f, cent); | BM_face_calc_center_mean(self->f, cent); | ||||
| return Vector_CreatePyObject(cent, 3, NULL); | return Vector_CreatePyObject(cent, 3, NULL); | ||||
| } | } | ||||
| PyDoc_STRVAR(bpy_bmface_calc_center_mean_weighted_doc, | PyDoc_STRVAR(bpy_bmface_calc_center_mean_weighted_doc, | ||||
| ".. method:: calc_center_median_weighted()\n" | ".. method:: calc_center_mean_weighted()\n" | ||||
| "\n" | "\n" | ||||
| " Return median center of the face weighted by edge lengths.\n" | " Return mean center of the face weighted by edge lengths.\n" | ||||
| " Each face vertex location is weighted by the length\n" | |||||
| " of the edges shared by the vertex and the face.\n" | |||||
| "\n" | "\n" | ||||
| " :return: a 3D vector.\n" | " :return: a 3D vector.\n" | ||||
| " :rtype: :class:`mathutils.Vector`\n" | " :rtype: :class:`mathutils.Vector`\n" | ||||
| ); | ); | ||||
| static PyObject *bpy_bmface_calc_center_mean_weighted(BPy_BMFace *self) | static PyObject *bpy_bmface_calc_center_mean_weighted(BPy_BMFace *self) | ||||
| { | { | ||||
| float cent[3]; | float cent[3]; | ||||
| ▲ Show 20 Lines • Show All 867 Lines • ▼ Show 20 Lines | static struct PyMethodDef bpy_bmface_methods[] = { | ||||
| {"copy", (PyCFunction)bpy_bmface_copy, METH_VARARGS | METH_KEYWORDS, bpy_bmface_copy_doc}, | {"copy", (PyCFunction)bpy_bmface_copy, METH_VARARGS | METH_KEYWORDS, bpy_bmface_copy_doc}, | ||||
| {"calc_area", (PyCFunction)bpy_bmface_calc_area, METH_NOARGS, bpy_bmface_calc_area_doc}, | {"calc_area", (PyCFunction)bpy_bmface_calc_area, METH_NOARGS, bpy_bmface_calc_area_doc}, | ||||
| {"calc_perimeter", (PyCFunction)bpy_bmface_calc_perimeter, METH_NOARGS, bpy_bmface_calc_perimeter_doc}, | {"calc_perimeter", (PyCFunction)bpy_bmface_calc_perimeter, METH_NOARGS, bpy_bmface_calc_perimeter_doc}, | ||||
| {"calc_tangent_edge", (PyCFunction)bpy_bmface_calc_tangent_edge, METH_NOARGS, bpy_bmface_calc_tangent_edge_doc}, | {"calc_tangent_edge", (PyCFunction)bpy_bmface_calc_tangent_edge, METH_NOARGS, bpy_bmface_calc_tangent_edge_doc}, | ||||
| {"calc_tangent_edge_pair", (PyCFunction)bpy_bmface_calc_tangent_edge_pair, METH_NOARGS, bpy_bmface_calc_tangent_edge_pair_doc}, | {"calc_tangent_edge_pair", (PyCFunction)bpy_bmface_calc_tangent_edge_pair, METH_NOARGS, bpy_bmface_calc_tangent_edge_pair_doc}, | ||||
| {"calc_tangent_edge_diagonal", (PyCFunction)bpy_bmface_calc_tangent_edge_diagonal, METH_NOARGS, bpy_bmface_calc_tangent_edge_diagonal_doc}, | {"calc_tangent_edge_diagonal", (PyCFunction)bpy_bmface_calc_tangent_edge_diagonal, METH_NOARGS, bpy_bmface_calc_tangent_edge_diagonal_doc}, | ||||
| {"calc_tangent_vert_diagonal", (PyCFunction)bpy_bmface_calc_tangent_vert_diagonal, METH_NOARGS, bpy_bmface_calc_tangent_vert_diagonal_doc}, | {"calc_tangent_vert_diagonal", (PyCFunction)bpy_bmface_calc_tangent_vert_diagonal, METH_NOARGS, bpy_bmface_calc_tangent_vert_diagonal_doc}, | ||||
| {"calc_center_median", (PyCFunction)bpy_bmface_calc_center_mean, METH_NOARGS, bpy_bmface_calc_center_mean_doc}, | {"calc_center_mean", (PyCFunction)bpy_bmface_calc_center_mean, METH_NOARGS, bpy_bmface_calc_center_mean_doc}, | ||||
| {"calc_center_median_weighted", (PyCFunction)bpy_bmface_calc_center_mean_weighted, METH_NOARGS, bpy_bmface_calc_center_mean_weighted_doc}, | {"calc_center_mean_weighted", (PyCFunction)bpy_bmface_calc_center_mean_weighted, METH_NOARGS, bpy_bmface_calc_center_mean_weighted_doc}, | ||||
| {"calc_center_bounds", (PyCFunction)bpy_bmface_calc_center_bounds, METH_NOARGS, bpy_bmface_calc_center_bounds_doc}, | {"calc_center_bounds", (PyCFunction)bpy_bmface_calc_center_bounds, METH_NOARGS, bpy_bmface_calc_center_bounds_doc}, | ||||
| {"normal_update", (PyCFunction)bpy_bmface_normal_update, METH_NOARGS, bpy_bmface_normal_update_doc}, | {"normal_update", (PyCFunction)bpy_bmface_normal_update, METH_NOARGS, bpy_bmface_normal_update_doc}, | ||||
| {"normal_flip", (PyCFunction)bpy_bmface_normal_flip, METH_NOARGS, bpy_bmface_normal_flip_doc}, | {"normal_flip", (PyCFunction)bpy_bmface_normal_flip, METH_NOARGS, bpy_bmface_normal_flip_doc}, | ||||
| {NULL, NULL, 0, NULL} | {NULL, NULL, 0, NULL} | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 1,292 Lines • Show Last 20 Lines | |||||