MeshArtist

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

Bases: BlenderArtist, MeshArtist

Artist for drawing mesh data structures in Blender.

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

  • collection (str or bpy.types.Collection) – The Blender scene collection the object(s) created by this artist belong to.

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

  • edges (list[tuple[int, int]], optional) – A list of edge keys (as uv pairs) identifying which edges to draw. The default is None, in which case all edges are drawn.

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

  • vertexcolor (rgb-tuple or dict[int, rgb-tuple], optional) – The color specification for the vertices.

  • edgecolor (rgb-tuple or dict[tuple[int, int], rgb-tuple], optional) – The color specification for the edges.

  • facecolor (rgb-tuple or dict[int, rgb-tuple], optional) – The color specification for the faces.

  • show_mesh (bool, optional) – If True, draw the mesh.

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

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

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

Attributes

Examples

Use the Blender artist explicitly.

from compas.datastructures import Mesh
from compas_blender.artists import MeshArtist

mesh = Mesh.from_meshgrid(10, 10)

artist = MeshArtist(mesh)
artist.draw()

Or, use the artist through the plugin mechanism.

from compas.datastructures import Mesh
from compas.artists import Artist

mesh = Mesh.from_meshgrid(10, 10)

artist = Artist(mesh)
artist.draw()

Methods

clear_edges

Clear the objects contained in the edge collection (self.edgecollection).

clear_faces

Clear the objects contained in the face collection (self.facecollection).

clear_vertices

Clear the objects contained in the vertex collection (self.vertexcollection).

draw

Draw the mesh using the chosen visualization settings.

draw_edgelabels

Draw labels for a selection of edges.

draw_edges

Draw a selection of edges.

draw_facelabels

Draw labels for a selection of faces.

draw_facenormals

Draw the normals of the faces.

draw_faces

Draw a selection of faces.

draw_mesh

Draw the mesh.

draw_vertexlabels

Draw labels for a selection vertices.

draw_vertexnormals

Draw the normals at the vertices of the mesh.

draw_vertices

Draw a selection of vertices.

Inherited Methods

build

Build an artist corresponding to the item type.

build_as

Build an artist with the given type.

clear

Clear all components of the mesh.

draw_collection

Drawing method for drawing an entire collection of objects.

redraw

Redraw the view.

register

Register an artist type to a data type.