Header menu logo Euclid

Points2D Type

A type containing only static member functions for operating on multiple 2D points or set of 2D points. Aka point-clouds

Static members

Static member Description

Points2D.closestOfTwo pt1 pt2 referencePoint

Full Usage: Points2D.closestOfTwo pt1 pt2 referencePoint

Parameters:
    pt1 : Pt
    pt2 : Pt
    referencePoint : Pt

Returns: Pt

Returns the closest of two 2D points to a given reference 2D point. If both points are equidistant the first point is returned.

pt1 : Pt
pt2 : Pt
referencePoint : Pt
Returns: Pt

Points2D.closestPoint (pts, pt)

Full Usage: Points2D.closestPoint (pts, pt)

Parameters:
Returns: Pt

Returns the closest 2D point from a point list to a given 2D point.

pts : IList<Pt>
pt : Pt
Returns: Pt

Points2D.closestPointIdx (pts, pt)

Full Usage: Points2D.closestPointIdx (pts, pt)

Parameters:
Returns: int

Returns the closest 2D point index from a 2D point list to a given 2D point.

pts : IList<Pt>
pt : Pt
Returns: int

Points2D.closestPointsIdx (xs, ys)

Full Usage: Points2D.closestPointsIdx (xs, ys)

Parameters:
Returns: int * int

Returns the indices of the 2D points that are closest to each other.

xs : IList<Pt>
ys : IList<Pt>
Returns: int * int

Points2D.cullDuplicatePointsInSeq (pts, tolerance)

Full Usage: Points2D.cullDuplicatePointsInSeq (pts, tolerance)

Parameters:
    pts : ResizeArray<Pt>
    tolerance : float

Returns: ResizeArray<Pt>

Culls 2D points if they are too close to previous or next item. Last and first 2D points stay the same.

pts : ResizeArray<Pt>
tolerance : float
Returns: ResizeArray<Pt>

Points2D.findContinuousPoints (ptss, tolGap)

Full Usage: Points2D.findContinuousPoints (ptss, tolGap)

Parameters:
    ptss : ResizeArray<ResizeArray<Pt>>
    tolGap : float

Returns: ResizeArray<Pt>

Similar to join polylines, this tries to find continuous sequences of 2D points. 'tolGap' is the maximum allowable gap between the start and the endpoint of two segments. Search starts from the segment with the most points. Both start and end point of each 2D point list are checked for adjacency.

ptss : ResizeArray<ResizeArray<Pt>>
tolGap : float
Returns: ResizeArray<Pt>

Points2D.getSignedArea ps

Full Usage: Points2D.getSignedArea ps

Parameters:
Returns: float

The sign is negative if the loop is clockwise. Last and first point should be the same.

ps : IList<Pt>
Returns: float

Points2D.minDistBetweenPointSets (xs, ys)

Full Usage: Points2D.minDistBetweenPointSets (xs, ys)

Parameters:
Returns: float

Given two lists of 2D points finds the pair that are closest to each other and returns their distance.

xs : IList<Pt>
ys : IList<Pt>
Returns: float

Points2D.mostDistantPoint (findPointFrom, checkAgainst)

Full Usage: Points2D.mostDistantPoint (findPointFrom, checkAgainst)

Parameters:
Returns: Pt

Find the 2D point that has the biggest distance to any 2D point from another set.

findPointFrom : IList<Pt>
checkAgainst : IList<Pt>
Returns: Pt

Points2D.mostDistantPointIdx (findPointFrom, checkAgainst)

Full Usage: Points2D.mostDistantPointIdx (findPointFrom, checkAgainst)

Parameters:
Returns: int * int

Find the index of the 2D point that has the biggest distance to any 2D point from the other set. Basically the most lonely point in 'findPointFrom' list with respect to 'checkAgainst' list. Returns findPointFromIdx * checkAgainstIdx

findPointFrom : IList<Pt>
checkAgainst : IList<Pt>
Returns: int * int

Type something to start searching.