The pyedb.extensions.create_cell_array library#

Summary#

create_array_from_unit_cell

Create a 2-D rectangular array from the current EDB unit cell.

Description#

This module contains the array building feature from unit cell.

Module detail#

create_cell_array.create_array_from_unit_cell(edb: pyedb.Edb, x_number: int = 2, y_number: int = 2, offset_x: int | float | str | None = None, offset_y: int | float | str | None = None) bool#

Create a 2-D rectangular array from the current EDB unit cell.

The function duplicates every primitive (polygon, rectangle, circle), path, padstack via, and component found in the active layout and places copies on a regular grid defined by offset_x and offset_y. If the offsets are omitted they are automatically derived from the bounding box of the first primitive found on the layer called outline (case-insensitive).

Parameters:
edbpyedb.Edb

An open Edb instance whose active layout is used as the unit cell.

x_numberint, optional

Number of columns (X-direction). Must be > 0. Defaults to 2.

y_numberint, optional

Number of rows (Y-direction). Must be > 0. Defaults to 2.

offset_xint | float | str, None, optional

Horizontal pitch (distance between cell origins). When None the value is derived from the outline geometry.

offset_yint | float | str, None, optional

Vertical pitch (distance between cell origins). When None the value is derived from the outline geometry.

Returns:
bool

True if the operation completed successfully.

Raises:
ValueError

If x_number or y_number are non-positive.

RuntimeError

If no outline is found and the offsets were not supplied, or if the outline is not a supported type (polygon/rectangle).

Notes

The routine is technology-agnostic; it delegates all EDB-specific calls to small adapter classes that handle either the gRPC or .NET back-end transparently.

Examples

>>> from pyedb import Edb
>>> edb = Edb("unit_cell.aedb")
>>> create_array_from_unit_cell(edb, x_number=4, y_number=3)
True