Modeler#
- class pyedb.dotnet.database.modeler.Modeler(p_edb)#
Bases:
objectManages 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#
Retrieve primitive from give id. |
|
Retrieve polygons by a layer. |
|
Return primitive given coordinate point [x, y], layer name and nets. |
|
Retrieve a polygon bounding box. |
|
Retrieve polygon points. |
|
Parametrize pieces of a polygon based on another polygon. |
|
Create a trace based on a list of points. |
|
Create a polygon based on a list of points and voids. |
|
Create a new polygon from a point list. |
|
Create rectangle. |
|
Create a circle on a specified layer. |
|
Delete primitives by net names. |
|
Get primitives by conditions. |
|
Fix issues when circle void are clipped due to a bug in EDB. |
|
Add a void into a shape. |
|
Convert a shape to polygon data. |
|
Parametrize a Trace on specific layer or all stackup. |
|
Try to unite all Polygons on specified layer. |
|
Defeature the polygon based on the maximum surface deviation criteria. |
|
Return EDBStatistics object from a layout. |
|
Create a bondwire object. |
|
Create a PinGroup. |
Db object. |
|
Dictionary of layers. |
|
Primitives. |
|
Primitives with layer names as keys. |
|
Primitives with net names as keys. |
|
Primitives with layer names as keys. |
|
Rectangles. |
|
Circles. |
|
Paths. |
|
Polygons. |
Get a layout instance from the Edb project. |
Import detail#
from pyedb.dotnet.database.modeler import Modeler
Property detail#
- property Modeler.db#
Db object.
- property Modeler.primitives#
Primitives.
- Returns:
listofpyedb.dotnet.database.edb_data.primitives_data.PrimitiveList of primitives.
- property Modeler.polygons_by_layer#
Primitives with layer names as keys.
- Returns:
dictDictionary of primitives with layer names as keys.
- property Modeler.primitives_by_net#
Primitives with net names as keys.
- Returns:
dictDictionary of primitives with nat names as keys.
- property Modeler.primitives_by_layer#
Primitives with layer names as keys.
- Returns:
dictDictionary of primitives with layer names as keys.
- property Modeler.rectangles#
Rectangles.
- Returns:
listofpyedb.dotnet.database.edb_data.primitives_data.PrimitiveList of rectangles.
- property Modeler.circles#
Circles.
- Returns:
listofpyedb.dotnet.database.edb_data.primitives_data.PrimitiveList of circles.
Method detail#
- Modeler.__getitem__(name)#
Get a layout instance from the Edb project.
- Parameters:
- Returns:
- Modeler.get_primitive(primitive_id)#
Retrieve primitive from give id.
- Modeler.get_polygons_by_layer(layer_name, net_list=None)#
Retrieve polygons by a layer.
- Modeler.get_primitive_by_layer_and_point(point=None, layer=None, nets=None)#
Return primitive given coordinate point [x, y], layer name and nets.
- Parameters:
- Returns:
listofpyedb.dotnet.database.edb_data.primitives_data.PrimitiveList of primitives, polygons, paths and rectangles.
- Modeler.get_polygon_bounding_box(polygon)#
Retrieve a polygon bounding box.
- Parameters:
- polygon
Name of the polygon.
- Returns:
listList of bounding box coordinates in the format
[-x, -y, +x, +y].
Examples
>>> poly = database.modeler.get_polygons_by_layer("GND") >>> bounding = database.modeler.get_polygon_bounding_box(poly[0])
- Modeler.get_polygon_points(polygon)#
Retrieve polygon points.
Note
For arcs, one point is returned.
- Parameters:
- polygon
class: dotnet.database.edb_data.primitives_data.Primitive
- Returns:
list- List of tuples. Each tuple provides x, y point coordinate. If the length of two consecutives tuples
from the list equals 2, a segment is defined. The first tuple defines the starting point while the second tuple the ending one. If the length of one tuple equals one, that means a polyline is defined and the value is giving the arc height. Therefore to polyline is defined as starting point for the tuple before in the list, the current one the arc height and the tuple after the polyline ending point.
Examples
>>> poly = database.modeler.get_polygons_by_layer("GND") >>> points = database.modeler.get_polygon_points(poly[0])
- 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_name
str,optional Name of the offset to create. The default is
"offsetx".- origin
list,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
Truewhen successful,Falsewhen 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_list
list List of points.
- layer_name
str Name of the layer on which to create the path.
- width
float,optional Width of the path. The default is
1.- net_name
str,optional Name of the net. The default is
"".- start_cap_style
str,optional Style of the cap at its start. Options are
"Round","Extended",and"Flat". The default is"Round".- end_cap_style
str,optional Style of the cap at its end. Options are
"Round","Extended",and"Flat". The default is"Round".- corner_style
str,optional Style of the corner. Options are
"Round","Sharp"and"Mitered". The default is"Round".
- path_list
- Returns:
pyedb.dotnet.database.edb_data.primitives_data.Primitive
- Modeler.create_polygon(main_shape=None, layer_name='', voids=[], net_name='', points=None)#
Create a polygon based on a list of points and voids.
- Parameters:
- main_shape
listofpointsorPolygonDataormodeler.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_name
str Name of the layer on which to create the polygon.
- voids
list,optional List of shape objects for voids or points that creates the shapes. The default is``[]``.
- net_name
str,optional Name of the net. The default is
"".- points
list,optional Added for compatibility with grpc.
- main_shape
- Returns:
- bool,
dotnet.database.edb_data.primitives.Primitive Polygon when successful,
Falsewhen failed.
- bool,
- Modeler.create_polygon_from_points(point_list, layer_name, net_name='')#
Create a new polygon from a point list.
Deprecated since version 0.6.73.
Use
create_polygon()method instead. It now supports point lists as arguments.- Parameters:
- point_list
list Point list 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_name
str Name of layer on which create the polygon.
- net_name
str,optional Name of the net on which create the polygon.
- point_list
- Returns:
pyedb.dotnet.database.edb_data.primitives_data.Primitive
- 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_name
str Name of the layer on which to create the rectangle.
- net_name
str Name of the net. The default is
"".- lower_left_point
list Lower left point when
representation_type="LowerLeftUpperRight". The default is"".- upper_right_point
list Upper right point when
representation_type="LowerLeftUpperRight". The default is"".- center_point
list Center point when
representation_type="CenterWidthHeight". The default is"".- width
str Width of the rectangle when
representation_type="CenterWidthHeight". The default is"".- height
str Height of the rectangle when
representation_type="CenterWidthHeight". The default is"".- representation_type
str,optional Type of the rectangle representation. The default is
LowerLeftUpperRight. Options are"LowerLeftUpperRight"and"CenterWidthHeight".- corner_radius
str,optional Radius of the rectangle corner. The default is
"0mm".- rotation
str,optional Rotation of the rectangle. The default is
"0deg".
- layer_name
- Returns:
pyedb.dotnet.database.edb_data.primitives_data.PrimitiveRectangle when successful,
Falsewhen failed.
- Modeler.create_circle(layer_name, x, y, radius, net_name='')#
Create a circle on a specified layer.
- Parameters:
- Returns:
pyedb.dotnet.database.edb_data.primitives_data.PrimitiveObjects of the circle created when successful.
- Modeler.delete_primitives(net_names)#
Delete primitives by net names.
- Parameters:
- Returns:
- bool
Truewhen successful,Falsewhen failed.
References
>>> Edb.modeler.delete_primitives(net_names=["GND"])
- Modeler.get_primitives(net_name=None, layer_name=None, prim_type=None, is_void=False)#
Get primitives by conditions.
- Parameters:
- Modeler.fix_circle_void_for_clipping()#
Fix issues when circle void are clipped due to a bug in EDB.
- Returns:
- bool
Truewhen successful,Falsewhen no changes were applied.
- Modeler.add_void(shape, void_shape)#
Add a void into a shape.
- Parameters:
- shape
Polygon Shape of the main object.
- void_shape
list,Path Shape of the voids.
- shape
- Modeler.shape_to_polygon_data(shape)#
Convert a shape to polygon data.
- Parameters:
- shape
pyedb.dotnet.database.modeler.Modeler.Shape Type of the shape to convert. Options are
"rectangle"and"polygon".
- shape
- 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_name
str,list name of the net or list of nets to parametrize.
- layers_name
str,optional name of the layer or list of layers to which the net to parametrize has to be included.
- parameter_name
str,optional name of the parameter to create.
- variable_value
str,float,optional value with units of parameter to create. If None, the first trace width of Net will be used as parameter value.
- nets_name
- Returns:
- 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_name
str,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_list
list[str]optional Net names list filter. The default is
[], in which case all nets are taken.
- layer_name
- Returns:
- bool
Trueis successful.
- Modeler.defeature_polygon(poly, tolerance=0.001)#
Defeature the polygon based on the maximum surface deviation criteria.
- Modeler.get_layout_statistics(evaluate_area=False, net_list=None)#
Return EDBStatistics object from a layout.
- Parameters:
- evaluate_area
optionalbool When True evaluates the layout metal surface, can take time-consuming, avoid using this option on large design.
- evaluate_area
- Returns:
EDBStatisticsobject.
- 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_type
BondwireType Type of bondwire: kAPDBondWire or kJDECBondWire types.
- definition_name
str Bondwire definition name.
- placement_layer
str Layer name this bondwire will be on.
- width
Value Bondwire width.
- material
str Bondwire material name.
- start_layer_name
str Name of start layer.
- start_x
Value X value of start point.
- start_y
Value Y value of start point.
- end_layer_name
str Name of end layer.
- end_x
Value X value of end point.
- end_y
Value Y value of end point.
- net
strorNetorNone Net of the Bondwire.
- start_cell_instance_name
None Added for grpc compatibility.
- bondwire_type
- Returns:
pyedb.dotnet.database.dotnet.primitive.BondwireDotNetBondwire object created.
Classes#
Shape class. |