DotNetCutout#

class pyedb.workflows.utilities.cutout.DotNetCutout(edb)#

Create a clipped (cut-out) EDB cell from an existing layout. High-performance EDB cut-out utility.

Attributes:
signalslist[str]

List of signal net names to keep in the cut-out.

referenceslist[str]

List of reference net names to keep in the cut-out.

extent_typestr

Extent algorithm: ConvexHull (default), Conforming, Bounding.

expansion_sizefloat

Additional margin (metres) around the computed extent. Default 0.002.

use_round_cornerbool

Round the corners of the expanded extent. Default False.

custom_extentlist[tuple[float, float]] | None

Optional closed polygon [(x1,y1), …] overriding any automatic extent.

custom_extent_unitsstr

Length unit for custom_extent. Default mm.

include_voids_in_extentsbool

Include voids ≥ 5 % of the extent area when building the clip polygon.

open_cutout_at_endbool

Open the resulting cut-out database in the active Edb object. Default True.

use_pyaedt_cutoutbool

Use the PyAEDT based implementation instead of native EDB API. Default True.

smart_cutoutbool

Automatically enlarge expansion_size until all ports have reference. Default False.

expansion_factorfloat

If > 0, compute initial expansion_size from trace-width/dielectric. Default 0.

maximum_iterationsint

Maximum attempts for smart_cutout before giving up. Default 10.

number_of_threadsint

Worker threads for polygon clipping and padstack cleaning. Default 1.

remove_single_pin_componentsbool

Delete RLC components with only one pin after cut-out. Default False.

preserve_components_with_modelbool

Keep every pin of components that carry a Spice/S-parameter model. Default False.

check_terminalsbool

Grow extent until all reference terminals are inside the cut-out. Default False.

include_pingroupsbool

Ensure complete pin-groups are included (needs check_terminals). Default False.

simple_pad_checkbool

Use fast centre-point padstack check instead of bounding-box. Default True.

keep_lines_as_pathbool

Keep clipped traces as Path objects (3D Layout only). Default False.

extent_defeaturefloat

Defeature tolerance (metres) for conformal extent. Default 0.

include_partial_instancesbool

Include padstacks that only partially overlap the clip polygon. Default False.

keep_voidsbool

Retain voids that intersect the clip polygon. Default True.

The cut-out can be produced with three different extent strategies:
* ``ConvexHull`` (default)
* ``Conforming`` (tight follow of geometry)
* ``Bounding`` (simple bounding box)
Multi-threaded execution, automatic terminal expansion and smart
expansion-factor logic are supported.

Examples

>>> cut = Cutout(edb)
>>> cut.signals = ["DDR4_DQ0", "DDR4_DQ1"]
>>> cut.references = ["GND"]
>>> cut.expansion_size = 0.001
>>> polygon = cut.run()

Overview#

Import detail#

from pyedb.workflows.utilities.cutout import DotNetCutout

Property detail#

property DotNetCutout.logger#

EDB logger instance.

Returns:
Logger

Logger object from the EDB instance.

Attribute detail#

DotNetCutout.signals: list[str] = []#
DotNetCutout.references: list[str] = []#
DotNetCutout.extent_type: str = 'ConvexHull'#
DotNetCutout.expansion_size: str | float = 0.002#
DotNetCutout.use_round_corner: bool = False#
DotNetCutout.output_file: str = ''#
DotNetCutout.open_cutout_at_end: bool = True#
DotNetCutout.use_pyaedt_cutout: bool = True#
DotNetCutout.smart_cutout: bool = False#
DotNetCutout.number_of_threads: int = 2#
DotNetCutout.use_pyaedt_extent_computing: bool = True#
DotNetCutout.extent_defeature: int | float = 0#
DotNetCutout.remove_single_pin_components: bool = False#
DotNetCutout.custom_extent: list = None#
DotNetCutout.custom_extent_units: str = 'mm'#
DotNetCutout.include_partial_instances: bool = False#
DotNetCutout.keep_voids: bool = True#
DotNetCutout.check_terminals: bool = False#
DotNetCutout.include_pingroups: bool = False#
DotNetCutout.expansion_factor: int | float = 0#
DotNetCutout.maximum_iterations: int = 10#
DotNetCutout.preserve_components_with_model: bool = False#
DotNetCutout.simple_pad_check: bool = True#
DotNetCutout.keep_lines_as_path: bool = False#
DotNetCutout.include_voids_in_extents: bool = False#

Method detail#

DotNetCutout.calculate_initial_extent(expansion_factor: float) float#

Compute initial extent based on trace width and dielectric thickness.

Calculate a float representing the larger number between the dielectric thickness or trace width multiplied by the nW factor. The trace width search is limited to nets with ports attached.

Parameters:
expansion_factorfloat

Value for the width multiplier (nW factor).

Returns:
float

Calculated initial extent in metres.

Examples

>>> cutout = Cutout(edb)
>>> initial_extent = cutout.calculate_initial_extent(3.0)
DotNetCutout.pins_to_preserve() tuple#

Identify pins and nets that must be preserved during cutout.

Returns:
tuple

Tuple containing (pins_to_preserve, nets_to_preserve) where:

  • pins_to_preservelist

    List of pin IDs to keep.

  • nets_to_preservelist[str]

    List of net names to keep.

DotNetCutout.run() list | bool#

Execute the cutout operation.

This method performs the complete cutout workflow including:

  • Smart cutout iterations if enabled

  • Extent computation with expansion factor

  • Multi-threaded geometry clipping

  • Component and net cleanup

  • Output file generation

Returns:
list[list[float, float]] or bool

List of [x, y] coordinate pairs defining the extent polygon if successful, False if cutout failed.

Examples

>>> from pyedb import Edb
>>> edb = Edb("design.aedb")
>>> cutout = Cutout(edb)
>>> cutout.signals = ["DDR4_DQ0", "DDR4_CLK"]
>>> cutout.references = ["GND"]
>>> cutout.expansion_size = 0.002
>>> cutout.output_file = "cutout.aedb"
>>> polygon = cutout.run()