add_face

Mesh.add_face(face, *args, **kwargs)[source]

Create and add new face.

Vertex identifiers used in the definition of a face have to refer to existing vertices of the mesh.

Parameters:
  • face (list[int] or list[Vertex]) – Combinatorial face definition.

  • *args – Variable number of Vertex or int arguments.

  • **kwargs – Attribute name and value pairs.

Raises:
  • NonManifoldError – If topological problems occur.

  • IndexError – If the given vertex indices are out of bounds.

  • ValueError – If the given arguments do not define a valid face.

Returns:

The newly created Face instance.

Return type:

Face

Note

See add_vertex() for a detailed discussion of kwargs.