PolygonData#
- class pyedb.grpc.database.geometry.polygon_data.PolygonData(edb_object=None, create_from_points=None, create_from_circle=None, create_from_rectangle=None, create_from_bounding_box=None, **kwargs)#
Class managing Polygon Data.
Overview#
Create PolygonData from point list. |
Get the bounding circle of the polygon. |
|
Check if polygon is inside. |
|
Check if the polygon has self-intersections. |
|
Expand the polygon shape by an absolute value in all direction. |
|
Create union of polygons. |
|
Get area of polygon. |
|
Get intersection type of polygon. |
Bounding box. |
|
Get the Primitive Arc Data. |
|
Check if polygon is closed. |
|
Get the polygon sense type. |
|
Get all holes in polygon. |
|
Get all points in polygon. |
|
Get all points in polygon. |
|
Get all arc data in polygon. |
Import detail#
from pyedb.grpc.database.geometry.polygon_data import PolygonData
Property detail#
- property PolygonData.arcs: list[pyedb.grpc.database.geometry.arc_data.ArcData]#
Get the Primitive Arc Data.
- Returns:
List[ArcData]
- property PolygonData.sense: any#
Get the polygon sense type.
- Returns:
- class:
PolygonSenseType
..
- property PolygonData.holes#
Get all holes in polygon.
- Returns:
Method detail#
- PolygonData.bounding_circle() tuple[tuple[float, float], float]#
Get the bounding circle of the polygon.
- classmethod PolygonData.create_from_points(points, closed=True)#
- classmethod PolygonData.create_from_bounding_box(points) ansys.edb.core.geometry.polygon_data.PolygonData#
Create PolygonData from point list.
- Returns:
- PolygonData.has_self_intersections(tolerance=1e-12) bool#
Check if the polygon has self-intersections.
- PolygonData.expand(offset=0.001, tolerance=1e-12, round_corners=True, maximum_corner_extension=0.001) bool#
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
- Returns:
- PolygonData.unite(polygons)#
Create union of polygons.
- Parameters:
- polygons
list[PolygonData] List of PolygonData objects to unite with the current polygon.
- polygons
- Returns:
- PolygonData.intersection_type(polygon_data)#
Get intersection type of polygon.
- Returns:
- class:
PolygonIntersectionType
..
Returnedvaluecanbeoneofthefollowing:0 : No Intersection
1 : Current Polygon Inside Other
2: Other polygon Inside Current
3: Common intersection
4: undifined intersection