VolMeshArtist

class compas.artists.VolMeshArtist(*args, **kwargs)[source]

Bases: compas.artists.artist.Artist

Artist for drawing volmesh data structures.

Parameters

volmesh (compas.datastructures.VolMesh) – A COMPAS volmesh.

Class Attributes
  • default_vertexcolor (tuple) – The default color for vertices that do not have a specified color.

  • default_edgecolor (tuple) – The default color for edges that do not have a specified color.

  • default_facecolor (tuple) – The default color for faces that do not have a specified color.

  • default_cellcolor (tuple) – The default color for cells that do not have a specified color.

Attributes
  • volmesh (compas.datastructures.VolMesh) – The COMPAS volmesh associated with the artist.

  • vertices (list) – The list of vertices to draw. Default is a list of all vertices of the volmesh.

  • edges (list) – The list of edges to draw. Default is a list of all edges of the volmesh.

  • faces (list) – The list of faces to draw. Default is a list of all faces of the volmesh.

  • cells (list) – The list of cells to draw. Default is a list of all cells of the volmesh.

  • vertex_xyz (dict[int, tuple(float, float, float)]) – Mapping between vertices and their view coordinates. The default view coordinates are the actual coordinates of the vertices of the volmesh.

  • vertex_color (dict[int, tuple(int, int, int)]) – Mapping between vertices and RGB color values. The colors have to be integer tuples with values in the range 0-255. Missing vertices get the default vertex color (~VolMeshArtist.default_vertexcolor).

  • vertex_text (dict[int, str]) – Mapping between vertices and text labels. Missing vertices are labelled with the corresponding vertex identifiers.

  • edge_color (dict[tuple(int, int), tuple(int, int, int)]) – Mapping between edges and RGB color values. The colors have to be integer tuples with values in the range 0-255. Missing edges get the default edge color (~VolMeshArtist.default_edgecolor).

  • edge_text (dict[tuple(int, int), str]) – Mapping between edges and text labels. Missing edges are labelled with the corresponding edge identifiers.

  • face_color (dict[tuple, tuple(int, int, int)]) – Mapping between faces and RGB color values. The colors have to be integer tuples with values in the range 0-255. Missing faces get the default face color (~VolMeshArtist.default_facecolor).

  • face_text (dict[tuple, str]) – Mapping between faces and text labels. Missing faces are labelled with the corresponding face identifiers.

  • cell_color (dict[int, tuple(int, int, int)]) – Mapping between cells and RGB color values. The colors have to be integer tuples with values in the range 0-255. Missing cells get the default cell color (~VolMeshArtist.default_cellcolor).

  • cell_text (dict[int, str]) – Mapping between cells and text labels. Missing cells are labelled with the corresponding cell identifiers.

Methods

build(item, **kwargs)

Build an artist corresponding to the item type.

build_as(item, artist_type, **kwargs)

clear()

clear_cells()

clear_edges()

clear_faces()

clear_vertices()

draw()

draw_cells([cells, color, text])

Draw the cells of the mesh.

draw_collection(collection)

draw_edges([edges, color, text])

Draw the edges of the mesh.

draw_faces([faces, color, text])

Draw the faces of the mesh.

draw_vertices([vertices, color, text])

Draw the vertices of the mesh.

get_artist_cls(data, **kwargs)

redraw()

register(item_type, artist_type)