16#ifndef MATH_STANDALONE
24 "The Blender interpolate module");
28#ifndef MATH_STANDALONE
32 M_Interpolate_poly_3d_calc_doc,
33 ".. function:: poly_3d_calc(veclist, pt)\n"
35 " Calculate barycentric weights for a point on a polygon.\n"
37 " :arg veclist: Sequence of 3D positions.\n"
38 " :type veclist: Sequence[Sequence[float]]\n"
39 " :arg pt: 2D or 3D position."
40 " :type pt: Sequence[float]"
41 " :return: list of per-vector weights.\n"
42 " :rtype: list[float]\n");
49 PyObject *point, *veclist, *
ret;
52 if (!PyArg_ParseTuple(args,
"OO:poly_3d_calc", &veclist, &point)) {
57 fp, 2, 3 |
MU_ARRAY_ZERO, point,
"pt must be a 2-3 dimensional vector") == -1)
73 for (
i = 0;
i <
len;
i++) {
74 PyList_SET_ITEM(
ret,
i, PyFloat_FromDouble(weights[
i]));
91#ifndef MATH_STANDALONE
95 M_Interpolate_poly_3d_calc_doc},
97 {
nullptr,
nullptr, 0,
nullptr},
102 "mathutils.interpolate",
void interp_weights_poly_v3(float w[], float v[][3], int n, const float co[3])
Read Guarded memory(de)allocation.
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
int mathutils_array_parse_alloc_v(float **array, int array_dim, PyObject *value, const char *error_prefix)
PyDoc_STRVAR(M_Interpolate_doc, "The Blender interpolate module")
static PyMethodDef M_Interpolate_methods[]
PyMODINIT_FUNC PyInit_mathutils_interpolate()
static PyObject * M_Interpolate_poly_3d_calc(PyObject *, PyObject *args)
static PyModuleDef M_Interpolate_module_def