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
Input value inPath Path Path to be aligned
Input value inReferencePath Path Path to align to
Input value inPathOrientationAlignment PathOrientationAlignment PathOrientationAlignment.EllipticAxes Determines how to align paths orientation before the main algorithm
Input value inIterations int 1 - 5 Number of algorithm steps
Input value inFirstShift float 10.0 Magnitude of possible shift at the first step in pixels
Input value inFirstRotation float 10.0 Magnitude of possible rotation at the first step in degrees
Output value outPath Path Aligned path
Output value outAlignment CoordinateSystem2D The coordinate system that geometrical objects defined in the context of the path should be aligned to
Output value outPathDistance float Average distance of characteristic points of the input path from the reference path