FitPathToPath
Rotates and shifts a path to minimize average distance between its points and a reference path.
Syntax
C++
C#
Python
def FitPathToPath( inPath: Path, inReferencePath: Path, outPath: Path, /, *, inPathOrientationAlignment: PathOrientationAlignment = PathOrientationAlignment.EllipticAxes, inIterations: int = 5, inFirstShift: float = 10.0, inFirstRotation: float = 10.0 ) -> ( outAlignment: CoordinateSystem2D, outPathDistance: float )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inPath | Path | Path to be aligned | ||
![]() |
inReferencePath | Path | Path to align to | ||
![]() |
inPathOrientationAlignment | PathOrientationAlignment | PathOrientationAlignment.EllipticAxes | Determines how to align paths orientation before the main algorithm | |
![]() |
inIterations | int | 1 - ![]() |
5 | Number of algorithm steps |
![]() |
inFirstShift | float | 10.0 | Magnitude of possible shift at the first step in pixels | |
![]() |
inFirstRotation | float | 10.0 | Magnitude of possible rotation at the first step in degrees | |
![]() |
outPath | Path | Aligned path | ||
![]() |
outAlignment | CoordinateSystem2D | The coordinate system that geometrical objects defined in the context of the path should be aligned to | ||
![]() |
outPathDistance | float | Average distance of characteristic points of the input path from the reference path |



