Padstacks#
- class pyedb.grpc.database.padstacks.Padstacks(p_edb: Any)#
Bases:
objectManages 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 the cached padstack instances. |
|
Find a padstack instance by database ID. |
|
Create dielectric-filled back-drills for through-hole vias. |
|
Create a circular padstack. |
|
Delete padstack instances by net names. |
|
Set solderball for the given PadstackInstance. |
|
Create HFSS 3Dlayout coaxial lumped port on a pastack |
|
Retrieve pins by component reference designator and net name. |
|
Retrieve pins given a component’s reference designator and net name. |
|
Get pad parameters for a pin on a specific layer. |
|
Set anti-pad value for all padstack definitions. |
|
Check and fix via plating ratios below a minimum value. |
|
Get via instances by net names. |
|
Return the sub-list of layers that lies between start_layer |
|
Create a padstack definition. |
|
Duplicate a padstack definition. |
|
Place a padstack instance. |
|
Remove pads from a padstack definition on specified layers. |
|
Set pad and anti-pad properties for a padstack definition. |
|
Get padstack instances by net name. |
|
Get padstack instances by search criteria. |
|
Find reference pins near a specified pin. |
|
Returns padstack instances Rtree index. |
|
Returns the list of padstack instances ID intersecting a given bounding box and nets. |
|
Returns the list of padstack instances ID intersecting a given bounding box and nets. |
|
Replace padstack instances along lines into a single polygon. |
|
Evaluate pad-stack instances included on the provided point list and replace all by single instance. |
|
reduce the number of vias intersecting bounding box and nets by x and y samples. |
|
Reduce the number of vias by density. Keep only one via which is closest to the center of the cell. The cells |
Db object. |
|
Padstack definitions. |
|
All padstack instances (vias and pins) in the layout. |
|
All padstack instances (vias and pins) indexed by name. |
|
All pin instances belonging to components. |
|
All via instances not belonging to components. |
|
All Layout Pin groups. |
|
Return a PadType Enumerator. |
Convert an integer to an EDB.PadGeometryType. |
|
Convert an integer to an EDB.PadGeometryType. |
|
density based spatial clustering for padstack instances |
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:
listList 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.
- 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.
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.
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:
- value
int Database ID of the padstack instance.
- value
- Returns:
pyedb.grpc.database.primitive.padstack_instance.PadstackInstanceorNonePadstack 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:
- layer
str 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.
- diameter
floatorstr 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.- material
str 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.
- permittivity
float Relative permittivity \(\varepsilon_{\mathrm{r}}\) used when the material has to be created. Must be positive.
- padstack_instances
list[PadstackInstance],optional Explicit list of via instances to process. When provided,
padstack_definitionandnetsare ignored for filtering.- padstack_definition
strorlist[str],optional Pad-stack definition(s) to process. If omitted, all through-hole definitions are considered.
- dielectric_loss_tangent
float,optional Loss tangent \(\tan\delta\) used when the material has to be created. Defaults to
0.0.- nets
strorlist[str],optional Net name(s) used to filter vias. If omitted, vias belonging to any net are processed.
- layer
- Returns:
boolTruewhen at least one back-drill was successfully created.Falseif no suitable via was found or any error occurred.
- Raises:
ValueErrorIf
materialis empty or ifpermittivityis 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
*_BDdefinition 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:
- padstackname
str,optional Name of the padstack. The default is
None.- holediam
str,optional Diameter of the hole with units. The default is
"300um".- paddiam
str,optional Diameter of the pad with units. The default is
"400um".- antipaddiam
str,optional Diameter of the antipad with units. The default is
"600um".- startlayer
str,optional Starting layer. The default is
None, in which case the top is the starting layer.- endlayer
str,optional Ending layer. The default is
None, in which case the bottom is the ending layer.
- padstackname
- Returns:
strName 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:
- Returns:
- bool
Truewhen successful,Falsewhen 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:
- padstackInst
Edb.Cell.Primitive.PadstackInstanceorint 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.
- ballDiam
double, optional, Solder ball diameter value.
- padstackInst
- Returns:
- 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 isTrue. IfFalse,_is used as the separator instead.- name
str 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.
- padstackinstanceEdb.Cell.Primitive.PadstackInstance or
- Returns:
strTerminal 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:
- 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:
- Returns:
dictDictionary of pins if the operation is successful.
Falseis 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:
- pin
pyedb.grpc.database.primitive.padstack_instance.PadstackInstance Padstack instance.
- layername
str Layer name.
- pad_type
str,optional Pad type (“regular_pad”, “anti_pad”, “thermal_pad”). Default is
"regular_pad".
- pin
- 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:
- Returns:
- bool
Truewhen successful,Falsewhen 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:
- Returns:
- bool
Truewhen successful,Falsewhen 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:
- 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:
- padstackname
str,optional Name of the padstack definition.
- holediam
str,optional Hole diameter with units. Default is
"300um".- paddiam
str,optional Pad diameter with units. Default is
"400um".- antipaddiam
str,optional Anti-pad diameter with units. Default is
"600um".- pad_shape
str,optional Pad geometry type (“Circle”, “Rectangle”, “Polygon”). Default is
"Circle".- antipad_shape
str,optional Anti-pad geometry type (“Circle”, “Rectangle”, “Bullet”, “Polygon”). Default is
"Circle".- x_size
str,optional X-size for rectangular/bullet shapes. Default is
"600um".- y_size
str,optional Y-size for rectangular/bullet shapes. Default is
"600um".- corner_radius
str,optional Corner radius for bullet shapes. Default is
"300um".- offset_x
str,optional X-offset for anti-pad. Default is
"0.0".- offset_y
str,optional Y-offset for anti-pad. Default is
"0.0".- rotation
str,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_x
str,optional X-offset for pad. Default is
"0.0".- pad_offset_y
str,optional Y-offset for pad. Default is
"0.0".- pad_rotation
str,optional Rotation for pad in degrees. Default is
"0.0".- pad_polygon
listoransys.edb.core.geometry.PolygonData,optional Polygon points for custom pad shape.
- antipad_polygon
listoransys.edb.core.geometry.PolygonData,optional Polygon points for custom anti-pad shape.
- polygon_hole
listoransys.edb.core.geometry.PolygonData,optional Polygon points for custom hole shape.
- start_layer
str,optional Starting layer name.
- stop_layer
str,optional Ending layer name.
- add_default_layerbool,
optional Whether to add “Default” layer. Default is
False.- anti_pad_x_size
str,optional Anti-pad X-size. Default is
"600um".- anti_pad_y_size
str,optional Anti-pad Y-size. Default is
"600um".- hole_range
str,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".
- padstackname
- Returns:
strName of the created padstack definition.
- Padstacks.duplicate(target_padstack_name: str, new_padstack_name: str = '') str#
Duplicate a 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:
- position
list[float,float] [x, y] position for placement.
- definition_name
str Padstack definition name.
- net_name
str,optional Net name. Default is
"".- via_name
str,optional Instance name. Default is
"".- rotation
float,optional Rotation in degrees. Default is
0.0.- fromlayer
str,optional Starting layer name.
- tolayer
str,optional Ending layer name.
- solderlayer
str,optional Solder ball layer name.
- is_pinbool,
optional Whether the instance is a pin. Default is
False.
- position
- Returns:
pyedb.grpc.database.primitive.padstack_instance.PadstackInstanceor boolCreated padstack instance or
Falseif failed.
- Padstacks.remove_pads_from_padstack(padstack_name: str, layer_name: str | None = None)#
Remove pads from a padstack definition on specified layers.
- 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_name
str Padstack definition name.
- layer_name
strorlist,optional Layer name(s). Applies to all layers if
None.- pad_shape
str,optional Pad geometry type (“Circle”, “Square”, “Rectangle”, “Oval”, “Bullet”). Default is
"Circle".- pad_params
floatorlist,optional Pad dimension(s). Default is
0.- pad_x_offset
float,optional Pad X-offset. Default is
0.- pad_y_offset
float,optional Pad Y-offset. Default is
0.- pad_rotation
float,optional Pad rotation in degrees. Default is
0.- antipad_shape
str,optional Anti-pad geometry type (“Circle”, “Square”, “Rectangle”, “Oval”, “Bullet”). Default is
"Circle".- antipad_params
floatorlist,optional Anti-pad dimension(s). Default is
0.- antipad_x_offset
float,optional Anti-pad X-offset. Default is
0.- antipad_y_offset
float,optional Anti-pad Y-offset. Default is
0.- antipad_rotation
float,optional Anti-pad rotation in degrees. Default is
0.
- padstack_name
- Returns:
- bool
Truewhen successful,Falsewhen 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:
- net
str Net name to filter padstack instances.
- net
- 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:
- name
str,optional Instance name.
- pid
int,optional Database ID.
- definition_name
strorlist,optional Padstack definition name(s).
- net_name
strorlist,optional Net name(s).
- component_reference_designator
strorlist,optional Component reference designator(s).
- component_pin
strorlist,optional Component pin number(s).
- name
- 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_pin
pyedb.grpc.database.primitive.padstack_instance.PadstackInstance Target pin.
- reference_net
str,optional Reference net name. Default is
"gnd".- search_radius
float,optional Search radius in meters. Default is
5e-3(5 mm).- max_limit
int,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.
- positive_pin
- 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.
- 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:
- points
tupleor list. bounding box, [x1, y1, x2, y2]
- nets
strorlist,optional net name of list of nets name applying filtering on padstack instances selection. If
Noneis provided all instances are included in the index. Default value isNone.- padstack_instances_index
optional,Rtreeobject. Can be provided optionally to prevent computing padstack instances Rtree index again.
- points
- 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
Noneis provided all instances are included in the index. Default value isNone.- 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_name
str Net name used for detected pad-stack instances. Default value is
"GND".- distance_threshold
float,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_number
int,optional The minimum number of points that a line must contain. Default is
6.- selected_angles
list[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_id
List[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.
- net_name
- Returns:
- 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_boxes
List[List[List[float,float]]] Nested list of polygon with points [x,y].
- net_filter
optional List[str: net_name] apply a net filter, nets included in the filter are excluded from the via merge.
- start_layer
optional,str Pad-stack instance start layer, if None the top layer is selected.
- stop_layer
optional,str Pad-stack instance stop layer, if None the bottom layer is selected.
- contour_boxes
- 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:
- Returns:
- bool
Truewhen succeededFalsewhen 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:
dictclusters {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:
- Returns: