23 #include "../../BPy_Convert.h"
24 #include "../../Interface0D/BPy_SVertex.h"
37 "Class hierarchy: :class:`Interface1D` > :class:`FEdge` > :class:`FEdgeSharp`\n"
39 "Class defining a sharp FEdge. A Sharp FEdge corresponds to an initial\n"
40 "edge of the input mesh. It can be a silhouette, a crease or a border.\n"
41 "If it is a crease edge, then it is bordered by two faces of the mesh.\n"
42 "Face a lies on its right whereas Face b lies on its left. If it is a\n"
43 "border edge, then it doesn't have any face on its right, and thus Face\n"
46 ".. method:: __init__()\n"
47 " __init__(brother)\n"
48 " __init__(first_vertex, second_vertex)\n"
50 " Builds an :class:`FEdgeSharp` using the default constructor,\n"
51 " copy constructor, or between two :class:`SVertex` objects.\n"
53 " :arg brother: An FEdgeSharp object.\n"
54 " :type brother: :class:`FEdgeSharp`\n"
55 " :arg first_vertex: The first SVertex object.\n"
56 " :type first_vertex: :class:`SVertex`\n"
57 " :arg second_vertex: The second SVertex object.\n"
58 " :type second_vertex: :class:`SVertex`");
62 static const char *kwlist_1[] = {
"brother",
nullptr};
63 static const char *kwlist_2[] = {
"first_vertex",
"second_vertex",
nullptr};
64 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
66 if (PyArg_ParseTupleAndKeywords(args, kwds,
"|O!", (
char **)kwlist_1, &
FEdgeSharp_Type, &obj1)) {
74 else if ((
void)PyErr_Clear(),
75 PyArg_ParseTupleAndKeywords(args,
86 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
89 self->py_fe.fe =
self->fes;
90 self->py_fe.py_if1D.if1D =
self->fes;
91 self->py_fe.py_if1D.borrowed =
false;
98 #define MATHUTILS_SUBTYPE_NORMAL_A 1
99 #define MATHUTILS_SUBTYPE_NORMAL_B 2
136 Vec3r p(bmo->data[0], bmo->data[1], bmo->data[2]);
137 self->fes->setNormalA(p);
140 Vec3r p(bmo->data[0], bmo->data[1], bmo->data[2]);
141 self->fes->setNormalB(p);
155 bmo->data[index] = p[index];
159 bmo->data[index] = p[index];
173 p[index] = bmo->data[index];
174 self->fes->setNormalA(p);
178 p[index] = bmo->data[index];
179 self->fes->setNormalB(p);
205 "The normal to the face lying on the right of the FEdge. If this FEdge\n"
206 "is a border, it has no Face on its right and therefore no normal.\n"
208 ":type: :class:`mathutils.Vector`");
225 self->fes->setNormalA(p);
230 "The normal to the face lying on the left of the FEdge.\n"
232 ":type: :class:`mathutils.Vector`");
247 self->fes->setNormalB(p);
252 "The index of the material of the face lying on the right of the FEdge.\n"
253 "If this FEdge is a border, it has no Face on its right and therefore\n"
260 return PyLong_FromLong(
self->fes->aFrsMaterialIndex());
267 unsigned int i = PyLong_AsUnsignedLong(value);
268 if (PyErr_Occurred()) {
271 self->fes->setaFrsMaterialIndex(i);
276 "The index of the material of the face lying on the left of the FEdge.\n"
282 return PyLong_FromLong(
self->fes->bFrsMaterialIndex());
289 unsigned int i = PyLong_AsUnsignedLong(value);
290 if (PyErr_Occurred()) {
293 self->fes->setbFrsMaterialIndex(i);
298 "The material of the face lying on the right of the FEdge. If this FEdge\n"
299 "is a border, it has no Face on its right and therefore no material.\n"
301 ":type: :class:`Material`");
309 "The material of the face lying on the left of the FEdge.\n"
311 ":type: :class:`Material`");
319 "The face mark of the face lying on the right of the FEdge. If this FEdge\n"
320 "is a border, it has no face on the right and thus this property is set to\n"
334 if (!PyBool_Check(value)) {
342 "The face mark of the face lying on the left of the FEdge.\n"
355 if (!PyBool_Check(value)) {
366 FEdgeSharp_normal_right_doc,
371 FEdgeSharp_normal_left_doc,
373 {
"material_index_right",
376 FEdgeSharp_material_index_right_doc,
378 {
"material_index_left",
381 FEdgeSharp_material_index_left_doc,
386 FEdgeSharp_material_right_doc,
391 FEdgeSharp_material_left_doc,
396 FEdgeSharp_face_mark_right_doc,
401 FEdgeSharp_face_mark_left_doc,
403 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
409 PyVarObject_HEAD_INIT(
nullptr, 0)
"FEdgeSharp",
427 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
uchar Mathutils_RegisterCallback(Mathutils_Callback *cb)
int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *value, const char *error_prefix)
PyObject * Vector_CreatePyObject_cb(PyObject *cb_user, int size, uchar cb_type, uchar cb_subtype)