Skip to content

envelope

envelope(
operand,
offset=0,
trim_x_min=False,
trim_x_max=False,
trim_y_min=False,
trim_y_max=False,
round_joins=False,
use_box=False,
)

Create an envelope for the given structures.

Args

  • operand (Rectangle | Circle | Polygon | Path | Component | Reference | Iterable[Rectangle | Circle | Polygon | Path | Component | Reference]): Polygons to be processed.
  • offset (float): Amount to dilate the envelope, adding a margin between the operands and the envelope boundary.
  • trim_x_min (bool): Remove the added margin from the lower bound in the x direction.
  • trim_x_max (bool): Remove the added margin from the upper bound in the x direction.
  • trim_y_min (bool): Remove the added margin from the lower bound in the y direction.
  • trim_y_max (bool): Remove the added margin from the upper bound in the y direction.
  • round_joins (bool): Use round joins for offsetting the envelope.
  • use_box (bool): If True, use the bounding box of the operands. Otherwise, the envelope uses the convex hull.

Returns

Polygon: Computed envelope.

Examples

>>> horizontal = pf.Rectangle(center=(0, 0), size=(11, 2))
>>> vertical = pf.Rectangle(center=(0, 0), size=(2, 11))
>>> dilated_hull = pf.envelope([horizontal, vertical], 0.5)
>>> bbox = pf.envelope([horizontal, vertical], use_box=True)