PointsConduit

class compas_rhino.conduits.PointsConduit(*args, **kwargs)[source]

Bases: BaseConduit

A Rhino display conduit for points.

Parameters
  • points (list[[float, float, float] or compas.geometry.Point]) – The coordinates of the points.

  • size (list[int], optional) – The size of the points. Default is PointsConduit.default_size for all points.

  • color (list[tuple[int, int, int]]) – The individual colors of the points. Default is PointsConduit.default_color for all points.

Attributes
  • size (list[float]) – The size specification per point.

  • color (list[System.Drawing.Color]) – The color per point.

Class Attributes
  • default_size (float) – The default size is 3.

  • default_color (System.Drawing.Color) – The default color is FromArgb(255, 0, 0).

Examples

from random import randint
from compas_rhino.conduits import PointsConduit

points = [(1.0 * randint(0, 30), 1.0 * randint(0, 30), 0.0) for _ in range(100)]
conduit = PointsConduit(points)

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

Methods

DrawForeground

Draw the points.

Inherited Methods

CalculateBoundingBox

Calculate the model extents that should be included in the visualization.

disable

Disable the conduit.

enable

Enable the conduit.

enabled

Create a context for the conduit with automatic enabling and disabling.

redraw

Redraw the conduit.