FitSegmentToPoints_RANSAC
Approximates points with a segment using a RANSAC algorithm.
Applications:Finds a well matching segments, but for handling outliers requires a distance threshold that may be difficult to set.
Syntax
C++
C#
Python
def FitSegmentToPoints_RANSAC( inPoints: list[Point2D], /, *, inRange: Range | None = None, inMaxOutlierCount: int | None = 0, inMaxInlierDistance: float = 3.0, inIterationCount: int | None = 42 ) -> outSegment: Segment2D | None
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inPoints | list[Point2D] | |||
![]() |
inRange | Range | None | None | Determines which array points take part in fitting process | |
![]() |
inMaxOutlierCount | int | None | 0 - ![]() |
0 | Determines how many outlier points can be present to end the search |
![]() |
inMaxInlierDistance | float | 0.0 - ![]() |
3.0 | Distance from the output segment for a point to be considered an inlier |
![]() |
inIterationCount | int | None | 1 - ![]() |
42 | Number of iterations; Auto means that all point pairs will be used |
![]() |
outSegment | Segment2D | None |



