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