SegmentPath


Splits a path into parts that can be approximated as segments or arcs.

Applications:Usually used to recognize a particular structure of an object contour or to guide a CNC machine.

Syntax

C++
C#
Python
 
def SegmentPath(
	inPath: Path,
	/,
	*,
	inSmoothingStdDev: float = 0,
	inMaxDeviation: float = 0.5,
	inSegmentationMode: PathSegmentationMode = PathSegmentationMode.SegmentsAndArcs,
	inMaxArcRadius: float | None = 10.0
)
-> (
	outStraight: list[Path],
	outArciform: list[Path],
	outSegments: list[Segment2D],
	outArcs: list[Arc2D]
)

Parameters

Name Type Range Default Description
Input value inPath Path Path to be segmented
Input value inSmoothingStdDev float 0.0 - 0 Standard deviation used for initial gaussian smoothing of the segmented path
Input value inMaxDeviation float 0.0 - 0.5 Maximal distance between any point of a classified segment to the abstract shape
Input value inSegmentationMode PathSegmentationMode PathSegmentationMode.SegmentsAndArcs Whether to use arcs for segmentation
Input value inMaxArcRadius float | None 0.0 - 10.0 Maximal radius of an arc fitted to segment
Output value outStraight list[Path] Parts classified as straight segments
Output value outArciform list[Path] Parts classified as arciform segments
Output value outSegments list[Segment2D] Segments corresponding to sections of path from outStraight
Output value outArcs list[Arc2D] Arcs corresponding to sections of path from outArciform