MeshArtist
- class compas_plotters.artists.MeshArtist(*args, **kwargs)[source]
Bases:
PlotterArtist
,MeshArtist
Artist for COMPAS mesh data structures.
- Parameters
mesh (
compas.datastructures.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] or dict[int, tuple[float, float, float]], optional) – Color specification for the vertices.
edgecolor (tuple[float, float, float] or dict[tuple[int, int], tuple[float, float, float]], optional) – Color specification for the edges.
facecolor (tuple[float, float, float] or 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 or dict[int, str], optional) – Labels for the vertices.
edgetext (str or dict[tuple[int, int], str], optional) – Labels for the edges.
facetext (str or 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
compas_plotters.artists.PlotterArtist
andcompas.artists.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 the current edges from the canvas.
Clear the current faces from the canvas.
Clear the current halfedges from the canvas.
Clear the current vertices from the canvas.
Draw the mesh.
Draw a selection of edge labels.
Draw a selection of edges.
Draw a selection of face labels.
Draw a selection of faces.
Draw a selection of halfedges.
Draw the mesh of the mesh.
Draw a selection of vertex labels.
Draw a selection of vertices.
Redraw the mesh using the current geometry.
Update the colors of the edges.
Update the widths of the edges.
Update the colors of the vertices.
Inherited Methods
Build an artist corresponding to the item type.
Build an artist with the given type.
Clear all components of the mesh.
Drawing method for drawing an entire collection of objects.
Register an artist type to a data type.
Update the data limits of the plotting axes using the visualization data.
Compute the bounds of the current view.