MeshArtist

class compas_blender.artists.MeshArtist(mesh)[source]

Bases: compas_blender.artists._artist.BaseArtist

A mesh artist defines functionality for visualising COMPAS meshes in Blender.

Parameters
Attributes
  • mesh (compas.datastructures.Mesh) – The COMPAS mesh associated with the artist.

  • settings (dict) – Default settings for color, scale, tolerance, …

Examples

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

mesh = Mesh.from_obj(compas.get('faces.obj'))

MeshArtist(mesh).draw()

Methods

__init__(mesh)

Initialize self.

build(item, **kwargs)

Build an artist corresponding to the item type.

clear()

Clear all objects previously drawn by this artist.

draw()

Draw the mesh using the chosen visualisation settings.

draw_edges([edges, color])

Draw a selection of edges.

draw_faces([faces, color])

Draw a selection of faces.

draw_mesh()

Draw the mesh.

draw_vertices([vertices, color])

Draw a selection of vertices.

redraw()

Trigger a redraw.

register(item_type, artist_type)

Register a type of COMPAS object with a Blender artist.