FilterGridPoints


Select a subset of the given points that forms a grid.

Syntax

C++
C#
Python
 
def FilterGridPoints(
	inPoints: list[Point2D],
	/,
	*,
	inMaxAttempts: int | None = None,
	inMaxOutlierCount: int | None = None,
	inMinLength: float = 0.0,
	inMaxLength: float | None = 10.0,
	inMaxLengthRatio: float = 1.3,
	inAngleRange: float = 16.0,
	inBaseAspectRatioRange: float = 0.3,
	inBaseAspectRatio: float | None = 1.0,
	inBaseShear: float | None = 0.0,
	inBaseOrientation: float | None = None
)
-> (
	outPointGrid: list[Point2D],
	diagValidSubgraph: list[Segment2D],
	diagMaxLength: float
)

Parameters

Name Type Range Default Description
Input value inPoints list[Point2D]
Input value inMaxAttempts int | None 1 - None Maximum number of attempts at finding the grid
Input value inMaxOutlierCount int | None 0 - None Determines how many outlier points can be present to end the search
Input value inMinLength float 0.0 - 0.0 Minimum length of a grid segment
Input value inMaxLength float | None 0.0 - 10.0 Maximum length of a grid segment, if set to Auto it will be approximated
Input value inMaxLengthRatio float 1.0 - 2.0 1.3 Maximum ratio of two consecutive segments in the grid
Input value inAngleRange float 0.0 - 45.0 16.0 Maximum variation of angles between neighbouring grid segments in degrees
Input value inBaseAspectRatioRange float 0.0 - 1.0 0.3 Maximum variation of the base aspect ratio (ignores if base aspect ratio is not given)
Input value inBaseAspectRatio float | None 0.3 - 1.0 1.0 A reference aspect ratio of the grid
Input value inBaseShear float | None 0.0 - 60.0 0.0 A reference shear angle between grid directions that uses inMaxAngleRange as the maximum error range
Input value inBaseOrientation float | None 0.0 - 360.0 None A reference orientation of one of the grids directions
Output value outPointGrid list[Point2D] Detected grid
Diagnostic input diagValidSubgraph list[Segment2D] Graph forming a valid grid
Diagnostic input diagMaxLength float Max length computed by the filter (applicable if inMaxLength is set to Auto)