Layout Operations
This reference gives a summary of functions that operate on elements, layers and layouts.
Boolean operations
Boolean operations can be executed on three types of objects: Shapes, Elements and Layers. Standard Python operators can be used.
The following operations are supported:
Boolean |
Operator |
Description |
Supported objects |
---|---|---|---|
a AND b |
& |
Intersection (conjunction) |
Shape, Element, Layer |
a OR b |
| |
Union (disjunction) |
Shape, Element, Layer |
a XOR b |
^ |
Exclusive disjunction |
Shape, Element, Layer |
a NOT b |
- |
Difference |
Shape, Element, Layer |
NOT a |
~ |
(Unary) Negation |
Layer |
Note
Boolean operations do exactly that: boolean operations. They do not guarantee that the result can be processed by other software tools or can be manufactured. E.g. booleans may generate polygons with coinciding vertices or touching edges, which are not valid in all tools or in all geometrical operations.
A full guide on boolean operations, including examples, can be found here.
Element operations
Perform an operation on a list of elements.
Returns a list of elements on specified generated layers from the given layout data |
|
Convenience wrapper around get_elements_for_generated_layers, to merge elements on the same layer together. |
|
Subtract elems_subt from elements. |
Layout operations
Perform an operation on a LayoutView or the Layout data.
Returns all the elements in a layout on a layer that's in a given list of layers. |
|
Returns a dictionary of points that form an acute angle per given layer in a given layout. |
|
Returns elements to stub the acute angle corners of a given layout for given layers |
|
Stub the acute angles in a layout for certain layers and merge every element |
|
Finds overlapping geometries between all shapes in each specified layer of a layout. |