26 "Class hierarchy: :class:`Interface0D` > :class:`SVertex`\n"
28 "Class to define a vertex of the embedding.\n"
30 ".. method:: __init__(*args)\n"
32 " Accepted call signatures:\n"
35 " - ``__init__(brother)``\n"
36 " - ``__init__(point_3d, id)``\n"
38 " Builds a :class:`SVertex` using the default constructor,\n"
39 " copy constructor or the overloaded constructor which builds"
40 " a :class:`SVertex` from 3D coordinates and an Id.\n"
42 " :param brother: A SVertex object.\n"
43 " :type brother: :class:`SVertex`\n"
44 " :param point_3d: A three-dimensional vector.\n"
45 " :type point_3d: :class:`mathutils.Vector`\n"
46 " :param id: An Id object.\n"
47 " :type id: :class:`Id`\n");
50 static const char *kwlist_1[] = {
"brother",
nullptr};
51 static const char *kwlist_2[] = {
"point_3d",
"id",
nullptr};
52 PyObject *obj =
nullptr;
55 if (PyArg_ParseTupleAndKeywords(args,
71 else if ((
void)PyErr_Clear(),
72 PyArg_ParseTupleAndKeywords(args,
83 Vec3r point_3d(v[0], v[1], v[2]);
87 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
97 SVertex_add_normal_doc,
98 ".. method:: add_normal(normal)\n"
100 " Adds a normal to the SVertex's set of normals. If the same normal\n"
101 " is already in the set, nothing changes.\n"
103 " :param normal: A three-dimensional vector.\n"
104 " :type normal: :class:`mathutils.Vector` | tuple[float, float, float] | list[float]\n");
107 static const char *kwlist[] = {
"normal",
nullptr};
111 if (!PyArg_ParseTupleAndKeywords(args,
121 PyErr_SetString(PyExc_TypeError,
122 "argument 1 must be a 3D vector (either a list of 3 elements or Vector)");
131 SVertex_add_fedge_doc,
132 ".. method:: add_fedge(fedge)\n"
134 " Add an FEdge to the list of edges emanating from this SVertex.\n"
136 " :param fedge: An FEdge.\n"
137 " :type fedge: :class:`FEdge`\n");
140 static const char *kwlist[] = {
"fedge",
nullptr};
143 if (!PyArg_ParseTupleAndKeywords(args,
161# pragma clang diagnostic push
162# pragma clang diagnostic ignored "-Wcast-function-type"
164# pragma GCC diagnostic push
165# pragma GCC diagnostic ignored "-Wcast-function-type"
172 METH_VARARGS | METH_KEYWORDS,
173 SVertex_add_normal_doc},
176 METH_VARARGS | METH_KEYWORDS,
177 SVertex_add_fedge_doc},
178 {
nullptr,
nullptr, 0,
nullptr},
183# pragma clang diagnostic pop
185# pragma GCC diagnostic pop
192#define MATHUTILS_SUBTYPE_POINT3D 1
193#define MATHUTILS_SUBTYPE_POINT2D 2
208 bmo->data[0] = self->
sv->
getX();
209 bmo->data[1] = self->
sv->
getY();
210 bmo->data[2] = self->
sv->
getZ();
228 Vec3r p(bmo->data[0], bmo->data[1], bmo->data[2]);
233 Vec3r p(bmo->data[0], bmo->data[1], bmo->data[2]);
250 bmo->data[0] = self->
sv->
getX();
253 bmo->data[1] = self->
sv->
getY();
256 bmo->data[2] = self->
sv->
getZ();
324 SVertex_point_3d_doc,
325 "The 3D coordinates of the SVertex.\n"
327 ":type: :class:`mathutils.Vector`\n");
341 Vec3r p(v[0], v[1], v[2]);
348 SVertex_point_2d_doc,
349 "The projected 3D coordinates of the SVertex.\n"
351 ":type: :class:`mathutils.Vector`\n");
365 Vec3r p(v[0], v[1], v[2]);
373 "The Id of this SVertex.\n"
375 ":type: :class:`Id`\n");
385 PyErr_SetString(PyExc_TypeError,
"value must be an Id");
395 "The normals for this Vertex as a list. In a sharp surface, an SVertex\n"
396 "has exactly one normal. In a smooth surface, an SVertex can have any\n"
397 "number of normals.\n"
399 ":type: list[:class:`mathutils.Vector`]\n");
402 PyObject *py_normals;
403 set<Vec3r> normals = self->
sv->
normals();
404 set<Vec3r>::iterator it;
405 py_normals = PyList_New(normals.size());
408 for (it = normals.begin(); it != normals.end(); it++) {
417 SVertex_normals_size_doc,
418 "The number of different normals for this SVertex.\n"
428 SVertex_viewvertex_doc,
429 "If this SVertex is also a ViewVertex, this property refers to the\n"
430 "ViewVertex, and None otherwise.\n"
432 ":type: :class:`ViewVertex`\n");
444 SVertex_curvatures_doc,
445 "Curvature information expressed in the form of a seven-element tuple\n"
446 "(K1, e1, K2, e2, Kr, er, dKr), where K1 and K2 are scalar values\n"
447 "representing the first (maximum) and second (minimum) principal\n"
448 "curvatures at this SVertex, respectively; e1 and e2 are\n"
449 "three-dimensional vectors representing the first and second principal\n"
450 "directions, i.e. the directions of the normal plane where the\n"
451 "curvature takes its maximum and minimum values, respectively; and Kr,\n"
452 "er and dKr are the radial curvature, radial direction, and the\n"
453 "derivative of the radial curvature at this SVertex, respectively.\n"
465 PyObject *retval = PyTuple_New(7);
467 PyFloat_FromDouble(info->
K1),
468 PyFloat_FromDouble(info->
K2),
471 PyFloat_FromDouble(info->
Kr),
473 PyFloat_FromDouble(info->
dKr));
481 SVertex_point_3d_doc,
486 SVertex_point_2d_doc,
493 SVertex_normals_size_doc,
498 SVertex_viewvertex_doc,
503 SVertex_curvatures_doc,
505 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
511 PyVarObject_HEAD_INIT(
nullptr, 0)
530 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * Vector_from_Vec3r(Vec3r &vec)
PyObject * BPy_Id_from_Id(Id &id)
PyObject * Any_BPy_ViewVertex_from_ViewVertex(ViewVertex &vv)
int convert_v3(PyObject *obj, void *v)
bool Vec3r_ptr_from_PyObject(PyObject *obj, Vec3r &vec)
PyDoc_STRVAR(FalseBP1D___doc__, "Class hierarchy: :class:`freestyle.types.BinaryPredicate1D` > :class:`FalseBP1D`\n" "\n" ".. method:: __call__(inter1, inter2)\n" "\n" " Always returns false.\n" "\n" " :param inter1: The first Interface1D object.\n" " :type inter1: :class:`freestyle.types.Interface1D`\n" " :param inter2: The second Interface1D object.\n" " :type inter2: :class:`freestyle.types.Interface1D`\n" " :return: False.\n" " :rtype: bool\n")
PyTypeObject Interface0D_Type
static PyObject * SVertex_point_3d_get(BPy_SVertex *self, void *)
static int SVertex_mathutils_set_index(blender::BaseMathObject *bmo, int subtype, int index)
static int SVertex_point_3d_set(BPy_SVertex *self, PyObject *value, void *)
static int SVertex_mathutils_set(blender::BaseMathObject *bmo, int subtype)
static int SVertex_point_2d_set(BPy_SVertex *self, PyObject *value, void *)
static blender::Mathutils_Callback SVertex_mathutils_cb
static PyObject * SVertex_add_normal(BPy_SVertex *self, PyObject *args, PyObject *kwds)
#define MATHUTILS_SUBTYPE_POINT3D
#define MATHUTILS_SUBTYPE_POINT2D
void SVertex_mathutils_register_callback()
static PyObject * SVertex_viewvertex_get(BPy_SVertex *self, void *)
static PyObject * SVertex_point_2d_get(BPy_SVertex *self, void *)
static uchar SVertex_mathutils_cb_index
PyTypeObject SVertex_Type
static int SVertex_mathutils_get_index(blender::BaseMathObject *bmo, int subtype, int index)
static PyMethodDef BPy_SVertex_methods[]
static int SVertex_init(BPy_SVertex *self, PyObject *args, PyObject *kwds)
static PyObject * SVertex_curvatures_get(BPy_SVertex *self, void *)
static PyObject * SVertex_normals_size_get(BPy_SVertex *self, void *)
static PyObject * SVertex_normals_get(BPy_SVertex *self, void *)
static PyObject * SVertex_add_fedge(BPy_SVertex *self, PyObject *args, PyObject *kwds)
static int SVertex_id_set(BPy_SVertex *self, PyObject *value, void *)
static PyObject * SVertex_id_get(BPy_SVertex *self, void *)
static int SVertex_mathutils_get(blender::BaseMathObject *bmo, int subtype)
static int SVertex_mathutils_check(blender::BaseMathObject *bmo)
static PyGetSetDef BPy_SVertex_getseters[]
#define BPy_SVertex_Check(v)
ViewVertex * viewvertex()
virtual real getY() const
void setPoint2D(const Vec3r &iPoint2D)
virtual real getX() const
void AddNormal(const Vec3r &iNormal)
void setPoint3D(const Vec3r &iPoint3D)
void AddFEdge(FEdge *iFEdge)
virtual real getProjectedZ() const
virtual real getZ() const
const Vec3r & point2D() const
virtual real getProjectedY() const
virtual real getProjectedX() const
const Vec3r & point3D() const
const CurvatureInfo * getCurvatureInfo() const
VecMat::Vec3< real > Vec3r
PyObject * Vector_CreatePyObject_cb(PyObject *cb_user, int vec_num, uchar cb_type, uchar cb_subtype)
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
#define PyTuple_SET_ITEMS(op_arg,...)
PyObject_HEAD Freestyle::Interface0D * if0D