Blender V5.0
BPy_PolygonalizationShader.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2004-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
10
12
13using namespace Freestyle;
14
16
17//------------------------INSTANCE METHODS ----------------------------------
18
20 /* Wrap. */
21 PolygonalizationShader___doc__,
22 "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`PolygonalizationShader`\n"
23 "\n"
24 "[Geometry shader]\n"
25 "\n"
26 ".. method:: __init__(error)\n"
27 "\n"
28 " Builds a PolygonalizationShader object.\n"
29 "\n"
30 " :arg error: The error we want our polygonal approximation to have\n"
31 " with respect to the original geometry. The smaller, the closer\n"
32 " the new stroke is to the original one. This error corresponds to\n"
33 " the maximum distance between the new stroke and the old one.\n"
34 " :type error: float\n"
35 "\n"
36 ".. method:: shade(stroke)\n"
37 "\n"
38 " Modifies the Stroke geometry so that it looks more \"polygonal\".\n"
39 " The basic idea is to start from the minimal stroke approximation\n"
40 " consisting in a line joining the first vertex to the last one and\n"
41 " to subdivide using the original stroke vertices until a certain\n"
42 " error is reached.\n"
43 "\n"
44 " :arg stroke: A Stroke object.\n"
45 " :type stroke: :class:`freestyle.types.Stroke`\n");
47 PyObject *args,
48 PyObject *kwds)
49{
50 static const char *kwlist[] = {"error", nullptr};
51 float f;
52
53 if (!PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist, &f)) {
54 return -1;
55 }
57 return 0;
58}
59
60/*-----------------------BPy_PolygonalizationShader type definition -----------------------------*/
61
63 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
64 /*tp_name*/ "PolygonalizationShader",
65 /*tp_basicsize*/ sizeof(BPy_PolygonalizationShader),
66 /*tp_itemsize*/ 0,
67 /*tp_dealloc*/ nullptr,
68 /*tp_vectorcall_offset*/ 0,
69 /*tp_getattr*/ nullptr,
70 /*tp_setattr*/ nullptr,
71 /*tp_as_async*/ nullptr,
72 /*tp_repr*/ nullptr,
73 /*tp_as_number*/ nullptr,
74 /*tp_as_sequence*/ nullptr,
75 /*tp_as_mapping*/ nullptr,
76 /*tp_hash*/ nullptr,
77 /*tp_call*/ nullptr,
78 /*tp_str*/ nullptr,
79 /*tp_getattro*/ nullptr,
80 /*tp_setattro*/ nullptr,
81 /*tp_as_buffer*/ nullptr,
82 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
83 /*tp_doc*/ PolygonalizationShader___doc__,
84 /*tp_traverse*/ nullptr,
85 /*tp_clear*/ nullptr,
86 /*tp_richcompare*/ nullptr,
87 /*tp_weaklistoffset*/ 0,
88 /*tp_iter*/ nullptr,
89 /*tp_iternext*/ nullptr,
90 /*tp_methods*/ nullptr,
91 /*tp_members*/ nullptr,
92 /*tp_getset*/ nullptr,
93 /*tp_base*/ &StrokeShader_Type,
94 /*tp_dict*/ nullptr,
95 /*tp_descr_get*/ nullptr,
96 /*tp_descr_set*/ nullptr,
97 /*tp_dictoffset*/ 0,
98 /*tp_init*/ (initproc)PolygonalizationShader___init__,
99 /*tp_alloc*/ nullptr,
100 /*tp_new*/ nullptr,
101};
102
PyDoc_STRVAR(PolygonalizationShader___doc__, "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`PolygonalizationShader`\n" "\n" "[Geometry shader]\n" "\n" ".. method:: __init__(error)\n" "\n" " Builds a PolygonalizationShader object.\n" "\n" " :arg error: The error we want our polygonal approximation to have\n" " with respect to the original geometry. The smaller, the closer\n" " the new stroke is to the original one. This error corresponds to\n" " the maximum distance between the new stroke and the old one.\n" " :type error: float\n" "\n" ".. method:: shade(stroke)\n" "\n" " Modifies the Stroke geometry so that it looks more \"polygonal\".\n" " The basic idea is to start from the minimal stroke approximation\n" " consisting in a line joining the first vertex to the last one and\n" " to subdivide using the original stroke vertices until a certain\n" " error is reached.\n" "\n" " :arg stroke: A Stroke object.\n" " :type stroke: :class:`freestyle.types.Stroke`\n")
static int PolygonalizationShader___init__(BPy_PolygonalizationShader *self, PyObject *args, PyObject *kwds)
PyTypeObject PolygonalizationShader_Type
PyTypeObject StrokeShader_Type
Class gathering basic stroke shaders.
PyObject * self
inherits from class Rep
Definition AppCanvas.cpp:20