Skip to content

Path2D

Class full path: NemAll_Python_Geometry.Path2D

Bases: Path

Representation class for 2D path.

Attributes

EndPoint: Point2D property writable

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: Point2D property writable

Get path start point

Throw THROW_GEO_EXCEPTION_OUT_OF_RANGE_ if path is empty Throw THROW_GEO_EXCEPTION_GENERAL_ERROR_ if internal error

Functions

Add overload

Add(element)

Add element into path Path2D

Parameters:

Name Type Description Default
element Path2D

Path element to add

required

Returns:

Type Description
eGeometryErrorCode

error code

Add(element_object)

Add element into path Path2D

Parameters:

Name Type Description Default
element_object object

Pointer to element to add

required

Returns:

Type Description
eGeometryErrorCode

error code

GetEndPoint()

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:

Type Description
Point2D

const Point2D End point

GetEndRelPoint()

Get relative end (last) point of the path

Returns:

Type Description
Point2D

End point (relative)

GetStartPoint()

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:

Type Description
Point2D

const Point2D Start point

GetStartRelPoint()

Get relative start (first) point of the path

Returns:

Type Description
Point2D

Start point (relative)

IsClosed()

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

Returns:

Type Description
bool

True when path is closed, otherwise false.

IsItPossibleToAddElement(pGeometry_object)

Check if the geometry can be added into path Path2D

Parameters:

Name Type Description Default
pGeometry_object object

Pointer to geometry to check

required

IsValid()

Validity check

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

IsValidCurveType(pGeometry_object) staticmethod

Check if the geometry is supported by Path2D

Parameters:

Name Type Description Default
pGeometry_object object

Pointer to geometry to check

required

SetEndPoint(endpoint)

Set end (last) point of the path

Parameters:

Name Type Description Default
endpoint Point2D

E point

required

Returns:

Type Description

none

SetStartPoint(startpoint)

Set start (first) point of the path

Parameters:

Name Type Description Default
startpoint Point2D

Start point

required

Returns:

Type Description

none

__eq__(path)

Comparison of paths without tolerance.

Be careful, this method work without tolerance!

Parameters:

Name Type Description Default
path Path2D

Compared path.

required

Returns:

Type Description
object

True when paths are equal, otherwise false.

__iadd__ overload

__iadd__(element)

Append operator

Parameters:

Name Type Description Default
element Path2D

Element which will be appended

required

Returns:

Type Description
Path2D

Reference to path.

__iadd__(element)

Append operator

Parameters:

Name Type Description Default
element Line2D

Element which will be appended

required
__iadd__(element)

Append operator

Parameters:

Name Type Description Default
element Polyline2D

Element which will be appended

required
__iadd__(element)

Append operator

Parameters:

Name Type Description Default
element Spline2D

Element which will be appended

required
__iadd__(element)

Append operator

Parameters:

Name Type Description Default
element Clothoid2D

Element which will be appended

required
__iadd__(element)

Append operator

Parameters:

Name Type Description Default
element Arc2D

Element which will be appended

required

__init__ overload

__init__()

Initialize

__init__(path)

Copy constructor

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

Parameters:

Name Type Description Default
path Path2D

Path which will be copied.

required

__repr__()

Convert to string