BoxArtist

class compas_rhino.artists.BoxArtist(shape, color=None, layer=None)[source]

Bases: compas_rhino.artists._shapeartist.ShapeArtist

Artist for drawing box shapes.

Parameters

shape (compas.geometry.Box) – A COMPAS box.

Notes

See compas_rhino.artists.ShapeArtist for all other parameters.

Examples

import random
from compas.geometry import Pointcloud
from compas.geometry import Box
from compas.utilities import i_to_rgb

import compas_rhino
from compas_rhino.artists import BoxArtist

pcl = Pointcloud.from_bounds(10, 10, 10, 100)
tpl = Box.from_width_height_depth(0.3, 0.3, 0.3)

compas_rhino.clear_layer("Test::BoxArtist")

for point in pcl.points:
    box = tpl.copy()
    box.frame.point = point
    artist = BoxArtist(box, color=i_to_rgb(random.random()), layer="Test::BoxArtist")
    artist.draw()

Methods

build(item, **kwargs)

Build an artist corresponding to the item type.

clear()

clear_layer()

Clear the main layer of the artist.

draw([show_vertices, show_edges, …])

Draw the box associated with the artist.

redraw()

register(item_type, artist_type)