Padstacks#

class pyedb.grpc.database.padstacks.Padstacks(p_edb: Any)#

Bases: object

Manages EDB methods for padstacks accessible from Edb.padstacks property.

Examples

>>> from pyedb import Edb
>>> edbapp = Edb("myaedbfolder", edbversion="2024.2")
>>> edb_padstacks = edbapp.padstacks

Overview#

clear_instances_cache

Clear the cached padstack instances.

find_instance_by_id

Find a padstack instance by database ID.

create_dielectric_filled_backdrills

Create dielectric-filled back-drills for through-hole vias.

create_circular_padstack

Create a circular padstack.

delete_batch_instances

delete_padstack_instances

Delete padstack instances by net names.

set_solderball

Set solderball for the given PadstackInstance.

create_coax_port

Create HFSS 3Dlayout coaxial lumped port on a pastack

get_pin_from_component_and_net

Retrieve pins by component reference designator and net name.

get_pinlist_from_component_and_net

Retrieve pins given a component’s reference designator and net name.

get_pad_parameters

Get pad parameters for a pin on a specific layer.

set_all_antipad_value

Set anti-pad value for all padstack definitions.

check_and_fix_via_plating

Check and fix via plating ratios below a minimum value.

get_via_instance_from_net

Get via instances by net names.

layers_between

Return the sub-list of layers that lies between start_layer

create

Create a padstack definition.

duplicate

Duplicate a padstack definition.

place

Place a padstack instance.

remove_pads_from_padstack

Remove pads from a padstack definition on specified layers.

set_pad_property

Set pad and anti-pad properties for a padstack definition.

get_padstack_instance_by_net_name

Get padstack instances by net name.

get_instances

Get padstack instances by search criteria.

get_reference_pins

Find reference pins near a specified pin.

get_padstack_instances_rtree_index

Returns padstack instances Rtree index.

get_padstack_instances_id_intersecting_polygon

Returns the list of padstack instances ID intersecting a given bounding box and nets.

get_padstack_instances_intersecting_bounding_box

Returns the list of padstack instances ID intersecting a given bounding box and nets.

merge_via_along_lines

Replace padstack instances along lines into a single polygon.

merge_via

Evaluate pad-stack instances included on the provided point list and replace all by single instance.

reduce_via_in_bounding_box

reduce the number of vias intersecting bounding box and nets by x and y samples.

reduce_via_by_density

Reduce the number of vias by density. Keep only one via which is closest to the center of the cell. The cells

db

Db object.

definitions

Padstack definitions.

instances

All padstack instances (vias and pins) in the layout.

instances_by_net

instances_by_name

All padstack instances (vias and pins) indexed by name.

pins

All pin instances belonging to components.

vias

All via instances not belonging to components.

pingroups

All Layout Pin groups.

pad_type

Return a PadType Enumerator.

int_to_pad_type

Convert an integer to an EDB.PadGeometryType.

int_to_geometry_type

Convert an integer to an EDB.PadGeometryType.

dbscan

density based spatial clustering for padstack instances

__getitem__

Get a padstack definition or instance from the EDB project.

Import detail#

from pyedb.grpc.database.padstacks import Padstacks

Property detail#

property Padstacks.db: Any#

Db object.

property Padstacks.definitions: Dict[str, pyedb.grpc.database.definition.padstack_def.PadstackDef]#

Padstack definitions.

Returns:
dict[str, pyedb.grpc.database.definition.padstack_def.PadstackDef]

Dictionary of padstack definitions with definition names as keys.

Examples

>>> all_definitions = edb_padstacks.definitions
>>> for name, definition in all_definitions.items():
...     print(f"Padstack: {name}")
property Padstacks.instances: Dict[int, pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]#

All padstack instances (vias and pins) in the layout.

Returns:
dict[int, pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]

Dictionary of padstack instances with database IDs as keys.

Examples

>>> all_instances = edb.padstacks.instances
>>> for id, instance in all_instances.items():
...     print(f"Instance {id}: {instance.name}")
property Padstacks.instances_by_net: Dict[Any, pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]#
property Padstacks.instances_by_name: Dict[str, pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]#

All padstack instances (vias and pins) indexed by name.

Returns:
dict[str, pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]

Dictionary of padstack instances with names as keys.

Examples

>>> named_instances = edb_padstacks.instances_by_name
>>> for name, instance in named_instances.items():
...     print(f"Instance named {name}")
property Padstacks.pins: Dict[int, pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]#

All pin instances belonging to components.

Returns:
dict[int, pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]

Dictionary of pin instances with database IDs as keys.

Examples

>>> all_pins = edb_padstacks.pins
>>> for pin_id, pin in all_pins.items():
...     print(f"Pin {pin_id} belongs to {pin.component.refdes}")
property Padstacks.vias: Dict[int, pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]#

All via instances not belonging to components.

Returns:
dict[int, pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]

Dictionary of via instances with database IDs as keys.

Examples

>>> all_vias = edb_padstacks.vias
>>> for via_id, via in all_vias.items():
...     print(f"Via {via_id} on net {via.net_name}")
property Padstacks.pingroups: List[Any]#

All Layout Pin groups.

. deprecated:: pyedb 0.28.0 Use pyedb.grpc.core.layout.pin_groups() instead.

Returns:
list

List of all layout pin groups.

Examples

>>> groups = edb_padstacks.pingroups  # Deprecated
>>> groups = edb_padstacks._layout.pin_groups  # New way
property Padstacks.pad_type: ansys.edb.core.definition.padstack_def_data.PadType#

Return a PadType Enumerator.

Method detail#

Padstacks.__getitem__(name)#

Get a padstack definition or instance from the EDB project.

Parameters:
namestr, int

Name or ID of the padstack definition or instance.

Returns:
pyedb.dotnet.database.definition.padstack_def.PadstackDef or
pyedb.dotnet.database.primitive.padstack_instance.PadstackInstance
Requested padstack definition or instance. Returns None if not found.
Padstacks.clear_instances_cache()#

Clear the cached padstack instances.

static Padstacks.int_to_pad_type(val=0) ansys.edb.core.definition.padstack_def_data.PadType#

Convert an integer to an EDB.PadGeometryType.

Parameters:
valint
Returns:
object

EDB.PadType enumerator value.

Examples

>>> pad_type = edb_padstacks.int_to_pad_type(0)  # Returns REGULAR_PAD
>>> pad_type = edb_padstacks.int_to_pad_type(1)  # Returns ANTI_PAD
static Padstacks.int_to_geometry_type(val: int = 0) ansys.edb.core.definition.padstack_def_data.PadGeometryType#

Convert an integer to an EDB.PadGeometryType.

Parameters:
valint
Returns:
object

EDB.PadGeometryType enumerator value.

Examples

>>> geom_type = edb_padstacks.int_to_geometry_type(1)  # Returns CIRCLE
>>> geom_type = edb_padstacks.int_to_geometry_type(2)  # Returns SQUARE
Padstacks.find_instance_by_id(value: int) pyedb.grpc.database.primitive.padstack_instance.PadstackInstance | None#

Find a padstack instance by database ID.

Parameters:
valueint

Database ID of the padstack instance.

Returns:
pyedb.grpc.database.primitive.padstack_instance.PadstackInstance or None

Padstack instance if found, otherwise None.

Examples

>>> via = edb_padstacks.find_instance_by_id(123)
>>> if via:
...     print(f"Found via: {via.name}")
Padstacks.create_dielectric_filled_backdrills(layer: str, diameter: float | str, material: str, permittivity: float, padstack_instances: List[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance] | None = None, padstack_definition: str | List[str] | None = None, dielectric_loss_tangent: float | None = None, nets: str | List[str] | None = None) bool#

Create dielectric-filled back-drills for through-hole vias.

Back-drilling (a.k.a. controlled-depth drilling) is used to remove the unused via stub that acts as an unterminated transmission-line segment, thereby improving signal-integrity at high frequencies. This routine goes one step further: after the stub is removed the resulting cylindrical cavity is completely filled with a user-specified dielectric. The fill material restores mechanical rigidity, prevents solder-wicking, and keeps the original via’s electrical characteristics intact on the remaining, still-plated, portion.

Parameters:
layerstr

Signal layer name up to which the back-drill is performed (inclusive). The drill always starts on the bottom-most signal layer of the stack-up.

diameterfloat or str

Finished hole diameter for the back-drill. A numeric value is interpreted in the database length unit; a string such as "0.3mm" is evaluated with units.

materialstr

Name of the dielectric material that fills the drilled cavity. If the material does not yet exist in the central material library it is created on the fly.

permittivityfloat

Relative permittivity \(\varepsilon_{\mathrm{r}}\) used when the material has to be created. Must be positive.

padstack_instanceslist [PadstackInstance ], optional

Explicit list of via instances to process. When provided, padstack_definition and nets are ignored for filtering.

padstack_definitionstr or list [str ], optional

Pad-stack definition(s) to process. If omitted, all through-hole definitions are considered.

dielectric_loss_tangentfloat, optional

Loss tangent \(\tan\delta\) used when the material has to be created. Defaults to 0.0.

netsstr or list [str ], optional

Net name(s) used to filter vias. If omitted, vias belonging to any net are processed.

Returns:
bool

True when at least one back-drill was successfully created. False if no suitable via was found or any error occurred.

Raises:
ValueError

If material is empty or if permittivity is non-positive when a new material must be created.

Notes

  • The routine is safe to call repeatedly: existing back-drills are not duplicated because the *_BD definition name is deterministic.

  • The original via keeps its pad-stack definition and net assignment; only its unused stub is removed.

  • The back-drill is not subtracted from anti-pads or plane clearances; the filling material is assumed to be electrically invisible at the frequencies of interest.

Examples

Create back-drills on all vias belonging to two specific pad-stack definitions and two DDR4 nets:

>>> edb.padstacks.create_dielectric_filled_backdrills(
...     layer="L3",
...     diameter="0.25mm",
...     material="EPON_827",
...     permittivity=3.8,
...     dielectric_loss_tangent=0.015,
...     padstack_definition=["VIA_10MIL", "VIA_16MIL"],
...     nets=["DDR4_DQ0", "DDR4_DQ1"],
... )
True
Padstacks.create_circular_padstack(padstackname: str | None = None, holediam: str = '300um', paddiam: str = '400um', antipaddiam: str = '600um', startlayer: str | None = None, endlayer: str | None = None) str#

Create a circular padstack.

Parameters:
padstacknamestr, optional

Name of the padstack. The default is None.

holediamstr, optional

Diameter of the hole with units. The default is "300um".

paddiamstr, optional

Diameter of the pad with units. The default is "400um".

antipaddiamstr, optional

Diameter of the antipad with units. The default is "600um".

startlayerstr, optional

Starting layer. The default is None, in which case the top is the starting layer.

endlayerstr, optional

Ending layer. The default is None, in which case the bottom is the ending layer.

Returns:
str

Name of the padstack if the operation is successful.

Examples

>>> via_name = edb_padstacks.create_circular_padstack(
...     padstackname="VIA1", holediam="200um", paddiam="400um", antipaddiam="600um"
... )
Padstacks.delete_batch_instances(instances_to_delete)#
Padstacks.delete_padstack_instances(net_names: str | List[str]) bool#

Delete padstack instances by net names.

Parameters:
net_namesstr, list

Names of the nets whose padstack instances should be deleted.

Returns:
bool

True when successful, False when failed.

Examples

>>> success = edb_padstacks.delete_padstack_instances("GND")
>>> success = edb_padstacks.delete_padstack_instances(["GND", "PWR"])
Padstacks.set_solderball(padstackInst, sballLayer_name, isTopPlaced=True, ballDiam=0.0001)#

Set solderball for the given PadstackInstance.

Parameters:
padstackInstEdb.Cell.Primitive.PadstackInstance or int

Padstack instance id or object.

sballLayer_namestr,

Name of the layer where the solder ball is placed. No default values.

isTopPlacedbool, optional.

Bollean triggering is the solder ball is placed on Top or Bottom of the layer stackup.

ballDiamdouble, optional,

Solder ball diameter value.

Returns:
bool
Padstacks.create_coax_port(padstackinstance, use_dot_separator=True, name=None)#

Create HFSS 3Dlayout coaxial lumped port on a pastack Requires to have solder ball defined before calling this method.

. deprecated:: pyedb 0.28.0 Use pyedb.grpc.core.excitations.create_source_on_component() instead.

Parameters:
padstackinstanceEdb.Cell.Primitive.PadstackInstance or int

Padstack instance object.

use_dot_separatorbool, optional

Whether to use . as the separator for the naming convention, which is [component][net][pin]. The default is True. If False, _ is used as the separator instead.

namestr

Port name for overwriting the default port-naming convention, which is [component][net][pin]. The port name must be unique. If a port with the specified name already exists, the default naming convention is used so that port creation does not fail.

Returns:
str

Terminal name.

Padstacks.get_pin_from_component_and_net(refdes: str | None = None, netname: str | None = None) List[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]#

Retrieve pins by component reference designator and net name.

Parameters:
refdesstr, optional

Component reference designator.

netnamestr, optional

Net name.

Returns:
list[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]

List of matching pin instances.

Examples

>>> pins = edb_padstacks.get_pin_from_component_and_net(refdes="U1", netname="VCC")
>>> pins = edb_padstacks.get_pin_from_component_and_net(netname="GND")  # All GND pins
Padstacks.get_pinlist_from_component_and_net(refdes=None, netname=None)#

Retrieve pins given a component’s reference designator and net name.

. deprecated:: pyedb 0.28.0 Use get_pin_from_component_and_net() instead.

Parameters:
refdesstr, optional

Reference designator of the component. The default is None.

netnamestr optional

Name of the net. The default is None.

Returns:
dict

Dictionary of pins if the operation is successful. False is returned if the net does not belong to the component.

Examples

>>> pins = edb_padstacks.get_pinlist_from_component_and_net(refdes="U1", netname="CLK")  # Deprecated
>>> pins = edb_padstacks.get_pin_from_component_and_net(refdes="U1", netname="CLK")  # New way
Padstacks.get_pad_parameters(pin: pyedb.grpc.database.primitive.padstack_instance.PadstackInstance, layername: str, pad_type: str = 'regular_pad') Tuple[ansys.edb.core.definition.padstack_def_data.PadGeometryType, List[float], List[float], float]#

Get pad parameters for a pin on a specific layer.

Parameters:
pinpyedb.grpc.database.primitive.padstack_instance.PadstackInstance

Padstack instance.

layernamestr

Layer name.

pad_typestr, optional

Pad type (“regular_pad”, “anti_pad”, “thermal_pad”). Default is "regular_pad".

Returns:
tuple

(geometry_type, parameters, offset_x, offset_y, rotation) where: - geometry_type : str - parameters : list[float] or list[list[float]] - offset_x : float - offset_y : float - rotation : float

Examples

>>> via = edb_padstacks.instances[123]
>>> geom_type, params, x, y, rot = edb_padstacks.get_pad_parameters(via, "TOP", "regular_pad")
Padstacks.set_all_antipad_value(value: float | str) bool#

Set anti-pad value for all padstack definitions.

Parameters:
valuefloat or str

Anti-pad value with units (e.g., “0.2mm”).

Returns:
bool

True when successful, False when failed.

Examples

>>> success = edb_padstacks.set_all_antipad_value("0.3mm")
Padstacks.check_and_fix_via_plating(minimum_value_to_replace: float = 0.0, default_plating_ratio: float = 0.2) bool#

Check and fix via plating ratios below a minimum value.

Parameters:
minimum_value_to_replacefloat, optional

Minimum plating ratio threshold. Default is 0.0.

default_plating_ratiofloat, optional

Default plating ratio to apply. Default is 0.2.

Returns:
bool

True when successful, False when failed.

Examples

>>> success = edb_padstacks.check_and_fix_via_plating(minimum_value_to_replace=0.1)
Padstacks.get_via_instance_from_net(net_list: str | List[str] | None = None) List[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]#

Get via instances by net names.

Parameters:
net_liststr or list, optional

Net name(s) for filtering. Returns all vias if None.

Returns:
list[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]

List of via instances.

Examples

>>> vias = edb_padstacks.get_via_instance_from_net("GND")
>>> vias = edb_padstacks.get_via_instance_from_net(["GND", "PWR"])
Padstacks.layers_between(layers, start_layer=None, stop_layer=None)#

Return the sub-list of layers that lies between start_layer (inclusive) and stop_layer (inclusive). Works no matter which of the two is nearer the top of the stack.

Padstacks.create(padstackname: str | None = None, holediam: str = '300um', paddiam: str = '400um', antipaddiam: str = '600um', pad_shape: str = 'Circle', antipad_shape: str = 'Circle', x_size: str = '600um', y_size: str = '600um', corner_radius: str = '300um', offset_x: str = '0.0', offset_y: str = '0.0', rotation: str = '0.0', has_hole: bool = True, pad_offset_x: str = '0.0', pad_offset_y: str = '0.0', pad_rotation: str = '0.0', pad_polygon: Any | None = None, antipad_polygon: Any | None = None, polygon_hole: Any | None = None, start_layer: str | None = None, stop_layer: str | None = None, add_default_layer: bool = False, anti_pad_x_size: str = '600um', anti_pad_y_size: str = '600um', hole_range: str = 'upper_pad_to_lower_pad')#

Create a padstack definition.

Parameters:
padstacknamestr, optional

Name of the padstack definition.

holediamstr, optional

Hole diameter with units. Default is "300um".

paddiamstr, optional

Pad diameter with units. Default is "400um".

antipaddiamstr, optional

Anti-pad diameter with units. Default is "600um".

pad_shapestr, optional

Pad geometry type (“Circle”, “Rectangle”, “Polygon”). Default is "Circle".

antipad_shapestr, optional

Anti-pad geometry type (“Circle”, “Rectangle”, “Bullet”, “Polygon”). Default is "Circle".

x_sizestr, optional

X-size for rectangular/bullet shapes. Default is "600um".

y_sizestr, optional

Y-size for rectangular/bullet shapes. Default is "600um".

corner_radiusstr, optional

Corner radius for bullet shapes. Default is "300um".

offset_xstr, optional

X-offset for anti-pad. Default is "0.0".

offset_ystr, optional

Y-offset for anti-pad. Default is "0.0".

rotationstr, optional

Rotation for anti-pad in degrees. Default is "0.0".

has_holebool, optional

Whether the padstack has a hole. Default is True.

pad_offset_xstr, optional

X-offset for pad. Default is "0.0".

pad_offset_ystr, optional

Y-offset for pad. Default is "0.0".

pad_rotationstr, optional

Rotation for pad in degrees. Default is "0.0".

pad_polygonlist or ansys.edb.core.geometry.PolygonData, optional

Polygon points for custom pad shape.

antipad_polygonlist or ansys.edb.core.geometry.PolygonData, optional

Polygon points for custom anti-pad shape.

polygon_holelist or ansys.edb.core.geometry.PolygonData, optional

Polygon points for custom hole shape.

start_layerstr, optional

Starting layer name.

stop_layerstr, optional

Ending layer name.

add_default_layerbool, optional

Whether to add “Default” layer. Default is False.

anti_pad_x_sizestr, optional

Anti-pad X-size. Default is "600um".

anti_pad_y_sizestr, optional

Anti-pad Y-size. Default is "600um".

hole_rangestr, optional

Hole range type (“through”, “begin_on_upper_pad”, “end_on_lower_pad”, “upper_pad_to_lower_pad”). Default is "upper_pad_to_lower_pad".

Returns:
str

Name of the created padstack definition.

Padstacks.duplicate(target_padstack_name: str, new_padstack_name: str = '') str#

Duplicate a padstack definition.

Parameters:
target_padstack_namestr

Name of the padstack definition to duplicate.

new_padstack_namestr, optional

Name for the new padstack definition.

Returns:
str

Name of the new padstack definition.

Padstacks.place(position: List[float], definition_name: str, net_name: str = '', via_name: str = '', rotation: float = 0.0, fromlayer: str | None = None, tolayer: str | None = None, solderlayer: str | None = None, is_pin: bool = False) pyedb.grpc.database.primitive.padstack_instance.PadstackInstance#

Place a padstack instance.

Parameters:
positionlist[float, float]

[x, y] position for placement.

definition_namestr

Padstack definition name.

net_namestr, optional

Net name. Default is "".

via_namestr, optional

Instance name. Default is "".

rotationfloat, optional

Rotation in degrees. Default is 0.0.

fromlayerstr, optional

Starting layer name.

tolayerstr, optional

Ending layer name.

solderlayerstr, optional

Solder ball layer name.

is_pinbool, optional

Whether the instance is a pin. Default is False.

Returns:
pyedb.grpc.database.primitive.padstack_instance.PadstackInstance or bool

Created padstack instance or False if failed.

Padstacks.remove_pads_from_padstack(padstack_name: str, layer_name: str | None = None)#

Remove pads from a padstack definition on specified layers.

Parameters:
padstack_namestr

Padstack definition name.

layer_namestr or list, optional

Layer name(s). Applies to all layers if None.

Returns:
bool

True when successful, False when failed.

Padstacks.set_pad_property(padstack_name: str, layer_name: str | None = None, pad_shape: str = 'Circle', pad_params: float | List[float] = 0, pad_x_offset: float = 0, pad_y_offset: float = 0, pad_rotation: float = 0, antipad_shape: str = 'Circle', antipad_params: float | List[float] = 0, antipad_x_offset: float = 0, antipad_y_offset: float = 0, antipad_rotation: float = 0)#

Set pad and anti-pad properties for a padstack definition.

Parameters:
padstack_namestr

Padstack definition name.

layer_namestr or list, optional

Layer name(s). Applies to all layers if None.

pad_shapestr, optional

Pad geometry type (“Circle”, “Square”, “Rectangle”, “Oval”, “Bullet”). Default is "Circle".

pad_paramsfloat or list, optional

Pad dimension(s). Default is 0.

pad_x_offsetfloat, optional

Pad X-offset. Default is 0.

pad_y_offsetfloat, optional

Pad Y-offset. Default is 0.

pad_rotationfloat, optional

Pad rotation in degrees. Default is 0.

antipad_shapestr, optional

Anti-pad geometry type (“Circle”, “Square”, “Rectangle”, “Oval”, “Bullet”). Default is "Circle".

antipad_paramsfloat or list, optional

Anti-pad dimension(s). Default is 0.

antipad_x_offsetfloat, optional

Anti-pad X-offset. Default is 0.

antipad_y_offsetfloat, optional

Anti-pad Y-offset. Default is 0.

antipad_rotationfloat, optional

Anti-pad rotation in degrees. Default is 0.

Returns:
bool

True when successful, False when failed.

Padstacks.get_padstack_instance_by_net_name(net: str)#

Get padstack instances by net name.

Deprecated since version 0.55.0.

Use: get_instances() with net_name parameter instead.

Parameters:
netstr

Net name to filter padstack instances.

Returns:
list[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]

List of padstack instances associated with the specified net.

Padstacks.get_instances(name: str | None = None, pid: int | None = None, definition_name: str | None = None, net_name: str | List[str] | None = None, component_reference_designator: str | None = None, component_pin: str | None = None) List[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]#

Get padstack instances by search criteria.

Parameters:
namestr, optional

Instance name.

pidint, optional

Database ID.

definition_namestr or list, optional

Padstack definition name(s).

net_namestr or list, optional

Net name(s).

component_reference_designatorstr or list, optional

Component reference designator(s).

component_pinstr or list, optional

Component pin number(s).

Returns:
list[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]

List of matching padstack instances.

Padstacks.get_reference_pins(positive_pin: int | str | pyedb.grpc.database.primitive.padstack_instance.PadstackInstance, reference_net: str = 'gnd', search_radius: float = 0.005, max_limit: int = 0, component_only: bool = True) List[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]#

Find reference pins near a specified pin.

Parameters:
positive_pinpyedb.grpc.database.primitive.padstack_instance.PadstackInstance

Target pin.

reference_netstr, optional

Reference net name. Default is "gnd".

search_radiusfloat, optional

Search radius in meters. Default is 5e-3 (5 mm).

max_limitint, optional

Maximum number of pins to return. Default is 0 (no limit).

component_onlybool, optional

Whether to search only in component pins. Default is True.

Returns:
list[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]

List of reference pins.

Padstacks.get_padstack_instances_rtree_index(nets: str | List[str] | None = None) rtree.index.Index#

Returns padstack instances Rtree index.

Parameters:
netsstr or list, optional

net name of list of nets name applying filtering on padstack instances selection. If None is provided all instances are included in the index. Default value is None.

Returns:
Rtree index object.
Padstacks.get_padstack_instances_id_intersecting_polygon(points: List[Tuple[float, float]], nets: str | List[str] | None = None, padstack_instances_index: Dict[int, Tuple[float, float]] | None = None) List[int]#

Returns the list of padstack instances ID intersecting a given bounding box and nets.

Parameters:
pointstuple or list.

bounding box, [x1, y1, x2, y2]

netsstr or list, optional

net name of list of nets name applying filtering on padstack instances selection. If None is provided all instances are included in the index. Default value is None.

padstack_instances_indexoptional, Rtree object.

Can be provided optionally to prevent computing padstack instances Rtree index again.

Returns:
List[int]

List of padstack instances ID intersecting the bounding box.

Padstacks.get_padstack_instances_intersecting_bounding_box(bounding_box: List[float], nets: str | List[str] | None = None, padstack_instances_index: rtree.index.Index | None = None) List[pyedb.grpc.database.primitive.padstack_instance.PadstackInstance]#

Returns the list of padstack instances ID intersecting a given bounding box and nets. Parameters ———- bounding_box : tuple or list.

bounding box, [x1, y1, x2, y2]

netsstr or list, optional

net name of list of nets name applying filtering on padstack instances selection. If None is provided all instances are included in the index. Default value is None.

padstack_instances_indexoptional, Rtree object.

Can be provided optionally to prevent computing padstack instances Rtree index again.

Returns#

List of padstack instances ID intersecting the bounding box.

Padstacks.merge_via_along_lines(net_name: str = 'GND', distance_threshold: float = 0.005, minimum_via_number: int = 6, selected_angles: List[float] | None = None, padstack_instances_id: List[int] | None = None) List[str]#

Replace padstack instances along lines into a single polygon.

Detect all pad-stack instances that are placed along lines and replace them by a single polygon based one forming a wall shape. This method is designed to simplify meshing on via fence usually added to shield RF traces on PCB.

Parameters:
net_namestr

Net name used for detected pad-stack instances. Default value is "GND".

distance_thresholdfloat, None, optional

If two points in a line are separated by a distance larger than distance_threshold, the line is divided in two parts. Default is 5e-3 (5mm), in which case the control is not performed.

minimum_via_numberint, optional

The minimum number of points that a line must contain. Default is 6.

selected_angleslist[int, float]

Specify angle in degrees to detected, for instance [0, 180] is only detecting horizontal and vertical lines. Other values can be assigned like 45 degrees. When None is provided all lines are detected. Default value is None.

padstack_instances_idList[int]

List of pad-stack instances ID’s to include. If None, the algorithm will scan all pad-stack instances belonging to the specified net. Default value is None.

Returns:
List[int], list of created pad-stack instances id.
Padstacks.merge_via(contour_boxes: List[List[float]], net_filter: str | List[str] | None = None, start_layer: str | None = None, stop_layer: str | None = None) List[str]#

Evaluate pad-stack instances included on the provided point list and replace all by single instance.

Parameters:
contour_boxesList[List[List[float, float]]]

Nested list of polygon with points [x,y].

net_filteroptional

List[str: net_name] apply a net filter, nets included in the filter are excluded from the via merge.

start_layeroptional, str

Pad-stack instance start layer, if None the top layer is selected.

stop_layeroptional, str

Pad-stack instance stop layer, if None the bottom layer is selected.

Padstacks.reduce_via_in_bounding_box(bounding_box: List[float], x_samples: int, y_samples: int, nets: str | List[str] | None = None) bool#

reduce the number of vias intersecting bounding box and nets by x and y samples.

Parameters:
bounding_boxtuple or list.

bounding box, [x1, y1, x2, y2]

x_samplesint
y_samplesint
netsstr or list, optional

net name of list of nets name applying filtering on pad-stack instances selection. If None is provided all instances are included in the index. Default value is None.

Returns:
bool

True when succeeded False when failed.

static Padstacks.dbscan(padstack: Dict[int, List[float]], max_distance: float = 0.001, min_samples: int = 5) Dict[int, List[str]]#

density based spatial clustering for padstack instances

Parameters:
padstackdict.

padstack id: [x, y]

max_distance: float

maximum distance between two points to be included in one cluster

min_samples: int

minimum number of points that a cluster must have

Returns:
dict

clusters {cluster label: [padstack ids]} <

Padstacks.reduce_via_by_density(padstacks: List[int], cell_size_x: float = 0.001, cell_size_y: float = 0.001, delete: bool = False) tuple[List[int], List[List[List[float]]]]#

Reduce the number of vias by density. Keep only one via which is closest to the center of the cell. The cells are automatically populated based on the input vias.

Parameters:
padstacks: List[int]

List of padstack ids to be reduced.

cell_size_xfloat

Width of each grid cell (default is 1e-3).

cell_size_yfloat

Height of each grid cell (default is 1e-3).

delete: bool

If True, delete vias that are not kept (default is False).

Returns:
List[int]

IDs of vias kept after reduction.

List[List[float]]

coordinates for grid lines (for plotting).