PolygonData#

class pyedb.dotnet.database.geometry.polygon_data.PolygonData(pedb: pyedb.dotnet.edb.Edb, edb_object: Any | None = None, create_from_points: Any | None = None, create_from_bounding_box: Any | None = None, **kwargs)#

Polygon Data.

Overview#

create_from_points

Create a polygon from a list of points.

create_from_bounding_box

Create a polygon from a bounding box defined by two corner points.

expand

Expand the polygon shape by an absolute value in all direction.

create_from_arcs

Edb Dotnet Api Database Edb.Geometry.CreateFromArcs.

is_inside

Determines whether a point is inside the polygon.

point_in_polygon

Determines whether a point is inside the polygon.

get_point

Gets the point at the index as a PointData object.

set_point

Sets the point at the index from a PointData object.

bounding_box

Bounding box.

arcs

Get the Primitive Arc Data.

points

Get all points in polygon.

points_without_arcs

Get all points in polygon without arcs.

area

Get the area of the polygon.

Import detail#

from pyedb.dotnet.database.geometry.polygon_data import PolygonData

Property detail#

property PolygonData.bounding_box: list[float]#

Bounding box.

Returns:
List[float]

List of coordinates for the component’s bounding box, with the list of coordinates in this order: [X lower left corner, Y lower left corner, X upper right corner, Y upper right corner].

property PolygonData.arcs: list[pyedb.dotnet.database.edb_data.primitives_data.EDBArcs]#

Get the Primitive Arc Data.

property PolygonData.points: list[tuple[float, float]]#

Get all points in polygon.

Returns:
list[tuple[float, float]]
property PolygonData.points_without_arcs: list[tuple[float, float]]#

Get all points in polygon without arcs.

property PolygonData.area: float#

Get the area of the polygon.

Method detail#

PolygonData.create_from_points(points: list[tuple[float, float]], closed: bool = True) Any#

Create a polygon from a list of points.

PolygonData.create_from_bounding_box(points: list[Any]) Any#

Create a polygon from a bounding box defined by two corner points.

PolygonData.expand(offset: float = 0.001, tolerance: float = 1e-12, round_corners: bool = True, maximum_corner_extension: float = 0.001) bool#

Expand the polygon shape by an absolute value in all direction.

Offset can be negative for negative expansion.

Parameters:
offsetfloat, optional

Offset value in meters.

tolerancefloat, 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_extensionfloat, optional

The maximum corner extension (when round corners are not used) at which point the corner is clipped.

PolygonData.create_from_arcs(arcs: list[Any], flag: bool) PolygonData#

Edb Dotnet Api Database Edb.Geometry.CreateFromArcs.

Parameters:
arcslist or Edb.Geometry.ArcData

List of ArcData.

flagbool
PolygonData.is_inside(x: str | float | list[Any], y: str | float | None = None) bool#

Determines whether a point is inside the polygon.

PolygonData.point_in_polygon(x: str | float | list[Any], y: str | float | None = None) bool#

Determines whether a point is inside the polygon.

..deprecated:: 0.48.0

Use: func:is_inside instead.

PolygonData.get_point(index: int) pyedb.dotnet.database.geometry.point_data.PointData#

Gets the point at the index as a PointData object.

PolygonData.set_point(index: int, point_data: pyedb.dotnet.database.geometry.point_data.PointData) None#

Sets the point at the index from a PointData object.