MeshArtist

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

Bases: compas.artists.artist.Artist

Base class for all mesh artists.

Parameters

mesh (compas.datastructures.Mesh) – A COMPAS mesh.

Class Attributes
  • default_color (tuple) – The default color of the mesh.

  • 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_vertexsize (int)

  • default_edgewidth (float)

Attributes
  • mesh (compas.datastructures.Mesh) – The mesh associated with the artist.

  • vertices (list) – The vertices to include in the drawing. Default is all vertices.

  • edges (list) – The edges to include in the drawing. Default is all edges.

  • faces (list) – The faces to include in the drawing. Default is all faces.

  • vertex_xyz (dict) – The view coordinates of the vertices. Default is to use the actual vertex coordinates.

  • vertex_color (dict) – Mapping between vertices and colors. Default is to use the default color for vertices.

  • edge_color (dict) – Mapping between edges and colors. Default is to use the default color for edges.

  • face_color (dict) – Mapping between faces and colors. Default is to use the default color for faces.

  • vertex_text (dict) – Mapping between vertices and text labels.

  • edge_text (dict) – Mapping between edges and text labels.

  • face_text (dict) – Mapping between faces and text labels.

Methods

build(item, **kwargs)

Build an artist corresponding to the item type.

build_as(item, artist_type, **kwargs)

clear()

clear_edges()

clear_faces()

clear_vertices()

draw()

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_mesh()

draw_vertices([vertices, color, text])

Draw the vertices of the mesh.

get_artist_cls(data, **kwargs)

redraw()

register(item_type, artist_type)