9 #include "../../BPy_Convert.h"
10 #include "../../Interface0D/BPy_SVertex.h"
23 "Class hierarchy: :class:`Interface1D` > :class:`FEdge` > :class:`FEdgeSharp`\n"
25 "Class defining a sharp FEdge. A Sharp FEdge corresponds to an initial\n"
26 "edge of the input mesh. It can be a silhouette, a crease or a border.\n"
27 "If it is a crease edge, then it is bordered by two faces of the mesh.\n"
28 "Face a lies on its right whereas Face b lies on its left. If it is a\n"
29 "border edge, then it doesn't have any face on its right, and thus Face\n"
32 ".. method:: __init__()\n"
33 " __init__(brother)\n"
34 " __init__(first_vertex, second_vertex)\n"
36 " Builds an :class:`FEdgeSharp` using the default constructor,\n"
37 " copy constructor, or between two :class:`SVertex` objects.\n"
39 " :arg brother: An FEdgeSharp object.\n"
40 " :type brother: :class:`FEdgeSharp`\n"
41 " :arg first_vertex: The first SVertex object.\n"
42 " :type first_vertex: :class:`SVertex`\n"
43 " :arg second_vertex: The second SVertex object.\n"
44 " :type second_vertex: :class:`SVertex`");
48 static const char *kwlist_1[] = {
"brother",
nullptr};
49 static const char *kwlist_2[] = {
"first_vertex",
"second_vertex",
nullptr};
50 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
52 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
FEdgeSharp_Type, &obj1)) {
60 else if ((
void)PyErr_Clear(),
61 PyArg_ParseTupleAndKeywords(args,
72 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
75 self->py_fe.fe =
self->fes;
76 self->py_fe.py_if1D.if1D =
self->fes;
77 self->py_fe.py_if1D.borrowed =
false;
84 #define MATHUTILS_SUBTYPE_NORMAL_A 1
85 #define MATHUTILS_SUBTYPE_NORMAL_B 2
122 Vec3r p(bmo->data[0], bmo->data[1], bmo->data[2]);
123 self->fes->setNormalA(p);
126 Vec3r p(bmo->data[0], bmo->data[1], bmo->data[2]);
127 self->fes->setNormalB(p);
141 bmo->data[index] = p[index];
145 bmo->data[index] = p[index];
159 p[index] = bmo->data[index];
160 self->fes->setNormalA(p);
164 p[index] = bmo->data[index];
165 self->fes->setNormalB(p);
191 "The normal to the face lying on the right of the FEdge. If this FEdge\n"
192 "is a border, it has no Face on its right and therefore no normal.\n"
194 ":type: :class:`mathutils.Vector`");
211 self->fes->setNormalA(p);
216 "The normal to the face lying on the left of the FEdge.\n"
218 ":type: :class:`mathutils.Vector`");
233 self->fes->setNormalB(p);
238 "The index of the material of the face lying on the right of the FEdge.\n"
239 "If this FEdge is a border, it has no Face on its right and therefore\n"
246 return PyLong_FromLong(
self->fes->aFrsMaterialIndex());
253 unsigned int i = PyLong_AsUnsignedLong(value);
254 if (PyErr_Occurred()) {
257 self->fes->setaFrsMaterialIndex(i);
262 "The index of the material of the face lying on the left of the FEdge.\n"
268 return PyLong_FromLong(
self->fes->bFrsMaterialIndex());
275 unsigned int i = PyLong_AsUnsignedLong(value);
276 if (PyErr_Occurred()) {
279 self->fes->setbFrsMaterialIndex(i);
284 "The material of the face lying on the right of the FEdge. If this FEdge\n"
285 "is a border, it has no Face on its right and therefore no material.\n"
287 ":type: :class:`Material`");
295 "The material of the face lying on the left of the FEdge.\n"
297 ":type: :class:`Material`");
305 "The face mark of the face lying on the right of the FEdge. If this FEdge\n"
306 "is a border, it has no face on the right and thus this property is set to\n"
320 if (!PyBool_Check(value)) {
328 "The face mark of the face lying on the left of the FEdge.\n"
341 if (!PyBool_Check(value)) {
352 FEdgeSharp_normal_right_doc,
357 FEdgeSharp_normal_left_doc,
359 {
"material_index_right",
362 FEdgeSharp_material_index_right_doc,
364 {
"material_index_left",
367 FEdgeSharp_material_index_left_doc,
372 FEdgeSharp_material_right_doc,
377 FEdgeSharp_material_left_doc,
382 FEdgeSharp_face_mark_right_doc,
387 FEdgeSharp_face_mark_left_doc,
389 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
395 PyVarObject_HEAD_INIT(
nullptr, 0)
"FEdgeSharp",
413 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * PyBool_from_bool(bool b)
bool bool_from_PyBool(PyObject *b)
PyObject * BPy_FrsMaterial_from_FrsMaterial(const FrsMaterial &m)
static PyObject * FEdgeSharp_normal_left_get(BPy_FEdgeSharp *self, void *UNUSED(closure))
#define MATHUTILS_SUBTYPE_NORMAL_B
static int FEdgeSharp_mathutils_set(BaseMathObject *bmo, int subtype)
static PyObject * FEdgeSharp_material_right_get(BPy_FEdgeSharp *self, void *UNUSED(closure))
static int FEdgeSharp_face_mark_left_set(BPy_FEdgeSharp *self, PyObject *value, void *UNUSED(closure))
PyDoc_STRVAR(FEdgeSharp_doc, "Class hierarchy: :class:`Interface1D` > :class:`FEdge` > :class:`FEdgeSharp`\n" "\n" "Class defining a sharp FEdge. A Sharp FEdge corresponds to an initial\n" "edge of the input mesh. It can be a silhouette, a crease or a border.\n" "If it is a crease edge, then it is bordered by two faces of the mesh.\n" "Face a lies on its right whereas Face b lies on its left. If it is a\n" "border edge, then it doesn't have any face on its right, and thus Face\n" "a is None.\n" "\n" ".. method:: __init__()\n" " __init__(brother)\n" " __init__(first_vertex, second_vertex)\n" "\n" " Builds an :class:`FEdgeSharp` using the default constructor,\n" " copy constructor, or between two :class:`SVertex` objects.\n" "\n" " :arg brother: An FEdgeSharp object.\n" " :type brother: :class:`FEdgeSharp`\n" " :arg first_vertex: The first SVertex object.\n" " :type first_vertex: :class:`SVertex`\n" " :arg second_vertex: The second SVertex object.\n" " :type second_vertex: :class:`SVertex`")
static int FEdgeSharp_mathutils_get(BaseMathObject *bmo, int subtype)
static int FEdgeSharp_face_mark_right_set(BPy_FEdgeSharp *self, PyObject *value, void *UNUSED(closure))
static int FEdgeSharp_init(BPy_FEdgeSharp *self, PyObject *args, PyObject *kwds)
#define MATHUTILS_SUBTYPE_NORMAL_A
static PyObject * FEdgeSharp_material_left_get(BPy_FEdgeSharp *self, void *UNUSED(closure))
static int FEdgeSharp_material_index_left_set(BPy_FEdgeSharp *self, PyObject *value, void *UNUSED(closure))
PyTypeObject FEdgeSharp_Type
static Mathutils_Callback FEdgeSharp_mathutils_cb
static int FEdgeSharp_material_index_right_set(BPy_FEdgeSharp *self, PyObject *value, void *UNUSED(closure))
static int FEdgeSharp_normal_right_set(BPy_FEdgeSharp *self, PyObject *value, void *UNUSED(closure))
static int FEdgeSharp_normal_left_set(BPy_FEdgeSharp *self, PyObject *value, void *UNUSED(closure))
static PyObject * FEdgeSharp_face_mark_left_get(BPy_FEdgeSharp *self, void *UNUSED(closure))
static int FEdgeSharp_mathutils_set_index(BaseMathObject *bmo, int subtype, int index)
static unsigned char FEdgeSharp_mathutils_cb_index
static PyObject * FEdgeSharp_normal_right_get(BPy_FEdgeSharp *self, void *UNUSED(closure))
static int FEdgeSharp_mathutils_get_index(BaseMathObject *bmo, int subtype, int index)
void FEdgeSharp_mathutils_register_callback()
static int FEdgeSharp_mathutils_check(BaseMathObject *bmo)
static PyObject * FEdgeSharp_material_index_right_get(BPy_FEdgeSharp *self, void *UNUSED(closure))
static PyObject * FEdgeSharp_material_index_left_get(BPy_FEdgeSharp *self, void *UNUSED(closure))
static PyGetSetDef BPy_FEdgeSharp_getseters[]
static PyObject * FEdgeSharp_face_mark_right_get(BPy_FEdgeSharp *self, void *UNUSED(closure))
#define BPy_FEdgeSharp_Check(v)
PyTypeObject SVertex_Type
ATTR_WARN_UNUSED_RESULT const BMVert * v
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
uchar Mathutils_RegisterCallback(Mathutils_Callback *cb)
PyObject * Vector_CreatePyObject_cb(PyObject *cb_user, int vec_num, uchar cb_type, uchar cb_subtype)