FrameArtist

class compas_blender.artists.FrameArtist(frame, collection=None, scale=1.0)[source]

Bases: compas_blender.artists._artist.BaseArtist

Artist for drawing frames.

Parameters
  • frame (compas.geometry.Frame) – A COMPAS frame.

  • collection (str) – The name of the frame’s collection.

  • scale (float, optional) – Scale factor that controls the length of the axes.

Attributes
  • frame (compas.geometry.Frame) – A COMPAS frame.

  • collection (str) – The name of the frame’s collection.

  • scale (float) – Scale factor that controls the length of the axes. Default is 1.0.

  • color_origin (tuple of 3 int between 0 and 255) – Default is (0, 0, 0).

  • color_xaxis (tuple of 3 int between 0 and 255) – Default is (255, 0, 0).

  • color_yaxis (tuple of 3 int between 0 and 255) – Default is (0, 255, 0).

  • color_zaxis (tuple of 3 int between 0 and 255) – Default is (0, 0, 255).

Examples

from compas.geometry import Pointcloud
from compas.geometry import Frame

from compas_blender.artists import FrameArtist

pcl = Pointcloud.from_bounds(10, 10, 10, 100)
tpl = Frame([0, 0, 0], [1, 0, 0], [0, 1, 0])

for point in pcl.points:
    frame = tpl.copy()
    frame.point = point
    artist = FrameArtist(frame)
    artist.draw()

Methods

build(item, **kwargs)

Build an artist corresponding to the item type.

clear()

Delete all objects created by the artist.

draw()

Draw the frame.

draw_axes()

Draw the axes of the frame.

draw_origin()

Draw the origin of the frame.

redraw()

Trigger a redraw.

register(item_type, artist_type)

Register a type of COMPAS object with a Blender artist.