16#ifndef MATH_STANDALONE
22#ifndef MATH_STANDALONE
26 M_Interpolate_poly_3d_calc_doc,
27 ".. function:: poly_3d_calc(veclist, pt, /)\n"
29 " Calculate barycentric weights for a point on a polygon.\n"
31 " :arg veclist: Sequence of 3D positions.\n"
32 " :type veclist: Sequence[Sequence[float]]\n"
33 " :arg pt: 2D or 3D position."
34 " :type pt: Sequence[float]"
35 " :return: list of per-vector weights.\n"
36 " :rtype: list[float]\n");
43 PyObject *point, *veclist, *
ret;
46 if (!PyArg_ParseTuple(args,
"OO:poly_3d_calc", &veclist, &point)) {
51 fp, 2, 3 |
MU_ARRAY_ZERO, point,
"pt must be a 2-3 dimensional vector") == -1)
67 for (
i = 0;
i <
len;
i++) {
68 PyList_SET_ITEM(
ret,
i, PyFloat_FromDouble(weights[
i]));
85#ifndef MATH_STANDALONE
89 M_Interpolate_poly_3d_calc_doc},
91 {
nullptr,
nullptr, 0,
nullptr},
97 "The Blender interpolate module.");
100 "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)
static PyMethodDef M_Interpolate_methods[]
PyMODINIT_FUNC PyInit_mathutils_interpolate()
static PyObject * M_Interpolate_poly_3d_calc(PyObject *, PyObject *args)
PyDoc_STRVAR(M_Interpolate_poly_3d_calc_doc, ".. function:: poly_3d_calc(veclist, pt, /)\n" "\n" " Calculate barycentric weights for a point on a polygon.\n" "\n" " :arg veclist: Sequence of 3D positions.\n" " :type veclist: Sequence[Sequence[float]]\n" " :arg pt: 2D or 3D position." " :type pt: Sequence[float]" " :return: list of per-vector weights.\n" " :rtype: list[float]\n")
static PyModuleDef M_Interpolate_module_def