Modeler#

class pyedb.dotnet.database.modeler.Modeler(p_edb)#

Manages EDB methods for primitives management accessible from Edb.modeler property.

Examples

>>> from pyedb import Edb
>>> edbapp = Edb("myaedbfolder", edbversion="2021.2")
>>> edb_layout = edbapp.modeler

Overview#

parametrize_polygon

Parametrize pieces of a polygon based on another polygon.

create_trace

Create a trace based on a list of points.

create_polygon

Create a polygon based on a list of points and voids.

create_rectangle

Create rectangle.

create_circle

Create a circle on a specified layer.

delete_primitives

Delete primitives by net names.

fix_circle_void_for_clipping

Fix issues when circle void are clipped due to a bug in EDB.

add_void

Add a void into a shape.

shape_to_polygon_data

Convert a shape to polygon data.

parametrize_trace_width

Parametrize a Trace on specific layer or all stackup.

unite_polygons_on_layer

Try to unite all Polygons on specified layer.

defeature_polygon

Defeature the polygon based on the maximum surface deviation criteria.

get_layout_statistics

Return EDBStatistics object from a layout.

create_bondwire

Create a bondwire object.

create_pin_group

Create a PinGroup.

get_primitive

Retrieve primitive from give id.

get_polygons_by_layer

Retrieve polygons by a layer.

get_primitive_by_layer_and_point

Return primitive given coordinate point [x, y], layer name and nets.

get_polygon_bounding_box

Retrieve a polygon bounding box.

get_polygon_points

Retrieve polygon points.

get_primitives

Get primitives by conditions.

primitives

Primitives.

db

Db object.

layers

Dictionary of layers.

polygons_by_layer

Primitives with layer names as keys.

primitives_by_net

Primitives with net names as keys.

primitives_by_layer

Primitives with layer names as keys.

rectangles

Rectangles.

circles

Circles.

paths

Paths.

polygons

Polygons.

clear_cache

Force reload of all primitives and reset indexes.

__getitem__

Get a layout instance from the Edb project.

Import detail#

from pyedb.dotnet.database.modeler import Modeler

Property detail#

property Modeler.primitives#

Primitives.

Deprecated since version 0.70.0: Use layout.primitives instead.

Returns:
list of pyedb.dotnet.database.edb_data.primitives_data.Primitive

List of primitives.

property Modeler.db#

Db object.

property Modeler.layers#

Dictionary of layers.

Deprecated since version 0.70.0.

use stackup.layers instead.

Returns:
dict

Dictionary of layers.

property Modeler.polygons_by_layer: dict[str, list[pyedb.dotnet.database.edb_data.primitives_data.EdbPolygon]]#

Primitives with layer names as keys.

Deprecated since version 0.70.0.

use layout.polygons_by_layer instead.

Returns:
dict

Dictionary of primitives with layer names as keys.

property Modeler.primitives_by_net: dict[str, pyedb.dotnet.database.edb_data.primitives_data.Primitive]#

Primitives with net names as keys.

Deprecated since version 0.70.0.

use layout.primitives_by_net instead.

Returns:
dict

Dictionary of primitives with nat names as keys.

property Modeler.primitives_by_layer: dict[str, list[pyedb.dotnet.database.edb_data.primitives_data.Primitive]]#

Primitives with layer names as keys.

Returns:
dict

Dictionary of primitives with layer names as keys.

property Modeler.rectangles: list[pyedb.dotnet.database.dotnet.primitive.RectangleDotNet]#

Rectangles.

Deprecated since version 0.70.0.

use layout.rectangles instead.

Returns:
list of pyedb.dotnet.database.edb_data.primitives_data.Primitive

List of rectangles.

property Modeler.circles: list[pyedb.dotnet.database.dotnet.primitive.CircleDotNet]#

Circles.

Deprecated since version 0.70.0.

use layout.circles instead.

Returns:
list of pyedb.dotnet.database.edb_data.primitives_data.Primitive

List of circles.

property Modeler.paths: list[pyedb.dotnet.database.dotnet.primitive.PathDotNet]#

Paths.

Deprecated since version 0.70.0.

use layout.paths instead.

Returns:
list of pyedb.dotnet.database.edb_data.primitives_data.Primitive

List of paths.

property Modeler.polygons: list[pyedb.dotnet.database.edb_data.primitives_data.EdbPolygon]#

Polygons.

Deprecated since version 0.70.0.

Returns:
list of pyedb.dotnet.database.edb_data.primitives_data.Primitive

List of polygons.

Method detail#

Modeler.__getitem__(name)#

Get a layout instance from the Edb project.

Parameters:
namestr, int
Returns:
pyedb.dotnet.database.cell.hierarchy.component.EDBComponent
Modeler.parametrize_polygon(polygon, selection_polygon, offset_name='offsetx', origin=None)#

Parametrize pieces of a polygon based on another polygon.

Parameters:
polygon

Name of the polygon.

selection_polygon

Polygon to use as a filter.

offset_namestr, optional

Name of the offset to create. The default is "offsetx".

originlist, optional

List of the X and Y origins, which impacts the vector computation and is needed to determine expansion direction. The default is None, in which case the vector is computed from the polygon’s center.

Returns:
bool

True when successful, False when failed.

Modeler.create_trace(path_list, layer_name, width=1, net_name='', start_cap_style='Round', end_cap_style='Round', corner_style='Round')#

Create a trace based on a list of points.

Parameters:
path_listlist

List of points.

layer_namestr

Name of the layer on which to create the path.

widthfloat, optional

Width of the path. The default is 1.

net_namestr, optional

Name of the net. The default is "".

start_cap_stylestr, optional

Style of the cap at its start. Options are "Round", "Extended", and "Flat". The default is "Round".

end_cap_stylestr, optional

Style of the cap at its end. Options are "Round", "Extended", and "Flat". The default is "Round".

corner_stylestr, optional

Style of the corner. Options are "Round", "Sharp" and "Mitered". The default is "Round".

Returns:
pyedb.dotnet.database.edb_data.primitives_data.Primitive
Modeler.create_polygon(points=None, layer_name='', voids=[], net_name='')#

Create a polygon based on a list of points and voids.

Parameters:
pointslist of points or PolygonData or modeler.Shape

Shape or point lists of the main object. Point list can be in the format of [[x1,y1], [x2,y2],..,[xn,yn]]. Each point can be: - [x, y] coordinate - [x, y, height] for an arc with specific height (between previous point and actual point) - [x, y, rotation, xc, yc] for an arc given a point, rotation and center.

layer_namestr

Name of the layer on which to create the polygon.

voidslist, optional

List of shape objects for voids or points that creates the shapes. The default is``[]``.

net_namestr, optional

Name of the net. The default is "".

Returns:
bool, dotnet.database.edb_data.primitives.Primitive

Polygon when successful, False when failed.

Modeler.create_rectangle(layer_name, net_name='', lower_left_point='', upper_right_point='', center_point='', width='', height='', representation_type='LowerLeftUpperRight', corner_radius='0mm', rotation='0deg')#

Create rectangle.

Parameters:
layer_namestr

Name of the layer on which to create the rectangle.

net_namestr

Name of the net. The default is "".

lower_left_pointlist

Lower left point when representation_type="LowerLeftUpperRight". The default is "".

upper_right_pointlist

Upper right point when representation_type="LowerLeftUpperRight". The default is "".

center_pointlist

Center point when representation_type="CenterWidthHeight". The default is "".

widthstr

Width of the rectangle when representation_type="CenterWidthHeight". The default is "".

heightstr

Height of the rectangle when representation_type="CenterWidthHeight". The default is "".

representation_typestr, optional

Type of the rectangle representation. The default is LowerLeftUpperRight. Options are "LowerLeftUpperRight" and "CenterWidthHeight".

corner_radiusstr, optional

Radius of the rectangle corner. The default is "0mm".

rotationstr, optional

Rotation of the rectangle. The default is "0deg".

Returns:
pyedb.dotnet.database.edb_data.primitives_data.Primitive

Rectangle when successful, False when failed.

Modeler.create_circle(layer_name, x, y, radius, net_name='')#

Create a circle on a specified layer.

Parameters:
layer_namestr

Name of the layer.

xfloat

Position on the X axis.

yfloat

Position on the Y axis.

radiusfloat

Radius of the circle.

net_namestr, optional

Name of the net. The default is None, in which case the default name is assigned.

Returns:
pyedb.dotnet.database.edb_data.primitives_data.Primitive

Objects of the circle created when successful.

Modeler.delete_primitives(net_names)#

Delete primitives by net names.

Parameters:
net_namesstr, list

Names of the nets to delete.

Returns:
bool

True when successful, False when failed.

References

>>> Edb.modeler.delete_primitives(net_names=["GND"])
Modeler.fix_circle_void_for_clipping()#

Fix issues when circle void are clipped due to a bug in EDB.

Returns:
bool

True when successful, False when no changes were applied.

Modeler.add_void(shape, void_shape)#

Add a void into a shape.

Parameters:
shapePolygon

Shape of the main object.

void_shapelist, Path

Shape of the voids.

Modeler.shape_to_polygon_data(shape)#

Convert a shape to polygon data.

Parameters:
shapepyedb.dotnet.database.modeler.Modeler.Shape

Type of the shape to convert. Options are "rectangle" and "polygon".

Modeler.parametrize_trace_width(nets_name, layers_name=None, parameter_name='trace_width', variable_value=None)#

Parametrize a Trace on specific layer or all stackup.

Parameters:
nets_namestr, list

name of the net or list of nets to parametrize.

layers_namestr, optional

name of the layer or list of layers to which the net to parametrize has to be included.

parameter_namestr, optional

name of the parameter to create.

variable_valuestr, float, optional

value with units of parameter to create. If None, the first trace width of Net will be used as parameter value.

Returns:
bool
Modeler.unite_polygons_on_layer(layer_name=None, delete_padstack_gemometries=False, net_names_list=None)#

Try to unite all Polygons on specified layer.

Parameters:
layer_namestr, optional

Name of layer name to unite objects on. The default is None, in which case all layers are taken.

delete_padstack_gemometriesbool, optional

Whether to delete all padstack geometries. The default is False.

net_names_listlist[str]optional

Net names list filter. The default is [], in which case all nets are taken.

Returns:
bool

True is successful.

Modeler.defeature_polygon(poly, tolerance=0.001)#

Defeature the polygon based on the maximum surface deviation criteria.

Parameters:
maximum_surface_deviationfloat
polyEdb Polygon primitive

Polygon to defeature.

tolerancefloat, optional

Maximum tolerance criteria. The default is 0.001.

Returns:
bool

True when successful, False when failed.

Modeler.get_layout_statistics(evaluate_area=False, net_list=False) pyedb.dotnet.database.edb_data.utilities.EDBStatistics#

Return EDBStatistics object from a layout.

Parameters:
evaluate_areaoptional bool

When True evaluates the layout metal surface, can take time-consuming, avoid using this option on large design.

net_list: optional bool

list of net names to evaluate area for, if None all nets will be evaluated.

Returns
——-
EDBStatistics object.
Modeler.create_bondwire(definition_name, placement_layer, width, material, start_layer_name, start_x, start_y, end_layer_name, end_x, end_y, net, bondwire_type='jedec4', start_cell_instance_name=None)#

Create a bondwire object.

Parameters:
bondwire_typeBondwireType

Type of bondwire: kAPDBondWire or kJDECBondWire types.

definition_namestr

Bondwire definition name.

placement_layerstr

Layer name this bondwire will be on.

widthValue

Bondwire width.

materialstr

Bondwire material name.

start_layer_namestr

Name of start layer.

start_xValue

X value of start point.

start_yValue

Y value of start point.

end_layer_namestr

Name of end layer.

end_xValue

X value of end point.

end_yValue

Y value of end point.

netstr or Net or None

Net of the Bondwire.

start_cell_instance_nameNone

Added for grpc compatibility.

Returns:
pyedb.dotnet.database.dotnet.primitive.BondwireDotNet

Bondwire object created.

Modeler.create_pin_group(name: str, pins_by_id=None, pins_by_aedt_name=None, pins_by_name=None)#

Create a PinGroup.

Parameters:
namestr

Name of the PinGroup.

pins_by_idlist[int] or None

List of pins by ID.

pins_by_aedt_namelist[str] or None

List of pins by AEDT name.

pins_by_namelist[str] or None

List of pins by name.

Modeler.get_primitive(primitive_id)#

Retrieve primitive from give id.

Deprecated since version 0.70.0.

use layout.find_object_by_id method instead.

Parameters:
primitive_idint

Primitive id.

Returns:
list of pyedb.dotnet.database.edb_data.primitives_data.Primitive

List of primitives.

Modeler.get_polygons_by_layer(layer_name, net_list=None) list[pyedb.dotnet.database.edb_data.primitives_data.EdbPolygon]#

Retrieve polygons by a layer.

Deprecated since version 0.70.0.

use layout.get_polygons_by_layer method instead.

Parameters:
layer_namestr

Name of the layer.

net_listlist, optional

List of net names.

Returns:
list of pyedb.dotnet.database.edb_data.primitives_data.Polygon
Modeler.get_primitive_by_layer_and_point(point=None, layer=None, nets=None)#

Return primitive given coordinate point [x, y], layer name and nets.

Deprecated since version 0.70.0.

use layout.get_primitive_by_layer_and_point method instead.

Parameters:
pointlist

Coordinate [x, y]

layerlist or str, optional

list of layer name or layer name applied on filter.

netslist or str, optional

list of net name or single net name applied on filter

Returns:
list of pyedb.dotnet.database.edb_data.primitives_data.Primitive

List of primitives, polygons, paths and rectangles.

Modeler.get_polygon_bounding_box(polygon)#

Retrieve a polygon bounding box.

Deprecated since version 0.70.0.

use layout.get_polygon_bounding_box method instead.

Parameters:
polygon

Name of the polygon.

Returns:
list

List of bounding box coordinates in the format [-x, -y, +x, +y].

Modeler.get_polygon_points(polygon) list[float]#

Retrieve polygon points.

Deprecated since version 0.70.0.

use layout.get_polygon_points method instead.

Modeler.get_primitives(net_name=None, layer_name=None, prim_type=None, is_void=False) list[pyedb.dotnet.database.edb_data.primitives_data.Primitive]#

Get primitives by conditions.

Deprecated since version 0.70.0.

use layout.filter_primitives method instead.

Parameters:
net_namestr, optional

Set filter on net_name. Default is None.

layer_namestr, optional

Set filter on layer_name. Default is None.

prim_typestr, optional

Set filter on primitive type. Default is None.

is_voidbool

Set filter on is_void. Default is ‘False'

Returns
——-
list

List of filtered primitives

static Modeler.clear_cache()#

Force reload of all primitives and reset indexes.

Classes#

Shape

Shape class.