MeshArtist

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

Bases: BlenderArtist, MeshArtist

Artist for drawing mesh data structures in Blender.

Parameters
  • mesh (Mesh) – A COMPAS mesh.

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

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

Clear all objects from the view.

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.

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_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.

draw_collection

Drawing method for drawing an entire collection of objects.

draw_mesh

Draw the mesh of the mesh.

redraw

Redraw the view.

register

Register an artist type to a data type.