18#ifndef MATH_STANDALONE
24#ifndef MATH_STANDALONE
28 M_Interpolate_poly_3d_calc_doc,
29 ".. function:: poly_3d_calc(veclist, pt, /)\n"
31 " Calculate barycentric weights for a point on a polygon.\n"
33 " :param veclist: Sequence of 3D positions.\n"
34 " :type veclist: Sequence[Sequence[float]]\n"
35 " :param pt: 2D or 3D position.\n"
36 " :type pt: Sequence[float]\n"
37 " :return: A list of weights, one per vertex in *veclist*.\n"
38 " :rtype: list[float]\n");
45 PyObject *point, *veclist, *
ret;
48 if (!PyArg_ParseTuple(args,
59 fp, 2, 3 |
MU_ARRAY_ZERO, point,
"pt must be a 2-3 dimensional vector") == -1)
75 for (i = 0; i <
len; i++) {
76 PyList_SET_ITEM(
ret, i, PyFloat_FromDouble(weights[i]));
93#ifndef MATH_STANDALONE
97 M_Interpolate_poly_3d_calc_doc},
99 {
nullptr,
nullptr, 0,
nullptr},
105 "The Blender interpolate module.");
108 "mathutils.interpolate",
Read Blender memory allocation and freeing.
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
PyDoc_STRVAR(bpy_bm_new_doc, ".. function:: new(*, use_operators=True)\n" "\n" " :param use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
static PyMethodDef M_Interpolate_methods[]
static PyObject * M_Interpolate_poly_3d_calc(PyObject *, PyObject *args)
PyMODINIT_FUNC PyInit_mathutils_interpolate()
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
void interp_weights_poly_v3(float w[], float v[][3], int n, const float co[3])
static PyModuleDef M_Interpolate_module_def
int mathutils_array_parse_alloc_v(float **array, int array_dim, PyObject *value, const char *error_prefix)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float