envelope

photonforge.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.

Parameters:
  • 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:

Computed envelope.

Return type:

Polygon

Examples

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