diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-15 14:09:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-15 14:09:27 +0400 |
commit | db53faffa3e86fb44bfa2a025a5261eb69d3bc09 (patch) | |
tree | a2de3a7992a3d2655cfe2a06ee36191f30e55360 /source/blender/python/bmesh | |
parent | 97538bd9edf48f07c132fbddeccc421c56bd9b69 (diff) |
make ngon_perimeter into a public api function and expose to python.
Diffstat (limited to 'source/blender/python/bmesh')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 4b4dc7caa7f..5fcefc7533b 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -1400,6 +1400,21 @@ static PyObject *bpy_bmface_calc_area(BPy_BMFace *self) } +PyDoc_STRVAR(bpy_bmface_calc_perimeter_doc, +".. method:: calc_perimeter()\n" +"\n" +" Return the perimeter of the face.\n" +"\n" +" :return: Return the perimeter of the face.\n" +" :rtype: float\n" +); +static PyObject *bpy_bmface_calc_perimeter(BPy_BMFace *self) +{ + BPY_BM_CHECK_OBJ(self); + return PyFloat_FromDouble(BM_face_perimeter_calc(self->bm, self->f)); +} + + PyDoc_STRVAR(bpy_bmface_calc_center_mean_doc, ".. method:: calc_center_median()\n" "\n" @@ -2081,6 +2096,7 @@ static struct PyMethodDef bpy_bmface_methods[] = { {"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_perimeter", (PyCFunction)bpy_bmface_calc_perimeter, METH_NOARGS, bpy_bmface_calc_perimeter_doc}, {"calc_center_median", (PyCFunction)bpy_bmface_calc_center_mean, METH_NOARGS, bpy_bmface_calc_center_mean_doc}, {"calc_center_bounds", (PyCFunction)bpy_bmface_calc_center_bounds, METH_NOARGS, bpy_bmface_calc_center_bounds_doc}, |