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
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
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(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(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
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
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
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
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
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(placement: AxisPlacement2D, inputPnt: Point3D) -> Point2D
Calculate the local coordinates on a 2D axis placement
Parameters:
-
placement
(AxisPlacement2D
) –2D axis placement
-
inputPnt
(Point3D
) –2D Projection point
Returns:
-
Point2D
–Local point on 2D axis placement
PointLocal(placement: AxisPlacement2D, inputPnt: Point2D) -> Point2D
Calculate the local coordinates on a 2D axis placement
Parameters:
-
placement
(AxisPlacement2D
) –2D axis placement
-
inputPnt
(Point2D
) –2D Projection point
Returns:
-
Point2D
–Local point on 2D axis placement
PointLocal(polyhedron: Polyhedron3D, inputPnt: Point3D) -> Point2D
Calculate the local coordinates on a 3D polyhedron
Parameters:
-
polyhedron
(Polyhedron3D
) –3D Polyhedron
-
inputPnt
(Point3D
) –Projection point
Returns:
-
Point2D
–Local point on the 3D polyhedron
PointLocal(polyline: Polyline3D, inputPnt: Point3D) -> Point2D
Calculate the local coordinates on a 3D polyline
Parameters:
-
polyline
(Polyline3D
) –3D Polyline
-
inputPnt
(Point3D
) –Projection point
Returns:
-
Point2D
–Local point on the 3D polyline
PointLocal(polyline: Polyline2D, inputPnt: Point3D) -> Point2D
Calculate the local coordinates on a 2D polyline
Parameters:
-
polyline
(Polyline2D
) –2D Polyline
-
inputPnt
(Point3D
) –Projection point
Returns:
-
Point2D
–Local point on the polyline
PointLocal(polyline: Polyline2D, inputPnt: Point2D) -> Point2D
Calculate the local coordinates on a 2D polyline
Parameters:
-
polyline
(Polyline2D
) –2D Polyline
-
inputPnt
(Point2D
) –Projection point
Returns:
-
Point2D
–Local point on the polyline
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
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
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
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
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
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.