Skip to content

compas_fab.rhino ¤

Rhino scene objects for compas_fab.

Scene objects expose compas_fab data structures to Rhino while keeping the data layer separated from CAD-specific code and leveraging native Rhino performance.

Classes¤

ReachabilityMapObject ¤

ReachabilityMapObject(reachability_map, layer=None, scale=1.0, **kwargs)

Scene object for drawing a reachability map.

Parameters:

  • reachability_map (:class:`compas_robots.ReachabilityMap`) –

    Robot model.

  • scale

    Scale factor that controls the length of the axes.

  • layer (str, default: None ) –

    The layer that should contain the drawing.

  • **kwargs (dict, default: {} ) –

    Additional keyword arguments.

Methods:¤

draw_cloud ¤
draw_cloud(colormap='viridis', points=None)

Returns the points and colors to create a point cloud.

The colors are calculated on the score at the respective frame. If the frames are a 2D list, the point of the first frame of the list is used.

Parameters:

  • colormap (str, default: 'viridis' ) –

    The colormap for the point cloud.

  • points (list of :class:`compas.geometry.Points`, default: None ) –

    Points to override the points from the reachability map.

Returns:

  • list[Guid]

    The GUIDs of the created Rhino objects.

draw_frames ¤
draw_frames(ik_index=None)

Returns the frames of the reachability map.

Parameters:

  • ik_index (int, default: None ) –

    If passed, returns only the reachable frames at a given IK index. For a 6-axis industrial robot this index reaches from 0 to 7 (8 solutions).

Returns:

  • list[Guid]

    The GUIDs of the created Rhino objects.

RigidBodyObject ¤

RigidBodyObject(
    draw_visual=True, draw_collision=False, native_scale=1.0, *args, **kwargs
)

Scene object for drawing a :class:~compas_fab.robots.RigidBody in Rhino.

Pass-through composition mirroring :class:RobotModelObject: caching and delta-transform logic come from :class:BaseRigidBodyObject; the Rhino bake / transform hooks come from :class:RhinoSceneObject.

RobotCellObject ¤

RobotCellObject(
    draw_visual: bool = True,
    draw_collision: bool = False,
    native_scale: float = 1.0,
    layer: str | None = None,
    *args,
    **kwargs,
)

Scene object for drawing a :class:~compas_fab.robots.RobotCell in Rhino.

RobotModelObject ¤

RobotModelObject(
    draw_visual: bool = True,
    draw_collision: bool = False,
    native_scale: float = 1.0,
    *args,
    **kwargs,
)

Scene object for drawing a :class:~compas_robots.RobotModel in Rhino.

Pass-through composition: :class:BaseRobotModelObject owns the per-link native-geometry cache and the FK delta-transform logic; :class:RhinoSceneObject supplies the Rhino-doc :meth:_create_geometry and :meth:_transform hooks.