VectorArtist

class compas_rhino.artists.VectorArtist(primitive, color=None, layer=None)[source]

Bases: compas_rhino.artists._primitiveartist.PrimitiveArtist

Artist for drawing vectors.

Parameters

primitive (compas.geometry.Vector) – A COMPAS vector.

Notes

See compas_rhino.artists.PrimitiveArtist for all other parameters.

Examples

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

import compas_rhino
from compas_rhino.artists import VectorArtist

pcl = Pointcloud.from_bounds(10, 10, 10, 100)

compas_rhino.clear_layer("Test::VectorArtist")

for point in pcl.points:
    vector = Vector(0, 0, 1)
    artist = VectorArtist(vector, color=i_to_rgb(random.random()), layer="Test::VectorArtist")
    artist.draw(point=point)

Methods

__init__(primitive[, color, layer])

Initialize self.

build(item, **kwargs)

Build an artist corresponding to the item type.

clear()

clear_layer()

Clear the layer containing the artist.

draw([point, show_point])

Draw the vector.

redraw()

register(item_type, artist_type)