23 "Class hierarchy: :class:`Interface0D` > :class:`CurvePoint`\n"
25 "Class to represent a point of a curve. A CurvePoint can be any point\n"
26 "of a 1D curve (it doesn't have to be a vertex of the curve). Any\n"
27 ":class:`Interface1D` is built upon ViewEdges, themselves built upon\n"
28 "FEdges. Therefore, a curve is basically a polyline made of a list of\n"
29 ":class:`SVertex` objects. Thus, a CurvePoint is built by linearly\n"
30 "interpolating two :class:`SVertex` instances. CurvePoint can be used\n"
31 "as virtual points while querying 0D information along a curve at a\n"
34 ".. method:: __init__(*args)\n"
36 " Accepted call signatures:\n"
39 " - ``__init__(brother)``\n"
40 " - ``__init__(first_vertex, second_vertex, t2d)``\n"
41 " - ``__init__(first_point, second_point, t2d)``\n"
43 " Builds a CurvePoint using the default constructor, copy constructor,\n"
44 " or one of the overloaded constructors. The over loaded constructors\n"
45 " can either take two :class:`SVertex` or two :class:`CurvePoint`\n"
46 " objects and an interpolation parameter\n"
48 " :param brother: A CurvePoint object.\n"
49 " :type brother: :class:`CurvePoint`\n"
50 " :param first_vertex: The first SVertex.\n"
51 " :type first_vertex: :class:`SVertex`\n"
52 " :param second_vertex: The second SVertex.\n"
53 " :type second_vertex: :class:`SVertex`\n"
54 " :param first_point: The first CurvePoint.\n"
55 " :type first_point: :class:`CurvePoint`\n"
56 " :param second_point: The second CurvePoint.\n"
57 " :type second_point: :class:`CurvePoint`\n"
58 " :param t2d: A 2D interpolation parameter used to linearly interpolate\n"
59 " first_vertex and second_vertex or first_point and second_point.\n"
60 " :type t2d: float\n");
63 static const char *kwlist_1[] = {
"brother",
nullptr};
64 static const char *kwlist_2[] = {
"first_vertex",
"second_vertex",
"t2d",
nullptr};
65 static const char *kwlist_3[] = {
"first_point",
"second_point",
"t2d",
nullptr};
66 PyObject *obj1 =
nullptr, *obj2 =
nullptr;
69 if (PyArg_ParseTupleAndKeywords(args,
85 else if ((
void)PyErr_Clear(),
86 PyArg_ParseTupleAndKeywords(args,
101 else if ((
void)PyErr_Clear(),
102 PyArg_ParseTupleAndKeywords(args,
117 if (!cp1 || cp1->
A() ==
nullptr || cp1->
B() ==
nullptr) {
118 PyErr_SetString(PyExc_TypeError,
"argument 1 is an invalid CurvePoint object");
121 if (!cp2 || cp2->
A() ==
nullptr || cp2->
B() ==
nullptr) {
122 PyErr_SetString(PyExc_TypeError,
"argument 2 is an invalid CurvePoint object");
128 PyErr_SetString(PyExc_TypeError,
"invalid argument(s)");
142 CurvePoint_first_svertex_doc,
143 "The first SVertex upon which the CurvePoint is built.\n"
145 ":type: :class:`SVertex`\n");
158 PyErr_SetString(PyExc_TypeError,
"value must be an SVertex");
167 CurvePoint_second_svertex_doc,
168 "The second SVertex upon which the CurvePoint is built.\n"
170 ":type: :class:`SVertex`\n");
183 PyErr_SetString(PyExc_TypeError,
"value must be an SVertex");
192 CurvePoint_fedge_doc,
193 "Gets the FEdge for the two SVertices that given CurvePoints consists out of.\n"
194 "A shortcut for CurvePoint.first_svertex.get_fedge(CurvePoint.second_svertex).\n"
196 ":type: :class:`FEdge`\n");
211 "The 2D interpolation parameter.\n"
216 return PyFloat_FromDouble(self->
cp->
t2d());
222 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
223 PyErr_SetString(PyExc_TypeError,
"value must be a number");
234 CurvePoint_first_svertex_doc,
239 CurvePoint_second_svertex_doc,
243 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
249 PyVarObject_HEAD_INIT(
nullptr, 0)
268 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
PyObject * Any_BPy_Interface1D_from_Interface1D(Interface1D &if1D)
PyObject * BPy_SVertex_from_SVertex(SVertex &sv)
static int CurvePoint_init(BPy_CurvePoint *self, PyObject *args, PyObject *kwds)
PyTypeObject CurvePoint_Type
static PyObject * CurvePoint_first_svertex_get(BPy_CurvePoint *self, void *)
static PyObject * CurvePoint_t2d_get(BPy_CurvePoint *self, void *)
static int CurvePoint_second_svertex_set(BPy_CurvePoint *self, PyObject *value, void *)
static PyObject * CurvePoint_fedge_get(BPy_CurvePoint *self, void *)
static int CurvePoint_first_svertex_set(BPy_CurvePoint *self, PyObject *value, void *)
static PyGetSetDef BPy_CurvePoint_getseters[]
static PyObject * CurvePoint_second_svertex_get(BPy_CurvePoint *self, void *)
static int CurvePoint_t2d_set(BPy_CurvePoint *self, PyObject *value, void *)
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
PyTypeObject SVertex_Type
#define BPy_SVertex_Check(v)
Freestyle::CurvePoint * cp
PyObject_HEAD Freestyle::Interface0D * if0D