hull module#

Convex hulls of board elements#

A ConvexHull is a shape defined by board elements rather than coordinates: the runtime evaluates it to the convex hull of the elements’ copper, and re-evaluates it when they move.

class ConvexHull(anchors, expand=None, *, evaluated=None)[source]#

Bases: ShapeGeometry

The convex hull of board elements, evaluated by the runtime.

For now only accepted by interactive region requests (region()); a feature in code can’t use it yet.

>>> rd.layout.region(KeepOut(ConvexHull([u1, j1.p[1]], expand=0.5),
...                           LayerSet(0), pour=True))
Parameters:
  • anchors (Iterable[object]) – The elements: pads, vias, control points, ports (every pad they map to), or components (all their pads).

  • expand (float | None) – Distance to grow the hull by, negative to shrink it; None for none.

  • evaluated (Primitive | None)

anchors: tuple[object, ...]#

The elements the hull is made from.

expand: float | None#

Distance the hull is grown by, or None.

evaluated: Primitive | None#

The hull as the runtime evaluated it, or None before it has.

to_primitive()[source]#

The evaluated hull.

Raises:

ValueError – if the runtime has not evaluated the hull.

Return type:

Primitive