Primitive#
- class pyedb.grpc.database.primitive.primitive.Primitive(pedb, edb_object)#
Bases:
ansys.edb.core.primitive.primitive.PrimitiveManages EDB functionalities for a primitives. It inherits EDB Object properties.
Examples
>>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_prim = edb.modeler.primitives[0] >>> edb_prim.is_void # Class Property >>> edb_prim.IsVoid() # EDB Object Property
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. |
|
Expand the polygon shape by an absolute value in all direction. |
|
Plot the current polygon on matplotlib. |
Type of the primitive. |
|
Polygon data. |
|
Layout object instance. |
|
Net name. |
|
Layer name. |
|
Primitive voids. |
|
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. |
|
Return a list of Edb points. |
Import detail#
from pyedb.grpc.database.primitive.primitive import Primitive
Property detail#
- property Primitive.type: str#
Type of the primitive.
Expected output is among
"Circle","Rectangle",``”Polygon”,”Path”`` or"Bondwire".- Returns:
- property Primitive.polygon_data#
Polygon data.
- Returns:
PolygonData
- property Primitive.object_instance#
Layout object instance.
- Returns:
LayoutObjInstance
- property Primitive.bbox: list[float]#
Return the primitive bounding box points. Lower left corner, upper right corner.
- property Primitive.arcs#
Get the Primitive Arc Data.
- Returns:
ArcData
- property Primitive.points_raw#
Return a list of Edb points.
- Returns:
List[PointData]
Method detail#
- Primitive.get_connected_objects()#
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()#
Convert path to polygon.
- Returns:
PolygonPolygon when successful,
Falsewhen failed.
- Primitive.intersection_type(primitive)#
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.
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[float, float]#
Return the list of points with arcs converted to segments.
- 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.