ConeArtist

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

Bases: compas_rhino.artists._shapeartist.ShapeArtist

Artist for drawing cone shapes.

Parameters

shape (compas.geometry.Cone) – A COMPAS cone.

Notes

See compas_rhino.artists.ShapeArtist for all other parameters.

Examples

import random
from compas.geometry import Pointcloud
from compas.geometry import Cone
from compas.geometry import Translation
from compas.utilities import i_to_rgb

import compas_rhino
from compas_rhino.artists import ConeArtist

pcl = Pointcloud.from_bounds(10, 10, 10, 200)
tpl = Cone([[[0, 0, 0], [0, 0, 1]], 0.2], 0.8)

vertices, faces = tpl.to_vertices_and_faces(4)

compas_rhino.clear_layer("Test::ConeArtist")

for point in pcl.points[:len(pcl) // 2]:
    cone = tpl.transformed(Translation.from_vector(point))
    artist = ConeArtist(cone, color=i_to_rgb(random.random()), layer="Test::ConeArtist")
    artist.draw(u=16)

Methods

__init__(shape[, color, layer])

Initialize self.

build(item, **kwargs)

Build an artist corresponding to the item type.

clear()

clear_layer()

Clear the main layer of the artist.

draw([u, show_vertices, show_edges, …])

Draw the cone associated with the artist.

redraw()

register(item_type, artist_type)