MeshArtist

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

Bases: Artist

Base class for all mesh artists.

Parameters

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

Attributes
  • mesh (compas.datastructures.Mesh) – The mesh data structure.

  • vertices (list[int]) – The selection of vertices that should be included in the drawing. Defaults to all vertices.

  • edges (list[tuple[int, int]]) – The selection of edges that should be included in the drawing. Defaults to all edges.

  • faces (list[int]) – The selection of faces that should be included in the drawing. Defaults to all faces.

  • color (tuple[float, float, float]) – The base RGB color of the mesh. Defaults to default_color.

  • vertex_xyz (dict[int, list[float]]) – View coordinates of the vertices. Defaults to the real coordinates.

  • vertex_color (dict[int, tuple[float, float, float]]) – Vertex colors. Missing vertices get the default vertex color default_vertexcolor.

  • edge_color (dict[tuple[int, int], tuple[float, float, float]]) – Edge colors. Missing edges get the default edge color default_edgecolor.

  • face_color (dict[int, tuple[float, float, float]]) – Face colors. Missing faces get the default face color default_facecolor.

  • vertex_text (dict[int, str]) – Vertex labels. Defaults to the vertex identifiers.

  • edge_text (dict[tuple[int, int], str]) – Edge labels. Defaults to the edge identifiers.

  • face_text (dict[int, tuple[float, float, float]]) – Face labels. Defaults to the face identifiers.

  • vertex_size (dict[int, float]) – Vertex sizes. Defaults to 1. Visualization of vertices with variable size is not available for all visualization contexts.

  • edge_width (dict[tuple[int, int], float]) – Edge widths. Defaults to 1. Visualization of edges with variable width is not available for all visualization contexts.

Class Attributes
  • default_color (tuple[float, float, float]) – The default base color of the mesh.

  • default_vertexcolor (tuple[float, float, float]) – The default color of the vertices of the mesh.

  • default_edgecolor (tuple[float, float, float]) – The default color of the edges of the mesh.

  • default_facecolor (tuple[float, float, float]) – The default color of the faces of the mesh.

  • default_vertexsize (float) – The default size of the vertices of the mesh.

  • default_edgewidth (float) – The default width of the edges of the mesh.

Methods

clear

Clear all components of the mesh.

clear_edges

Clear the edges of the mesh.

clear_faces

Clear the faces of the mesh.

clear_vertices

Clear the vertices of the mesh.

draw_edges

Draw the edges of the mesh.

draw_faces

Draw the faces of the mesh.

draw_mesh

Draw the mesh of the mesh.

draw_vertices

Draw the vertices of the mesh.

Inherited Methods

build

Build an artist corresponding to the item type.

build_as

Build an artist with the given type.

draw

The main drawing method.

draw_collection

Drawing method for drawing an entire collection of objects.

redraw

Redraw the view.

register

Register an artist type to a data type.