gdsfactory.geometry.boolean_polygons

gdsfactory.geometry.boolean_polygons#

gdsfactory.geometry.boolean_polygons(operand1: ComponentReference | Component | Polygon, operand2: ComponentReference | Component | Polygon, operation: str, output_layer: LayerSpec = (0, 0), precision: float = 0.001) list[Polygon][source]#

Perform a boolean operation and return the list of resulting Polygons. See [gdstk docs](https://heitzmann.github.io/gdstk/geometry/gdstk.boolean.html#gdstk.boolean) for details.

Parameters:
  • operand1 – polygon set A.

  • operand2 – polygon set B.

  • operation – the name of the operation to perform, i.e. “or”, “and”, “not”, or “xor”.

  • output_layer – the layer to assign the resulting polygons.

  • precision – the precision used for the operation, in microns.

Returns: a list of gdstk Polygons on the specified output layer.