CfgModeler#

class pyedb.configuration.cfg_modeler.CfgModeler(pedb=None, data: dict | None = None)#

Collect geometry and modeler operations for serialization.

Overview#

add_trace

Add a trace to the modeler configuration.

add_rectangular_plane

Add a rectangular copper plane.

add_circular_plane

Add a circular copper plane.

add_polygon_plane

Add a polygon copper plane.

delete_primitives_by_layer

Schedule all primitives on the given layers for deletion.

delete_primitives_by_name

Schedule primitives with the given names for deletion.

delete_primitives_by_net

Schedule all primitives on the given nets for deletion.

to_dict

Serialize modeler configuration to a plain dictionary.

Import detail#

from pyedb.configuration.cfg_modeler import CfgModeler

Attribute detail#

CfgModeler.traces = []#
CfgModeler.planes = []#
CfgModeler.padstack_defs#
CfgModeler.padstack_instances#
CfgModeler.components#
CfgModeler.primitives_to_delete: dict[str, list[str]]#

Method detail#

CfgModeler.add_trace(name: str, layer: str, width: str, net_name: str = '', start_cap_style: str = 'round', end_cap_style: str = 'round', corner_style: str = 'sharp', path: list[list[float | int | str]] | None = None, incremental_path: list[list[float | int | str]] | None = None)#

Add a trace to the modeler configuration.

Exactly one of path or incremental_path should be supplied.

Parameters:
namestr

AEDT name assigned to the created trace primitive.

layerstr

Layer name on which to create the trace, e.g. "1_Top".

widthstr

Trace width including units, e.g. "0.1mm" or "100um".

net_namestr, optional

Net the trace belongs to, e.g. "SIG". Default is "".

start_cap_stylestr, optional

Start-cap termination style. Accepted values: "round" (default), "extended", "flat".

end_cap_stylestr, optional

End-cap termination style. Same options as start_cap_style. Default is "round".

corner_stylestr, optional

Corner bend style. Accepted values: "sharp" (default), "round", "mitered".

pathlist of [x, y], optional

Ordered list of absolute [x, y] waypoints in metres that define the trace route, e.g. [[0, 0], [0.01, 0], [0.01, 0.005]]. Use this when absolute coordinates are known.

incremental_pathlist of [x, y], optional

Ordered list of [x, y] waypoints where the first point is absolute and subsequent points are added incrementally via pyedb.modeler.Path.add_point(). Use this for step-by-step construction. Mutually exclusive with path.

Returns:
CfgTrace

The newly created trace descriptor object.

Examples

Absolute path:

>>> cfg.modeler.add_trace(
...     name="trace_clk",
...     layer="1_Top",
...     width="0.1mm",
...     net_name="CLK",
...     path=[[0.0, 0.0], [0.005, 0.0], [0.005, 0.003]],
... )

Incremental path:

>>> cfg.modeler.add_trace(
...     name="trace_sig",
...     layer="1_Top",
...     width="0.1mm",
...     net_name="SIG",
...     incremental_path=[[0.0, 0.0], [0.005, 0.0]],
... )
CfgModeler.add_rectangular_plane(layer: str, name: str = '', net_name: str = '', lower_left_point: list[float | int] | None = None, upper_right_point: list[float | int] | None = None, corner_radius: float = 0, rotation: float | int = 0, voids: list | None = None)#

Add a rectangular copper plane.

Parameters:
layerstr

Layer name on which to create the rectangle.

namestr, optional

Primitive AEDT name.

net_namestr, optional

Net name for the plane.

lower_left_pointlist of float, optional

[x, y] lower-left corner in metres.

upper_right_pointlist of float, optional

[x, y] upper-right corner in metres.

corner_radiusfloat, optional

Corner rounding radius. Default is 0.

rotationfloat, optional

Rotation in degrees. Default is 0.

voidslist, optional

Void cutout descriptors.

Returns:
CfgPlane

The newly created plane object.

Examples

>>> cfg.modeler.add_rectangular_plane(
...     "bot",
...     "gnd_plane",
...     "GND",
...     lower_left_point=[-0.05, -0.05],
...     upper_right_point=[0.05, 0.05],
... )
CfgModeler.add_circular_plane(layer: str, name: str = '', net_name: str = '', corner_radius: float | int = 0, rotation: float | int = 0, voids: list | None = None, radius: float | int | str = 0, position: list[float | int | str] | None = None)#

Add a circular copper plane.

Parameters:
layerstr

Layer on which to place the circle.

namestr, optional

Primitive AEDT name.

net_namestr, optional

Net name.

corner_radiusfloat, optional

Unused for circles; kept for API symmetry. Default is 0.

rotationfloat, optional

Rotation in degrees. Default is 0.

voidslist, optional

Void cutout descriptors.

radiusfloat or str, optional

Circle radius, e.g. "1mm". Default is 0.

positionlist of float, optional

[x, y] centre position in metres. Default is [0, 0].

Returns:
CfgPlane

The newly created plane object.

CfgModeler.add_polygon_plane(layer: str, name: str = '', net_name: str = '', corner_radius: float | int = 0, rotation: float | int = 0, voids: list | None = None, points: list[list[float | int]] | None = None)#

Add a polygon copper plane.

Parameters:
layerstr

Layer on which to place the polygon.

namestr, optional

Primitive AEDT name.

net_namestr, optional

Net name.

corner_radiusfloat, optional

Corner rounding radius. Default is 0.

rotationfloat, optional

Rotation in degrees. Default is 0.

voidslist, optional

Void cutout descriptors.

pointslist of list of float, optional

Ordered [x, y] vertex coordinates in metres.

Returns:
CfgPlane

The newly created plane object.

Examples

>>> cfg.modeler.add_polygon_plane(
...     "top",
...     "sig_poly",
...     "SIG",
...     points=[[0, 0], [0.01, 0], [0.01, 0.005], [0, 0.005]],
... )
CfgModeler.delete_primitives_by_layer(layer_names: list[str])#

Schedule all primitives on the given layers for deletion.

CfgModeler.delete_primitives_by_name(primitive_names: list[str])#

Schedule primitives with the given names for deletion.

CfgModeler.delete_primitives_by_net(net_names: list[str])#

Schedule all primitives on the given nets for deletion.

CfgModeler.to_dict() dict#

Serialize modeler configuration to a plain dictionary.