BoxArtist
-
class
compas_rhino.artists.BoxArtist(shape, color=None, layer=None)[source] Bases:
compas_rhino.artists._shapeartist.ShapeArtistArtist for drawing box shapes.
- Parameters
shape (
compas.geometry.Box) – A COMPAS box.
Notes
See
compas_rhino.artists.ShapeArtistfor 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
__init__(shape[, color, layer])Initialize self.
build(item, **kwargs)Build an artist corresponding to the item type.
clear()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)