add_halfedge_data

Mesh.add_halfedge_data(name, attr, data, default=None)[source]

Add halfedge data.

The data object has to allow access to halfedge data using index notation. The data block as a whole can be accessed via self.name and the value data[h] as h.attr.

Parameters:
  • name (str) – Name of the data block.

  • attr (str) – Name of halfedge attribute.

  • data (dict) – Data object.

  • default (object, optional) – Immutable default halfedge attribute value.

Raises:

ValueError – If a data block of same name already exists or the data block is not a dictionary instance.

Note

See add_vertex_data() for an example.