14#include "PyIndexedAttribute.h"
16#include <lagrange/IndexedAttribute.h>
17#include <lagrange/python/binding.h>
19namespace lagrange::python {
21void bind_indexed_attribute(nanobind::module_& m)
23 namespace nb = nanobind;
24 using namespace nb::literals;
26 auto indexed_attr_class = nb::class_<PyIndexedAttribute>(
29 R
"(Indexed attribute data structure.
31An indexed attribute stores values and indices separately, allowing for efficient
32storage when multiple elements share the same values. This is commonly used for
33UV coordinates, normals, or colors where the same value may be referenced by
34multiple vertices, corners, or facets.)");
36 indexed_attr_class.def_prop_ro(
39 R
"(Element type (i.e. Indexed).)");
41 indexed_attr_class.def_prop_ro(
44 "Usage type (Position, Normal, UV, Color, etc.).");
46 indexed_attr_class.def_prop_ro(
49 "Number of channels per element.");
51 indexed_attr_class.def_prop_ro(
53 &PyIndexedAttribute::values,
54 R
"(The values array of the indexed attribute.
56:returns: Attribute containing the unique values referenced by the indices)");
57 indexed_attr_class.def_prop_ro(
59 &PyIndexedAttribute::indices,
60 R
"(The indices array of the indexed attribute.
62:returns: Attribute containing the indices that reference into the values array)");
Definition PyIndexedAttribute.h:27