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 – Polygon, Path, Reference, Component or sequence of those.

  • offset – Amount to dilate the envelope, adding a margin between the operands and the envelope boundary.

  • trim_x_min – If set, the added margin is removed from the lower bound in the x direction.

  • trim_x_max – If set, the added margin is removed from the upper bound in the x direction.

  • trim_y_min – If set, the added margin is removed from the lower bound in the y direction.

  • trim_y_max – If set, the added margin is removed from the upper bound in the y direction.

  • round_joins – If set, the envelope offset will use round joins.

  • use_box – If set, use the bounding box of the operands. Otherwise, the envelope uses the convex hull.

Returns:

Envelope structure.

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)