CapsuleArtist
-
class
compas_rhino.artists.
CapsuleArtist
(shape, color=None, layer=None)[source] Bases:
compas_rhino.artists._shapeartist.ShapeArtist
Artist for drawing capsule shapes.
- Parameters
shape (
compas.geometry.Capsule
) – A COMPAS capsule.
Notes
See
compas_rhino.artists.ShapeArtist
for all other parameters.Examples
import random from compas.geometry import Pointcloud from compas.geometry import Capsule from compas.geometry import Translation from compas.utilities import i_to_rgb import compas_rhino from compas_rhino.artists import CapsuleArtist pcl = Pointcloud.from_bounds(10, 10, 10, 100) tpl = Capsule([[0, 0, 0], [0.8, 0, 0]], 0.15) compas_rhino.clear_layer("Test::CapsuleArtist") for point in pcl.points: capsule = tpl.transformed(Translation.from_vector(point)) artist = CapsuleArtist(capsule, color=i_to_rgb(random.random()), layer="Test::CapsuleArtist") 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
([u, v, show_vertices, show_edges, …])Draw the capsule associated with the artist.
redraw
()register
(item_type, artist_type)