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