Skip to content

Path2D

Canonical path: NemAll_Python_Geometry.Path2D

Bases: Path

Representation class for 2D path.

Methods:

  • Add

    dummy, is only needed for the creation of the documentation by MkDocs

  • GetEndPoint

    Get path end point

  • GetEndRelPoint

    Get relative end (last) point of the path

  • GetStartPoint

    Get path start point

  • GetStartRelPoint

    Get relative start (first) point of the path

  • IsClosed

    Check for closed path, it mean that first point is same as last point

  • IsItPossibleToAddElement

    Check if the geometry can be added into path Path2D

  • IsValid

    Validity check

  • IsValidCurveType

    Check if the geometry is supported by Path2D

  • SetEndPoint

    Set end (last) point of the path

  • SetStartPoint

    Set start (first) point of the path

  • __eq__

    Comparison of paths without tolerance.

  • __iadd__

    dummy, is only needed for the creation of the documentation by MkDocs

  • __init__

    dummy, is only needed for the creation of the documentation by MkDocs

  • __repr__

    Convert to string

Attributes:

EndPoint property writable

EndPoint: Point2D

Get path end point

Throw THROW_GEO_EXCEPTION_OUT_OF_RANGE_ if path is empty Throw THROW_GEO_EXCEPTION_GENERAL_ERROR_ if internal error

StartPoint property writable

StartPoint: Point2D

Get path start point

Throw THROW_GEO_EXCEPTION_OUT_OF_RANGE_ if path is empty Throw THROW_GEO_EXCEPTION_GENERAL_ERROR_ if internal error

Add overloaded

Add(element: Path2D) -> eGeometryErrorCode

Add element into path Path2D

Parameters:

  • element (Path2D) –

    Path element to add

Returns:

Add(element_object: object) -> eGeometryErrorCode

Add element into path Path2D

Parameters:

  • element_object (object) –

    Pointer to element to add

Returns:

GetEndPoint

GetEndPoint() -> Point2D

Get path end point

Throw THROW_GEO_EXCEPTION_OUT_OF_RANGE_ if path is empty Throw THROW_GEO_EXCEPTION_GENERAL_ERROR_ if internal error

Returns:

  • Point2D

    const Point2D End point

GetEndRelPoint

GetEndRelPoint() -> Point2D

Get relative end (last) point of the path

Returns:

GetStartPoint

GetStartPoint() -> Point2D

Get path start point

Throw THROW_GEO_EXCEPTION_OUT_OF_RANGE_ if path is empty Throw THROW_GEO_EXCEPTION_GENERAL_ERROR_ if internal error

Returns:

  • Point2D

    const Point2D Start point

GetStartRelPoint

GetStartRelPoint() -> Point2D

Get relative start (first) point of the path

Returns:

  • Point2D

    Start point (relative)

IsClosed

IsClosed() -> bool

Check for closed path, it mean that first point is same as last point

Returns:

  • bool

    True when path is closed, otherwise false.

IsItPossibleToAddElement

IsItPossibleToAddElement(pGeometry_object: object) -> bool

Check if the geometry can be added into path Path2D

Parameters:

  • pGeometry_object (object) –

    Pointer to geometry to check

IsValid

IsValid() -> bool

Validity check

\warning Path doesn't have to be closed to be valid, you have to check this extra

IsValidCurveType staticmethod

IsValidCurveType(pGeometry_object: object) -> bool

Check if the geometry is supported by Path2D

Parameters:

  • pGeometry_object (object) –

    Pointer to geometry to check

SetEndPoint

SetEndPoint(endpoint: Point2D)

Set end (last) point of the path

Parameters:

Returns:

  • none

SetStartPoint

SetStartPoint(startpoint: Point2D)

Set start (first) point of the path

Parameters:

  • startpoint (Point2D) –

    Start point

Returns:

  • none

__eq__

__eq__(path: Path2D) -> object

Comparison of paths without tolerance.

Be careful, this method work without tolerance!

Parameters:

  • path (Path2D) –

    Compared path.

Returns:

  • object

    True when paths are equal, otherwise false.

__iadd__ overloaded

__iadd__(element: Path2D) -> Path2D

Append operator

Parameters:

  • element (Path2D) –

    Element which will be appended

Returns:

  • Path2D

    Reference to path.

__iadd__(element: Line2D) -> Path2D

Append operator

Parameters:

  • element (Line2D) –

    Element which will be appended

__iadd__(element: Polyline2D) -> Path2D

Append operator

Parameters:

  • element (Polyline2D) –

    Element which will be appended

__iadd__(element: Spline2D) -> Path2D

Append operator

Parameters:

  • element (Spline2D) –

    Element which will be appended

__iadd__(element: Clothoid2D) -> Path2D

Append operator

Parameters:

  • element (Clothoid2D) –

    Element which will be appended

__iadd__(element: Arc2D) -> Path2D

Append operator

Parameters:

  • element (Arc2D) –

    Element which will be appended

__init__ overloaded

__init__()

Initialize

__init__(path: Path2D)

Copy constructor

Copy constructor is expensive because all data are cloned in new path.

Parameters:

  • path (Path2D) –

    Path which will be copied.

__repr__

__repr__() -> str

Convert to string