Primitive#
- class pyedb.grpc.database.primitive.primitive.Primitive(pedb, core)#
Manages EDB functionalities for a primitives. It inherits EDB Object properties.
Examples
>>> from pyedb import Edb >>> edb = Edb("myedb", version="2026.1", grpc=True) >>> edb_prim = edb.layout.primitives[0]
Overview#
Get connected objects. |
|
Return the total area. |
|
Produce a list of all geometries physically connected to a given layout object. |
|
Convert path to polygon. |
|
Get intersection type between actual primitive and another primitive or polygon data. |
|
Check if actual primitive and another primitive or polygon data intesects. |
|
Get the closest point of the primitive to the input data. |
|
Rotate polygon around a center point by an angle. |
|
Move polygon along a vector. |
|
Scales the polygon relative to a center point by a factor. |
|
Subtract active primitive with one or more primitives. |
|
Intersect active primitive with one or more primitives. |
|
Unite active primitive with one or more primitives. |
|
Get the closest arc midpoint of the primitive to the input data. |
|
Add a void to current primitive. |
|
Return the list of points with arcs converted to segments. |
|
Return a list of Edb points. |
|
Expand the polygon shape by an absolute value in all direction. |
|
Plot the current polygon on matplotlib. |
|
Delete the primitive. |
Type of the primitive. |
|
Layout object. |
|
Polygon data. |
|
Layout object instance. |
|
Net name. |
|
Layer name. |
|
Primitive voids. |
|
Check if primitive has voids. |
|
Check if primitive is negative. |
|
Check if any primitive is parameterized. |
|
Check if primitive is a zone primitive. |
|
Check if primitive can be a zone primitive. |
|
Name to be visualized in AEDT. |
|
Return the primitive bounding box center coordinate. |
|
Return the primitive bounding box points. Lower left corner, upper right corner. |
|
Get the Primitive Arc Data. |
|
Longest arc. |
|
Longest arc. |
|
Primitive ID. This is the same as edb_uid, long Int. |
|
Primitive EDB UID. This is the same as id, long Int. |
|
Primitive type. |
|
Check if the primitive is a void. |
|
Check if the primitive is null. |
|
Get the layer object of the primitive. |
Import detail#
from pyedb.grpc.database.primitive.primitive import Primitive
Property detail#
- property Primitive.type: str#
Type of the primitive.
- Returns:
strPrimitive type. Options are
"circle","rectangle","polygon","path", or"bondwire".
- property Primitive.polygon_data#
Polygon data.
- Returns:
- property Primitive.object_instance#
Layout object instance.
- Returns:
LayoutObjInstance
- property Primitive.is_parameterized: bool#
Check if any primitive is parameterized.
- Returns:
- bool
True if any primitive is parameterized, False otherwise.
- property Primitive.is_zone_primitive: bool#
Check if primitive is a zone primitive.
- Returns:
- bool
True if primitive is a zone primitive, False otherwise.
- property Primitive.can_be_zone_primitive: bool#
Check if primitive can be a zone primitive.
- Returns:
- bool
True if primitive can be a zone primitive, False otherwise.
- property Primitive.center: tuple[float, float]#
Return the primitive bounding box center coordinate.
- Returns:
List[float][x, y]
- property Primitive.bbox: list[float]#
Return the primitive bounding box points. Lower left corner, upper right corner.
- Returns:
List[float][lower_left x, lower_left y, upper right x, upper right y]
- property Primitive.arcs#
Get the Primitive Arc Data.
- Returns:
ArcData
- property Primitive.id: int#
Primitive ID. This is the same as edb_uid, long Int.
- Returns:
intPrimitive ID.
- property Primitive.edb_uid: int#
Primitive EDB UID. This is the same as id, long Int.
- Returns:
intPrimitive EDB UID.
- property Primitive.primitive_type: str#
Primitive type.
- Returns:
strPrimitive type, such as “circle”, “rectangle”, “polygon”, “path” or “bondwire”.
- property Primitive.net: pyedb.grpc.database.net.net.Net#
- property Primitive.is_void#
Check if the primitive is a void.
- Returns:
- bool
Trueif the primitive is a void,Falseotherwise.
- property Primitive.is_null#
Check if the primitive is null.
- Returns:
- bool
Trueif the primitive is null,Falseotherwise.
- property Primitive.layer#
Get the layer object of the primitive.
- Returns:
LayerLayer object.
Attribute detail#
- Primitive.core#
Method detail#
- Primitive.get_connected_objects() list[Any]#
Get connected objects.
- Returns:
List[LayoutObjInstance]
- Primitive.get_connected_object_id_set() list[int]#
Produce a list of all geometries physically connected to a given layout object.
- Returns:
List[int]Found connected objects IDs with Layout object.
- Primitive.convert_to_polygon() pyedb.grpc.database.primitive.polygon.Polygon | bool#
Convert path to polygon.
- Returns:
PolygonPolygon when successful,
Falsewhen failed.
- Primitive.intersection_type(primitive) int#
Get intersection type between actual primitive and another primitive or polygon data.
- Parameters:
- primitive
Polygonor PolygonData
- primitive
- Returns:
intIntersection type: 0 - objects do not intersect, 1 - this object fully inside other (no common contour points), 2 - other object fully inside this, 3 - common contour points, 4 - undefined intersection.
- Primitive.is_intersecting(primitive) bool#
Check if actual primitive and another primitive or polygon data intesects.
- Parameters:
- primitive
Primitiveor PolygonData
- primitive
- Returns:
- Primitive.get_closest_point(point) list[float]#
Get the closest point of the primitive to the input data.
- Primitive.move(vector) bool#
Move polygon along a vector.
- Parameters:
- Returns:
- bool
Truewhen successful,Falsewhen failed.
Examples
>>> edbapp = ansys.aedt.core.Edb("myproject.aedb") >>> top_layer_polygon = [poly for poly in edbapp.modeler.polygons if poly.layer_name == "Top Layer"] >>> for polygon in top_layer_polygon: >>> polygon.move(vector=["2mm", "100um"])
- Primitive.scale(factor, center=None) bool#
Scales the polygon relative to a center point by a factor.
- Primitive.subtract(primitives) list[Any]#
Subtract active primitive with one or more primitives.
- Parameters:
- primitives
Primitives or: List[
Primitives] or: class:PolygonData
- primitives
- Returns:
List[Primitive]List of Primitive objects.
- Primitive.intersect(primitives) list[Any]#
Intersect active primitive with one or more primitives.
- Parameters:
- primitives :class:`Primitives
` - or: List[:class:`Primitives
`] - or: class:`PolygonData
`
- primitives :class:`Primitives
- Returns:
List[Primitive]List of Primitive objects.
- Primitive.unite(primitives) list[Any]#
Unite active primitive with one or more primitives.
- Parameters:
- primitives
Primitives - or: List[:class:`Primitives
`] - or: class:`PolygonData
`
- primitives
- Returns:
List[Primitive]List of Primitive objects.
- Primitive.get_closest_arc_midpoint(point) list[float]#
Get the closest arc midpoint of the primitive to the input data.
- Primitive.points(arc_segments=6) tuple[list[float], list[float]] | None#
Return the list of points with arcs converted to segments.
- Primitive.points_raw()#
Return a list of Edb points.
- Returns:
List[PointData]
- Primitive.expand(offset=0.001, tolerance=1e-12, round_corners=True, maximum_corner_extension=0.001) list[Any]#
Expand the polygon shape by an absolute value in all direction. Offset can be negative for negative expansion.
- Parameters:
- offset
float,optional Offset value in meters.
- tolerance
float,optional Tolerance in meters.
- round_cornersbool,
optional Whether to round corners or not. If True, use rounded corners in the expansion otherwise use straight edges (can be degenerate).
- maximum_corner_extension
float,optional The maximum corner extension (when round corners are not used) at which point the corner is clipped.
- offset
- Primitive.plot(plot_net=False, show=True, save_plot=None)#
Plot the current polygon on matplotlib.
- Primitive.delete()#
Delete the primitive.