Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/bmesh/bmesh_py_types.c
| Show First 20 Lines • Show All 1,797 Lines • ▼ Show 20 Lines | |||||
| ); | ); | ||||
| static PyObject *bpy_bmface_calc_perimeter(BPy_BMFace *self) | static PyObject *bpy_bmface_calc_perimeter(BPy_BMFace *self) | ||||
| { | { | ||||
| BPY_BM_CHECK_OBJ(self); | BPY_BM_CHECK_OBJ(self); | ||||
| return PyFloat_FromDouble(BM_face_calc_perimeter(self->f)); | return PyFloat_FromDouble(BM_face_calc_perimeter(self->f)); | ||||
| } | } | ||||
| PyDoc_STRVAR(bpy_bmface_calc_tangent_edge_doc, | |||||
| ".. method:: calc_tangent_edge()\n" | |||||
| "\n" | |||||
| " Return face tangent based on longest edge.\n" | |||||
| "\n" | |||||
| " :return: a normalized vector.\n" | |||||
| " :rtype: :class:`mathutils.Vector`\n" | |||||
| ); | |||||
| static PyObject *bpy_bmface_calc_tangent_edge(BPy_BMFace *self) | |||||
| { | |||||
| float tangent[3]; | |||||
| BPY_BM_CHECK_OBJ(self); | |||||
| BM_face_calc_tangent_edge(self->f, tangent); | |||||
| return Vector_CreatePyObject(tangent, 3, NULL); | |||||
| } | |||||
| PyDoc_STRVAR(bpy_bmface_calc_tangent_edge_pair_doc, | |||||
| ".. method:: calc_tangent_edge_pair()\n" | |||||
| "\n" | |||||
| " Return face tangent based on the two longest disconected edges.\n" | |||||
| "\n" | |||||
| " - Tris: Use the edge pair with the most similar lengths.\n" | |||||
| " - Quads: Use the longest edge pair.\n" | |||||
| " - NGons: Use the two longest disconnected edges.\n" | |||||
| "\n" | |||||
| " :return: a normalized vector.\n" | |||||
| " :rtype: :class:`mathutils.Vector`\n" | |||||
| ); | |||||
| static PyObject *bpy_bmface_calc_tangent_edge_pair(BPy_BMFace *self) | |||||
| { | |||||
| float tangent[3]; | |||||
| BPY_BM_CHECK_OBJ(self); | |||||
| BM_face_calc_tangent_edge_pair(self->f, tangent); | |||||
| return Vector_CreatePyObject(tangent, 3, NULL); | |||||
| } | |||||
| PyDoc_STRVAR(bpy_bmface_calc_tangent_edge_diagonal_doc, | |||||
| ".. method:: calc_tangent_edge_diagonal()\n" | |||||
| "\n" | |||||
| " Return face tangent based on the edge farthest from any vertex.\n" | |||||
| "\n" | |||||
| " :return: a normalized vector.\n" | |||||
| " :rtype: :class:`mathutils.Vector`\n" | |||||
| ); | |||||
| static PyObject *bpy_bmface_calc_tangent_edge_diagonal(BPy_BMFace *self) | |||||
| { | |||||
| float tangent[3]; | |||||
| BPY_BM_CHECK_OBJ(self); | |||||
| BM_face_calc_tangent_edge_diagonal(self->f, tangent); | |||||
| return Vector_CreatePyObject(tangent, 3, NULL); | |||||
| } | |||||
| PyDoc_STRVAR(bpy_bmface_calc_tangent_vert_diagonal_doc, | |||||
| ".. method:: calc_tangent_vert_diagonal()\n" | |||||
| "\n" | |||||
| " Return face tangent based on the two most distent vertices.\n" | |||||
| "\n" | |||||
| " :return: a normalized vector.\n" | |||||
| " :rtype: :class:`mathutils.Vector`\n" | |||||
| ); | |||||
| static PyObject *bpy_bmface_calc_tangent_vert_diagonal(BPy_BMFace *self) | |||||
| { | |||||
| float tangent[3]; | |||||
| BPY_BM_CHECK_OBJ(self); | |||||
| BM_face_calc_tangent_vert_diagonal(self->f, tangent); | |||||
| 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_median()\n" | ||||
| "\n" | "\n" | ||||
| " Return median center of the face.\n" | " Return median center of 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" | ||||
| ); | ); | ||||
| ▲ Show 20 Lines • Show All 883 Lines • ▼ Show 20 Lines | static struct PyMethodDef bpy_bmface_methods[] = { | ||||
| {"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc}, | {"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc}, | ||||
| {"copy_from_face_interp", (PyCFunction)bpy_bmface_copy_from_face_interp, METH_O, bpy_bmface_copy_from_face_interp_doc}, | {"copy_from_face_interp", (PyCFunction)bpy_bmface_copy_from_face_interp, METH_O, bpy_bmface_copy_from_face_interp_doc}, | ||||
| {"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_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_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_median", (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_median_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,286 Lines • Show Last 20 Lines | |||||