LinesConduit

class compas_rhino.conduits.LinesConduit(*args: Any, **kwargs: Any)[source]

Bases: compas_rhino.conduits.base.BaseConduit

A Rhino display conduit for lines.

Parameters
  • lines (list of 2-tuple) – A list of start-end point pairs that define the lines.

  • thickness (list of int, optional) – The thickness of the individual lines. Default is 1.0 for all lines.

  • color (list of str or 3-tuple, optional) – The colors of the faces. Default is (255, 255, 255) for all lines.

Attributes
  • color (list of RGB colors) – A color specification per line.

  • thickness (list of float) – A thickness value per line.

  • lines (list) – A list of start-end point pairs that define the lines.

Examples

from random import randint

points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
lines  = [(points[i], points[i + 1]) for i in range(99)]
conduit = LinesConduit(lines)

with conduit.enabled():
    for i in range(100):
        points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
        conduit.lines = [(points[i], points[i + 1]) for i in range(99)]
        conduit.redraw(pause=0.1)

Attributes

color

thickness

Methods

DrawForeground

Inherited Methods

CalculateBoundingBox

disable

Disable the conduit.

enable

Enable the conduit.

enabled

redraw

Redraw the conduit.