Skip to content

TransformCoord

Canonical path: NemAll_Python_Geometry.TransformCoord

This class offers functions to transform a world point into the local coordinate system (PointLocal) defined by a geometry object or a vector of objects. Functions named PointGlobal will take a local point and project its coordinates into world coordinates.

In other words: A local point holds the shortest distance from a real world point to an object in its y value. Its x value is calculated as the offset from the objects start point to the perpendicular point of the real world point.

PointGlobal overloaded

PointGlobal(path: Path2D, localPoint: Point2D, eps: float) -> tuple

Transform the local coordinates to world coordinates.

Parameters:

  • path (Path2D) –

    Path of 2D geometry objects

  • localPoint (Point2D) –

    Local point with offset as x and distance as y

  • eps (float) –

    Tolerance for clothoids and splines

Returns:

  • tuple

    Global point on the path,

true if the calculation was successful
PointGlobal(geoObject: object, offset: float, eps: float) -> tuple

Transform the local offset to world coordinates.

Parameters:

  • geoObject (object) –

    First IGeometry object

  • offset (float) –

    Distance from start point

  • eps (float) –

    Tolerance for clothoids and splines

Returns:

  • tuple

    Global point on the geometry,

true if the calculation was successful
PointGlobal(path: Path2D, offset: float, eps: float) -> tuple

Transform the local coordinates to world coordinates.

Parameters:

  • path (Path2D) –

    Path of 2D IGeometry objects

  • offset (float) –

    Distance from start point

  • eps (float) –

    Tolerance for clothoids and splines

Returns:

  • tuple

    Global point on the geometry,

true if the calculation was successful
PointGlobal(path: Path3D, offset: float, eps: float) -> tuple

Transform the local coordinates to world coordinates.

Parameters:

  • path (Path3D) –

    Path of 2D IGeometry objects

  • offset (float) –

    Distance from start point

  • eps (float) –

    Tolerance for clothoids and splines

Returns:

  • tuple

    Global point on the geometry,

true if the calculation was successful
PointGlobal(line: Line2D, offset: float) -> Point3D

Transform the local coordinates to world coordinates.

Parameters:

  • line (Line2D) –

    Line 2D

  • offset (float) –

    Distance from start point

Returns:

  • Point3D

    Global point on the 2D line

PointGlobal(line: Line2D, localPoint: Point2D) -> Point3D

Transform the local coordinates to world coordinates.

Parameters:

Returns:

  • Point3D

    Global point on the 2D line

PointGlobal(line: Line3D, offset: float) -> Point3D

Transform the local coordinates to world coordinates.

emarks If the object is a 3D line, the correct result would be a 3D circle around the line. In this case this function returns the intersection point between the circle and a plane. Where the plane is defined by the xy axis and the same z value as the circles center point.

    Args:
        line:   Line 3D
        offset: Distance from start point

    Returns:
         Global point on the 3D Line
PointGlobal(polygon: Polygon3D, offset: float) -> Point3D

Transform the local coordinates to world coordinates.

Parameters:

  • polygon (Polygon3D) –

    3D Polygon

  • offset (float) –

    Distance from start point

Returns:

  • Point3D

    Global point on the geometry

PointGlobal(polyline: Polyline2D, offset: float) -> Point3D

Transform the local coordinates to world coordinates.

Parameters:

  • polyline (Polyline2D) –

    2D Polyline

  • offset (float) –

    Distance from start point

Returns:

  • Point3D

    Global point on the geometry

PointGlobal(polyline: Polyline3D, offset: float) -> Point3D

Transform the local coordinates to world coordinates.

Parameters:

  • polyline (Polyline3D) –

    3D Polyline

  • offset (float) –

    Distance from start point

Returns:

  • Point3D

    Global point on the geometry

PointGlobal(polygon: Polygon2D, offset: float) -> Point3D

Transform the local coordinates to world coordinates.

Parameters:

  • polygon (Polygon2D) –

    2D Polygon

  • offset (float) –

    Distance from start point

Returns:

  • Point3D

    Global point on the geometry

PointGlobal(arc: Arc2D, offset: float) -> Point3D

Transform the local coordinates to world coordinates.

Parameters:

  • arc (Arc2D) –

    2D Arc

  • offset (float) –

    Distance from start point

Returns:

  • Point3D

    Global point on the geometry

PointGlobal(arc: Arc2D, localPoint: Point2D) -> Point3D

Transform the local coordinates to world coordinates.

Parameters:

  • arc (Arc2D) –

    2D Arc

  • localPoint (Point2D) –

    Local point

Returns:

  • Point3D

    Global point on the geometry

PointGlobal(arc: Arc3D, offset: float) -> Point3D

Transform the local coordinates to world coordinates.

Parameters:

  • arc (Arc3D) –

    3D Arc

  • offset (float) –

    Distance from start point

Returns:

  • Point3D

    Global point on the geometry

PointGlobal(arc: Arc3D, localPoint: Point2D) -> Point3D

Transform the local coordinates to world coordinates.

Parameters:

  • arc (Arc3D) –

    3D Arc

  • localPoint (Point2D) –

    Local point

Returns:

  • Point3D

    Global point on the geometry

PointGlobal(clothoid: Clothoid2D, offset: float, eps: float) -> tuple

Transform the local coordinates to world coordinates.

Parameters:

  • clothoid (Clothoid2D) –

    2D Clothoid

  • offset (float) –

    Distance from start point

  • eps (float) –

    Tolerance for clothoids and splines

Returns:

  • tuple

    Global point on the geometry,

true if the calculation was successful
PointGlobal(clothoid: Clothoid2D, localPoint: Point2D, eps: float) -> tuple

Transform the local coordinates to world coordinates.

Parameters:

  • clothoid (Clothoid2D) –

    2D Clothoid

  • localPoint (Point2D) –

    Local point

  • eps (float) –

    Tolerance for clothoids and splines

Returns:

  • tuple

    Global point on the geometry,

true if the calculation was successful
PointGlobal(spline: Spline2D, offset: float, eps: float) -> tuple

Transform the local coordinates to world coordinates.

emarks Due to restrictions in the old functions (splin7, splin2) local points with a x value smaller than 0 are treated as x=0. If the x value of the local point is bigger than the splines length, the length of the spline is uses as x value.

    Args:
        spline: 2D Spline
        offset: Distance from start point
        eps:    Tolerance for clothoids and splines

    Returns:
         Global point on the geometry,
        true if the calculation was successful
PointGlobal(spline: Spline2D, localPoint: Point2D, eps: float) -> tuple

Transform the local coordinates to world coordinates.

emarks Due to restrictions in the old functions (splin7, splin2) local points with a x value smaller than 0 are treated as x=0. If the x value of the local point is bigger than the splines length, the length of the spline is uses as x value.

    Args:
        spline:     2D Spline
        localPoint: Local Point
        eps:        Tolerance for clothoids and splines

    Returns:
         Global point on the geometry,
        true if the calculation was successful
PointGlobal(spline: Spline3D, offset: float, eps: float) -> tuple

Transform the local coordinates to world coordinates.

emarks Due to restrictions in the old functions (splin7, splin2) local points with a x value smaller than 0 are treated as x=0. If the x value of the local point is bigger than the splines length, the length of the spline is uses as x value.

    Args:
        spline: 3D Spline
        offset: Distance from start point
        eps:    Tolerance for clothoids and splines

    Returns:
         Global point on the geometry,
        true if the calculation was successful
PointGlobal(spline: Spline3D, localPoint: Point2D, eps: float) -> tuple

Transform the local coordinates to world coordinates.

emarks Due to restrictions in the old functions (splin7, splin2) local points with a x value smaller than 0 are treated as x=0. If the x value of the local point is bigger than the splines length, the length of the spline is uses as x value.

    Args:
        spline:     3D Spline
        localPoint: Local Point
        eps:        Tolerance for clothoids and splines

    Returns:
         Global point on the geometry,
        true if the calculation was successful
PointGlobal(spline: BSpline3D, offset: float) -> tuple

Transform the local coordinates to world coordinates.

Parameters:

  • spline (BSpline3D) –

    3D Spline

  • offset (float) –

    Distance from start point

Returns:

  • tuple

    Global point on the geometry,

true if the calculation was successful
PointGlobal(geoObject: object, localPoint: Point2D, eps: float) -> tuple

Transform the local coordinates to world coordinates.

Parameters:

  • geoObject (object) –

    Geometry object

  • localPoint (Point2D) –

    Local point with offset as x and distance as y

  • eps (float) –

    Tolerance for clothoids and splines

Returns:

  • tuple

    Global point on the geometry,

true if the calculation was successful

PointGlobalEx staticmethod

PointGlobalEx(clothoid: Clothoid2D, offset: float, eps: float) -> tuple

Transform the local coordinates to world coordinates.

This method compute global point by offset related to axis of clothoid (clothoid with parallel=0). This method is faster and computing global point with higher precision.

Use PointGlobalEx with PointLocalEx cooperation only.

sa PointLocalEx, TransformClothoidLocalOffset

Parameters:

  • clothoid (Clothoid2D) –

    2D Clothoid

  • offset (float) –

    Distance from start point on axis curve

  • eps (float) –

    Tolerance for clothoids and splines

Returns:

  • tuple

    Global point on the geometry by offset on axis curve,

Tangent at the Transformed point on the object,
Curvature at Transformed point on the object,
true if the calculation was successful

PointLocal overloaded

PointLocal(path: Path2D, inputPnt: Point3D, eps: float) -> tuple

Transform the local coordinates to world coordinates.

Parameters:

  • path (Path2D) –

    2D Path

  • inputPnt (Point3D) –

    Projection point

  • eps (float) –

    Tolerance for clothoids and splines

Returns:

  • tuple

    Local point on the path,

true if the calculation was successful
PointLocal(line: Line2D, inputPnt: Point3D) -> Point2D

Calculate the local coordinates on a 2D line

Parameters:

  • line (Line2D) –

    2D Line

  • inputPnt (Point3D) –

    3D Projection point

Returns:

  • Point2D

    Local point on the 2D line

PointLocal(line: Line2D, inputPnt: Point2D) -> Point2D

Calculate the local coordinates on a 2D line

Parameters:

  • line (Line2D) –

    2D Line

  • inputPnt (Point2D) –

    2D Projection point

Returns:

  • Point2D

    Local point on the 2D line

PointLocal(placement: AxisPlacement2D, inputPnt: Point3D) -> Point2D

Calculate the local coordinates on a 2D axis placement

Parameters:

Returns:

  • Point2D

    Local point on 2D axis placement

PointLocal(placement: AxisPlacement2D, inputPnt: Point2D) -> Point2D

Calculate the local coordinates on a 2D axis placement

Parameters:

Returns:

  • Point2D

    Local point on 2D axis placement

PointLocal(line: Line3D, inputPnt: Point3D) -> Point2D

Calculate the local coordinates on a 3D line

Parameters:

  • line (Line3D) –

    3D Line

  • inputPnt (Point3D) –

    Projection point

Returns:

  • Point2D

    Local point on the 3D line

PointLocal(polyhedron: Polyhedron3D, inputPnt: Point3D) -> Point2D

Calculate the local coordinates on a 3D polyhedron

Parameters:

Returns:

  • Point2D

    Local point on the 3D polyhedron

PointLocal(polyline: Polyline3D, inputPnt: Point3D) -> Point2D

Calculate the local coordinates on a 3D polyline

Parameters:

Returns:

  • Point2D

    Local point on the 3D polyline

PointLocal(polyline: Polyline2D, inputPnt: Point3D) -> Point2D

Calculate the local coordinates on a 2D polyline

Parameters:

Returns:

  • Point2D

    Local point on the polyline

PointLocal(polyline: Polyline2D, inputPnt: Point2D) -> Point2D

Calculate the local coordinates on a 2D polyline

Parameters:

Returns:

  • Point2D

    Local point on the polyline

PointLocal(polygon: Polygon2D, inputPnt: Point3D) -> Point2D

Calculate the local coordinates on a 2D polygon

Parameters:

Returns:

  • Point2D

    Local point on the polygon

PointLocal(arc: Arc2D, inputPnt: Point3D) -> Point2D

Calculate the local coordinates on a 2D arc

Parameters:

  • arc (Arc2D) –

    2D Arc

  • inputPnt (Point3D) –

    3D Projection point

Returns:

  • Point2D

    Local point on the 2D arc

PointLocal(arc: Arc2D, inputPnt: Point2D) -> Point2D

Calculate the local coordinates on a 2D arc

Parameters:

  • arc (Arc2D) –

    2D Arc

  • inputPnt (Point2D) –

    2D Projection point

Returns:

  • Point2D

    Local point on the 2D arc

PointLocal(arc: Arc3D, inputPnt: Point3D) -> Point2D

Calculate the local coordinates on a 3D arc

Parameters:

  • arc (Arc3D) –

    3D Arc

  • inputPnt (Point3D) –

    3D Projection point

Returns:

  • Point2D

    Local point on the 3D arc

PointLocal(arc: Arc3D, inputPnt: Point2D) -> Point2D

Calculate the local coordinates on a 3D arc

Parameters:

  • arc (Arc3D) –

    3D Arc

  • inputPnt (Point2D) –

    3D Projection point

Returns:

  • Point2D

    Local point on the 3D arc

PointLocal(clothoid: Clothoid2D, inputPnt: Point2D, eps: float) -> tuple

Calculate the local coordinates on a 2D clothoid

Parameters:

  • clothoid (Clothoid2D) –

    2D Clothoid

  • inputPnt (Point2D) –

    Projection point as Point2D

  • eps (float) –

    Tolerance

Returns:

  • tuple

    Local point on the 2D clothoid,

true if the calculation was successful
PointLocal(clothoid: Clothoid2D, inputPnt: Point3D, eps: float) -> tuple

Calculate the local coordinates on a 2D clothoid

Parameters:

  • clothoid (Clothoid2D) –

    2D Clothoid

  • inputPnt (Point3D) –

    Projection point as Point3D

  • eps (float) –

    Tolerance

Returns:

  • tuple

    Local point on the 2D clothoid,

true if the calculation was successful
PointLocal(spline: Spline2D, inputPnt: Point2D, eps: float) -> tuple

Calculate the local coordinates on a 2D spline

emarks The old functions (splin7, splin2) can't process points which have no perpendicular point on the spline

    Args:
        spline:   2D Spline
        inputPnt: Projection point as Point2D
        eps:      Tolerance

    Returns:
         Local point on the 2D spline,
        true if the calculation was successful
PointLocal(spline: Spline2D, inputPnt: Point3D, eps: float) -> tuple

Calculate the local coordinates on a 2D spline

emarks The old functions (splin7, splin2) can't process points which have no perpendicular point on the spline

    Args:
        spline:   2D Spline
        inputPnt: Projection point as Point3D
        eps:      Tolerance

    Returns:
         Local point on the 2D spline,
        true if the calculation was successful
PointLocal(spline: Spline3D, inputPnt: Point2D, eps: float) -> tuple

Calculate the local coordinates on a 3D spline

emarks The old functions (splin7, splin2) can't process points which have no perpendicular point on the spline

    Args:
        spline:   3D Spline
        inputPnt: Projection point as Point2D
        eps:      Tolerance

    Returns:
         Local point on the 3D spline,
        true if the calculation was successful
PointLocal(spline: Spline3D, inputPnt: Point3D, eps: float) -> tuple

Calculate the local coordinates on a 3D spline

emarks The old functions (splin7, splin2) can't process points which have no perpendicular point on the spline

    Args:
        spline:   3D Spline
        inputPnt: Projection point as Point3D
        eps:      Tolerance

    Returns:
         Local point on the 3D spline,
        true if the calculation was successful
PointLocal(geoObject: object, inputPnt: Point3D, eps: float) -> tuple

Calculate the local coordinates on a 2D geometry object.

Parameters:

  • geoObject (object) –

    First IGeometry object

  • inputPnt (Point3D) –

    Projection point

  • eps (float) –

    Tolerance for clothoids and splines

Returns:

  • tuple

    Local point on the geometry,

true if the calculation was successful

PointLocalEx staticmethod

PointLocalEx(clothoid: Clothoid2D, inputPnt: Point2D, eps: float) -> tuple

Calculate the local coordinates on a 2D clothoid

PointLocalEx compute local point related to axis of clothoid (clothoid with parallel=0). This method is faster and computing X coordinate with higher precision.

Use PointGlobalEx with PointLocalEx cooperation only.

PointGlobalEx, TransformClothoidLocalOffset

Parameters:

  • clothoid (Clothoid2D) –

    2D Clothoid

  • inputPnt (Point2D) –

    Projection point as Point2D

  • eps (float) –

    Tolerance

Returns:

  • tuple

    Axis local point on the 2D clothoid,

true if the calculation was successful

TransformClothoidLocalOffset staticmethod

TransformClothoidLocalOffset(
    clothoid: Clothoid2D, offset: float, toAxis: bool
) -> float

Transform local offset between clothoid axis curve and parallel curve

This function provides transformation between offset related to axis or parallel(real) curve. This function is useful when you have offset on parallel curve and want to get length of axis curve. If clothoid parameter Parallel is zero, then axis and parallel offsets are equal.

Sample: calc real length of clothoid ndouble real_length = Service::Length(clot); double curve_length = TransformClothoidLocalOffset(clot, clot.Getlength(), false);

real_length and curve_length are equal.

Parameters:

  • clothoid (Clothoid2D) –

    2D Clothoid

  • offset (float) –

    Source offset

  • toAxis (bool) –

    If true, then offset is offset on parallel curve and result will be offset on axis curve.

Returns:

  • float

    Offset on axis or parallel curve, dependent on toAxis.

Placeholder