Polygon#
- class pyedb.grpc.database.primitive.polygon.Polygon(pedb, edb_object=None)#
Bases:
ansys.edb.core.primitive.polygon.Polygon,pyedb.grpc.database.primitive.primitive.PrimitiveRepresents a polygon object.
Overview#
Create a polygon in the specified layout, layer, and net using the provided polygon data. |
|
Delete polygon from layout. |
|
Remove self intersections if they exist. |
|
Duplicate polygon. |
|
Duplicate across layer a primitive object. |
|
Move polygon along a vector. |
|
Scales the polygon relative to a center point by a factor. |
|
Rotate polygon around a center point by an angle. |
|
Move polygon to given layer. |
|
Check if padstack Instance is in given polygon data. |
|
Add a void to the primitive. |
Primitive type. |
|
Check if Polygon has self intersections. |
Import detail#
from pyedb.grpc.database.primitive.polygon import Polygon
Property detail#
Method detail#
- Polygon.create(layout: pyedb.grpc.database.layout.layout.Layout = None, layer: str | pyedb.grpc.database.layers.layer.Layer = None, net: str | Net = None, polygon_data=None)#
Create a polygon in the specified layout, layer, and net using the provided polygon data.
- Parameters:
- layout
Layout,optional The layout in which the polygon will be created. If not provided, the active layout of the pedb instance will be used.
- layer
Union[str,Layer],optional The layer in which the polygon will be created. This parameter is required and must be specified.
- net
Union[str,Net],optional The net to which the polygon will belong. If not provided, the polygon will not be associated with a net.
- polygon_data
listorGrpcPolygonData,optional The data defining the polygon. This can be a list of points or an instance of GrpcPolygonData. This parameter is required and must be specified.
- layout
- Returns:
PolygonThe created polygon object.
- Raises:
ValueErrorIf the layer parameter is not provided.
ValueErrorIf the polygon_data parameter is not provided.
Notes
If polygon_data is provided as a list, it will be converted to a GrpcPolygonData object.
The created polygon is added to the modeler primitives of the pedb instance.
- Polygon.delete()#
Delete polygon from layout.
- Polygon.fix_self_intersections() list[any]#
Remove self intersections if they exist.
- Returns:
List[Polygon]All new polygons created from the removal operation.
- Polygon.clone()#
Duplicate polygon.
- Returns:
PolygonCloned polygon.
- Polygon.duplicate_across_layers(layers) bool#
Duplicate across layer a primitive object.
Parameters:
- layers: list
list of str, with layer names
- Returns:
- bool
Truewhen successful,Falsewhen failed.
- Polygon.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"])
- Polygon.rotate(angle, center=None) bool#
Rotate polygon around a center point by an angle.
- 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.rotate(angle=45)