Skip to content

Polyline2D

Canonical path: NemAll_Python_Geometry.Polyline2D

Bases: PolyPoints2D

Representation class for 2D Polyline.

GetLine

GetLine(index: int) -> Line2D

Extract a line

Parameters:

  • index (int) –

    Index of the line

Returns:

  • Line2D

    Line from the index

GetLines

GetLines() -> Line2DList

Get all lines from this polyline

Returns:

IsValid

IsValid() -> bool

Check if the polygon is valid ( has at least 2 points )

For additional point validation use Service::Validate.

Returns:

  • bool

    true if is valid

LineCount

LineCount() -> int

Get the count of lines connecting the points

Returns:

  • int

    count of lines

Reverse

Reverse()

Reverse orientation of the Polyline

__eq__

__eq__(polyline2: Polyline2D) -> bool

Equal operator

Parameters:

Returns:

  • bool

    Polyline3D are equal

__iadd__ overloaded

__iadd__(polyline: Polyline2D) -> Polyline2D

Addition assignment operator

Parameters:

  • polyline (Polyline2D) –

    Polyline which will be added

Returns:

__iadd__(point: Point2D) -> Polyline2D

Addition assignment operator

Parameters:

  • point (Point2D) –

    New Point2D which will be added to the polyline

Returns:

__init__ overloaded

__init__()

Initialize

__init__(pntList: list)

Constructor with an initializer list

Parameters:

  • pntList (list) –

    Point list

__init__(polyline: Polyline2D)

Copy constructor.

Parameters:

  • polyline (Polyline2D) –

    Polyline which will be copied

__init__(points: Point2DList)

Vector points constructor.

Parameters:

  • points (Point2DList) –

    Vector of points which will be moved to polyline

__init__(polyline: Polyline2D, skip: int, count: int)

Copy constructor with limited scope

Parameters:

  • polyline (Polyline2D) –

    Polyline which will be copied

  • skip (int) –

    count of points ignored at start.

  • count (int) –

    count of points copied.

__init__(polygon: Polygon2D)

Constructor.

If polygon have two or more components, then constructor throw Geometry exception.

Parameters:

  • polygon (Polygon2D) –

    Polygon2D whose points and reference point will build the new polyline

__ne__

__ne__(polyline2: Polyline2D) -> bool

Not equal operator

Parameters:

Returns:

  • bool

    Polyline3D are equal

__repr__

__repr__() -> str

Convert to string

Placeholder