IDS peak ICV v1.1.0
Loading...
Searching...
No Matches
Polygon Class Reference

Public Member Functions

Polygon create_from_points (cls, Union[PointArray, np.ndarray] points)
 Creates an instance of Polygon using an array of Points or floats ( [[x,y],...] ).
 
None __init__ (self, *Any args, **Any kwargs)
 In order to create an empty Polygon create it with no arguments, in all other cases please refer to the classmethods.
 
Point __getitem__ (self, int index)
 Return a point at index.
 
PointArray points (self)
 Get the points of the polygon.
 
bool is_closed (self)
 Checks if a polygon is closed.
 
None __del__ (self)
 

Protected Attributes

PointArray|None _points = None
 
 _handle = peak_icv_polygon_handle(None)
 
 _point_type = None
 

Detailed Description

A polygon is a two-dimensional geometric shape that is made up of a finite number of straight line segments connected end-to-end to form an open or closed figure.

A polygon is represented by the points where the line segments meet.

Since
ids_peak_icv 1.1

Definition at line 23 of file polygon.py.

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self,
*Any args,
**Any kwargs )

In order to create an empty Polygon create it with no arguments, in all other cases please refer to the classmethods.

Since
ids_peak_icv 1.1

Definition at line 86 of file polygon.py.

◆ __del__()

None __del__ ( self)

Definition at line 171 of file polygon.py.

Member Function Documentation

◆ __getitem__()

Point __getitem__ ( self,
int index )

Return a point at index.

Since
ids_peak_icv 1.1

Definition at line 116 of file polygon.py.

◆ create_from_points()

Polygon create_from_points ( cls,
Union[PointArray, np.ndarray] points )

Creates an instance of Polygon using an array of Points or floats ( [[x,y],...] ).

Parameters
pointsArray of Points or floats
Returns
Returns a polygon instance.
Exceptions
NotPossibleExceptionIf the given points is not a numpy array of Points or floats.
MismatchExceptionIf one of the coordinates in the numpy array is not a float.
OutOfRangeExceptionIf one or more points in the numpy array are not two-dimensional.
Since
ids_peak_icv 1.1

Definition at line 35 of file polygon.py.

◆ is_closed()

bool is_closed ( self)

Checks if a polygon is closed.

A closed polygon contains the same point as first and last point.

Returns
True if closed, False if open.
Since
ids_peak_icv 1.1

Definition at line 156 of file polygon.py.

◆ points()

PointArray points ( self)

Get the points of the polygon.

Returns
List of Point objects representing the polygon's points.
Since
ids_peak_icv 1.1

Definition at line 126 of file polygon.py.

Field Documentation

◆ _handle

_handle = peak_icv_polygon_handle(None)
protected

Definition at line 96 of file polygon.py.

◆ _point_type

_point_type = None
protected

Definition at line 97 of file polygon.py.

◆ _points

_points = None
protected

Definition at line 95 of file polygon.py.