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 | |
|---|---|---|---|---|---|
![]() |
inPath | Path | Path to be segmented | ||
![]() |
inSmoothingStdDev | float | 0.0 - ![]() |
0 | Standard deviation used for initial gaussian smoothing of the segmented path |
![]() |
inMaxDeviation | float | 0.0 - ![]() |
0.5 | Maximal distance between any point of a classified segment to the abstract shape |
![]() |
inSegmentationMode | PathSegmentationMode | PathSegmentationMode.SegmentsAndArcs | Whether to use arcs for segmentation | |
![]() |
inMaxArcRadius | float | None | 0.0 - ![]() |
10.0 | Maximal radius of an arc fitted to segment |
![]() |
outStraight | list[Path] | Parts classified as straight segments | ||
![]() |
outArciform | list[Path] | Parts classified as arciform segments | ||
![]() |
outSegments | list[Segment2D] | Segments corresponding to sections of path from outStraight | ||
![]() |
outArcs | list[Arc2D] | Arcs corresponding to sections of path from outArciform |



