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.

Attributes

color

default_color

default_edgecolor

default_edgewidth

default_facecolor

default_vertexcolor

default_vertexsize

edge_color

edge_text

edge_width

edges

face_color

face_text

faces

mesh

vertex_color

vertex_size

vertex_text

vertex_xyz

vertices

Inherited Attributes

AVAILABLE_CONTEXTS

CONTEXT

ITEM_ARTIST

Methods

clear

clear_edges

clear_faces

clear_vertices

draw_edges

Draw the edges of the mesh.

draw_faces

Draw the faces of the mesh.

draw_mesh

draw_vertices

Draw the vertices of the mesh.

Inherited Methods

build

Build an artist corresponding to the item type.

build_as

draw

draw_collection

redraw

register