make_index_buffer

make_index_buffer(data, dynamic=False)[source]

Make an element buffer from the given data.

Parameters
data: list[int]

A flat list of ints.

dynamicbool, optional

If True, the buffer is optimized for dynamic access.

Returns
int

Element buffer ID.

Examples

>>> from compas.utilities import flatten
>>> edges = [(0, 1), (1, 2), (2, 3)]
>>> buffer = make_index_buffer(list(flatten(edges)))