MeshArtist

class compas_plotters.artists.MeshArtist(item, **kwargs)[source]

Bases: PlotterArtist, MeshArtist

Artist for COMPAS mesh data structures.

Parameters
  • mesh (Mesh) – A COMPAS mesh.

  • vertices (list[int], optional) – Selection of vertex identifiers. Default is None, in which case all vertices are drawn.

  • edges (list[tuple[int, int]], optional) – Selection of edge identifiers. The default is None, in which case all edges are drawn.

  • faces (list[int], optional) – Selection of face identifiers. The default is None, in which case all faces are drawn.

  • vertexcolor (tuple[float, float, float] | dict[int, tuple[float, float, float]], optional) – Color specification for the vertices.

  • edgecolor (tuple[float, float, float] | dict[tuple[int, int], tuple[float, float, float]], optional) – Color specification for the edges.

  • facecolor (tuple[float, float, float] | dict[int, tuple[float, float, float]], optional) – Color specification for the faces.

  • show_vertices (bool, optional) – If True, draw the vertices of the mesh.

  • show_edges (bool, optional) – If True, draw the edges of the mesh.

  • show_faces (bool, optional) – If True, draw the faces of the mesh.

  • vertexsize (int, optional) – Size of the vertices.

  • vertextext (str | dict[int, str], optional) – Labels for the vertices.

  • edgetext (str | dict[tuple[int, int], str], optional) – Labels for the edges.

  • facetext (str | dict[int, str], optional) – Labels for the faces.

  • sizepolicy ({‘relative’, ‘absolute’}, optional) – The policy for sizing the vertices. If 'relative', the value of vertexsize is scaled by the number of vertices. If 'absolute', the value of vertexsize is scaled by the resolution of the plotter (:attr:MeshArtist.plotter.dpi).

  • zorder (int, optional) – The base stacking order of the components of the mesh on the canvas.

  • **kwargs (dict, optional) – Additional keyword arguments. See PlotterArtist and MeshArtist for more info.

Attributes
  • halfedges (list[tuple[int, int]]) – The halfedges to include in the drawing.

  • vertex_size (dict[int, float]) – Mapping between vertex identifiers and vertex sizes.

  • halfedge_color (dict[tuple[int, int], tuple[float, float, float]]) – Mapping between halfedge identifiers and halfedge colors.

  • zorder_faces (int, read-only) – The stacking order of the faces relative to the base stacking order of the mesh.

  • zorder_edges (int, read-only) – The stacking order of the edges relative to the base stacking order of the mesh.

  • zorder_vertices (int, read-only) – The stacking order of the vertices relative to the base stacking order of the mesh.

Methods

clear

Clear all objects from the view.

clear_edges

Clear the current edges from the canvas.

clear_faces

Clear the current faces from the canvas.

clear_halfedges

Clear the current halfedges from the canvas.

clear_vertices

Clear the current vertices from the canvas.

draw

Draw the mesh.

draw_edgelabels

Draw a selection of edge labels.

draw_edges

Draw a selection of edges.

draw_facelabels

Draw a selection of face labels.

draw_faces

Draw a selection of faces.

draw_halfedges

Draw a selection of halfedges.

draw_mesh

Draw the mesh of the mesh.

draw_vertexlabels

Draw a selection of vertex labels.

draw_vertices

Draw a selection of vertices.

redraw

Redraw the mesh using the current geometry.

update_edgecolors

Update the colors of the edges.

update_edgewidths

Update the widths of the edges.

update_vertexcolors

Update the colors of the vertices.

Inherited Methods

build

Build an artist corresponding to the item type.

build_as

Build an artist with the given type.

draw_collection

Drawing method for drawing an entire collection of objects.

register

Register an artist type to a data type.

update_data

Update the data limits of the plotting axes using the visualization data.

viewbox

Compute the bounds of the current view.