Blender V4.3
BPy_SmoothingShader.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2004-2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17using namespace Freestyle;
18
20
21//------------------------INSTANCE METHODS ----------------------------------
22
24 /* Wrap. */
25 SmoothingShader___doc__,
26 "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`SmoothingShader`\n"
27 "\n"
28 "[Geometry shader]\n"
29 "\n"
30 ".. method:: __init__(num_iterations=100, factor_point=0.1, \\\n"
31 " factor_curvature=0.0, factor_curvature_difference=0.2, \\\n"
32 " aniso_point=0.0, aniso_normal=0.0, aniso_curvature=0.0, \\\n"
33 " carricature_factor=1.0)\n"
34 "\n"
35 " Builds a SmoothingShader object.\n"
36 "\n"
37 " :arg num_iterations: The number of iterations.\n"
38 " :type num_iterations: int\n"
39 " :arg factor_point: 0.1\n"
40 " :type factor_point: float\n"
41 " :arg factor_curvature: 0.0\n"
42 " :type factor_curvature: float\n"
43 " :arg factor_curvature_difference: 0.2\n"
44 " :type factor_curvature_difference: float\n"
45 " :arg aniso_point: 0.0\n"
46 " :type aniso_point: float\n"
47 " :arg aniso_normal: 0.0\n"
48 " :type aniso_normal: float\n"
49 " :arg aniso_curvature: 0.0\n"
50 " :type aniso_curvature: float\n"
51 " :arg carricature_factor: 1.0\n"
52 " :type carricature_factor: float\n"
53 "\n"
54 ".. method:: shade(stroke)\n"
55 "\n"
56 " Smooths the stroke by moving the vertices to make the stroke\n"
57 " smoother. Uses curvature flow to converge towards a curve of\n"
58 " constant curvature. The diffusion method we use is anisotropic to\n"
59 " prevent the diffusion across corners.\n"
60 "\n"
61 " :arg stroke: A Stroke object.\n"
62 " :type stroke: :class:`freestyle.types.Stroke`\n");
63
64static int SmoothingShader___init__(BPy_SmoothingShader *self, PyObject *args, PyObject *kwds)
65{
66 static const char *kwlist[] = {
67 "num_iterations",
68 "factor_point",
69 "factor_curvature",
70 "factor_curvature_difference",
71 "aniso_point",
72 "aniso_normal",
73 "aniso_curvature",
74 "carricature_factor",
75 nullptr,
76 };
77 int i1 = 100;
78 double d2 = 0.1, d3 = 0.0, d4 = 0.2, d5 = 0.0, d6 = 0.0, d7 = 0.0, d8 = 1.0;
79
80 if (!PyArg_ParseTupleAndKeywords(
81 args, kwds, "|iddddddd", (char **)kwlist, &i1, &d2, &d3, &d4, &d5, &d6, &d7, &d8))
82 {
83 return -1;
84 }
85 self->py_ss.ss = new SmoothingShader(i1, d2, d3, d4, d5, d6, d7, d8);
86 return 0;
87}
88
89/*-----------------------BPy_SmoothingShader type definition ------------------------------*/
90
91PyTypeObject SmoothingShader_Type = {
92 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
93 /*tp_name*/ "SmoothingShader",
94 /*tp_basicsize*/ sizeof(BPy_SmoothingShader),
95 /*tp_itemsize*/ 0,
96 /*tp_dealloc*/ nullptr,
97 /*tp_vectorcall_offset*/ 0,
98 /*tp_getattr*/ nullptr,
99 /*tp_setattr*/ nullptr,
100 /*tp_as_async*/ nullptr,
101 /*tp_repr*/ nullptr,
102 /*tp_as_number*/ nullptr,
103 /*tp_as_sequence*/ nullptr,
104 /*tp_as_mapping*/ nullptr,
105 /*tp_hash*/ nullptr,
106 /*tp_call*/ nullptr,
107 /*tp_str*/ nullptr,
108 /*tp_getattro*/ nullptr,
109 /*tp_setattro*/ nullptr,
110 /*tp_as_buffer*/ nullptr,
111 /*tp_flags*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
112 /*tp_doc*/ SmoothingShader___doc__,
113 /*tp_traverse*/ nullptr,
114 /*tp_clear*/ nullptr,
115 /*tp_richcompare*/ nullptr,
116 /*tp_weaklistoffset*/ 0,
117 /*tp_iter*/ nullptr,
118 /*tp_iternext*/ nullptr,
119 /*tp_methods*/ nullptr,
120 /*tp_members*/ nullptr,
121 /*tp_getset*/ nullptr,
122 /*tp_base*/ &StrokeShader_Type,
123 /*tp_dict*/ nullptr,
124 /*tp_descr_get*/ nullptr,
125 /*tp_descr_set*/ nullptr,
126 /*tp_dictoffset*/ 0,
127 /*tp_init*/ (initproc)SmoothingShader___init__,
128 /*tp_alloc*/ nullptr,
129 /*tp_new*/ nullptr,
130};
131
133
134#ifdef __cplusplus
135}
136#endif
Fredo's stroke shaders.
PyDoc_STRVAR(SmoothingShader___doc__, "Class hierarchy: :class:`freestyle.types.StrokeShader` > :class:`SmoothingShader`\n" "\n" "[Geometry shader]\n" "\n" ".. method:: __init__(num_iterations=100, factor_point=0.1, \\\n" " factor_curvature=0.0, factor_curvature_difference=0.2, \\\n" " aniso_point=0.0, aniso_normal=0.0, aniso_curvature=0.0, \\\n" " carricature_factor=1.0)\n" "\n" " Builds a SmoothingShader object.\n" "\n" " :arg num_iterations: The number of iterations.\n" " :type num_iterations: int\n" " :arg factor_point: 0.1\n" " :type factor_point: float\n" " :arg factor_curvature: 0.0\n" " :type factor_curvature: float\n" " :arg factor_curvature_difference: 0.2\n" " :type factor_curvature_difference: float\n" " :arg aniso_point: 0.0\n" " :type aniso_point: float\n" " :arg aniso_normal: 0.0\n" " :type aniso_normal: float\n" " :arg aniso_curvature: 0.0\n" " :type aniso_curvature: float\n" " :arg carricature_factor: 1.0\n" " :type carricature_factor: float\n" "\n" ".. method:: shade(stroke)\n" "\n" " Smooths the stroke by moving the vertices to make the stroke\n" " smoother. Uses curvature flow to converge towards a curve of\n" " constant curvature. The diffusion method we use is anisotropic to\n" " prevent the diffusion across corners.\n" "\n" " :arg stroke: A Stroke object.\n" " :type stroke: :class:`freestyle.types.Stroke`\n")
static int SmoothingShader___init__(BPy_SmoothingShader *self, PyObject *args, PyObject *kwds)
PyTypeObject SmoothingShader_Type
PyTypeObject StrokeShader_Type
PyObject * self
inherits from class Rep
Definition AppCanvas.cpp:20