Header menu logo Euclid

Points Type

Provides operations on 2D and 3D points.

Static members

Static member Description

Points.areInLine (a, b, c, ?distanceTolerance)

Full Usage: Points.areInLine (a, b, c, ?distanceTolerance)

Parameters:
    a : Pnt
    b : Pnt
    c : Pnt
    ?distanceTolerance : float

Returns: bool

Checks if three points are in one line. With a maximum deviation of the given distance tolerance. 1e-6 by default. Fails if any of the points are closer than the given distance tolerance to each other.

a : Pnt
b : Pnt
c : Pnt
?distanceTolerance : float
Returns: bool

Points.areInLineFast (a, b, c, ?maxSquareAreaParallelogram)

Full Usage: Points.areInLineFast (a, b, c, ?maxSquareAreaParallelogram)

Parameters:
    a : Pnt
    b : Pnt
    c : Pnt
    ?maxSquareAreaParallelogram : float

Returns: bool
Modifiers: inline

Checks if three points are in one line. This is a very fast check, but it is hard to find an appropriate tolerance. (Default is 0.001) This tolerance is the square area of the parallelogram described by two vectors created from the 3 points. So it also returns true if the points are equal or very close to each other. Returns false for NaN input values. See Points.areInLine function too.

a : Pnt
b : Pnt
c : Pnt
?maxSquareAreaParallelogram : float
Returns: bool

Points.areaTriangle (a, b, c)

Full Usage: Points.areaTriangle (a, b, c)

Parameters:
Returns: float
Modifiers: inline

Returns the area of a triangle described by 3 points.

a : Pnt
b : Pnt
c : Pnt
Returns: float

Points.areaTriangleDoubleSq (a, b, c)

Full Usage: Points.areaTriangleDoubleSq (a, b, c)

Parameters:
Returns: float
Modifiers: inline

Returns the double square area of a triangle. This is the fastest way to get a comparison or sorting value for the area of a triangle. This is just the square length of the Cross Product vector. The length of a Cross Product vector is equal to the area of the parallelogram described by the two input vectors.

a : Pnt
b : Pnt
c : Pnt
Returns: float

Points.center pts

Full Usage: Points.center pts

Parameters:
    pts : ResizeArray<Pnt>

Returns: Pnt

Finds the center, mean or average point.

pts : ResizeArray<Pnt>
Returns: Pnt

Points.closestPoint (pts, pt)

Full Usage: Points.closestPoint (pts, pt)

Parameters:
    pts : ResizeArray<Pt>
    pt : Pt

Returns: Pt

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

pts : ResizeArray<Pt>
pt : Pt
Returns: Pt

Points.closestPoint (pts, pt)

Full Usage: Points.closestPoint (pts, pt)

Parameters:
    pts : ResizeArray<Pnt>
    pt : Pnt

Returns: Pnt

Returns the closest point form a 3D point list to a given 3D point.

pts : ResizeArray<Pnt>
pt : Pnt
Returns: Pnt

Points.closestPointIdx (pts, pt)

Full Usage: Points.closestPointIdx (pts, pt)

Parameters:
    pts : ResizeArray<Pt>
    pt : Pt

Returns: int

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

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

Points.closestPointIdx (pts, pt)

Full Usage: Points.closestPointIdx (pts, pt)

Parameters:
    pts : ResizeArray<Pnt>
    pt : Pnt

Returns: int

Returns the closest 3D point index form a 3D point list to a given 3D point.

pts : ResizeArray<Pnt>
pt : Pnt
Returns: int

Points.closestPointsIdx (xs, ys)

Full Usage: Points.closestPointsIdx (xs, ys)

Parameters:
    xs : ResizeArray<Pt>
    ys : ResizeArray<Pt>

Returns: int * int

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

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

Points.closestPointsIdx (xs, ys)

Full Usage: Points.closestPointsIdx (xs, ys)

Parameters:
    xs : ResizeArray<Pnt>
    ys : ResizeArray<Pnt>

Returns: int * int

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

xs : ResizeArray<Pnt>
ys : ResizeArray<Pnt>
Returns: int * int

Points.cullDuplicatePointsInSeq (pts, tolerance)

Full Usage: Points.cullDuplicatePointsInSeq (pts, tolerance)

Parameters:
    pts : ResizeArray<Pt>
    tolerance : float

Returns: ResizeArray<Pt>

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

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

Points.cullDuplicatePointsInSeq (pts, tolerance)

Full Usage: Points.cullDuplicatePointsInSeq (pts, tolerance)

Parameters:
    pts : ResizeArray<Pnt>
    tolerance : float

Returns: ResizeArray<Pnt>

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

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

Points.findContinuosPoints (ptss, tolGap)

Full Usage: Points.findContinuosPoints (ptss, tolGap)

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

Returns: ResizeArray<Pnt>

Similar to Join Polylines this tries to find continuos sequences of 3D points. 'tolGap' is the maximum allowable gap between the start and the endpoint of to segments. Search starts from the segment with the most points. Both start and end point of each 3D point list is checked for adjacency.

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

Points.findContinuosPoints (ptss, tolGap)

Full Usage: Points.findContinuosPoints (ptss, tolGap)

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

Returns: ResizeArray<Pt>

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

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

Points.getSignedArea ps

Full Usage: Points.getSignedArea ps

Parameters:
    ps : ResizeArray<Pt>

Returns: float

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

ps : ResizeArray<Pt>
Returns: float

Points.minDistBetweenPointSets (xs, ys)

Full Usage: Points.minDistBetweenPointSets (xs, ys)

Parameters:
    xs : ResizeArray<Pt>
    ys : ResizeArray<Pt>

Returns: float

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

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

Points.minDistBetweenPointSets (xs, ys)

Full Usage: Points.minDistBetweenPointSets (xs, ys)

Parameters:
    xs : ResizeArray<Pnt>
    ys : ResizeArray<Pnt>

Returns: float

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

xs : ResizeArray<Pnt>
ys : ResizeArray<Pnt>
Returns: float

Points.mostDistantPoint (findPointFrom, checkAgainst)

Full Usage: Points.mostDistantPoint (findPointFrom, checkAgainst)

Parameters:
    findPointFrom : ResizeArray<Pt>
    checkAgainst : ResizeArray<Pt>

Returns: Pt

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

findPointFrom : ResizeArray<Pt>
checkAgainst : ResizeArray<Pt>
Returns: Pt

Points.mostDistantPoint (findPointFrom, checkAgainst)

Full Usage: Points.mostDistantPoint (findPointFrom, checkAgainst)

Parameters:
    findPointFrom : ResizeArray<Pnt>
    checkAgainst : ResizeArray<Pnt>

Returns: Pnt

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

findPointFrom : ResizeArray<Pnt>
checkAgainst : ResizeArray<Pnt>
Returns: Pnt

Points.mostDistantPointIdx (findPointFrom, checkAgainst)

Full Usage: Points.mostDistantPointIdx (findPointFrom, checkAgainst)

Parameters:
    findPointFrom : ResizeArray<Pt>
    checkAgainst : ResizeArray<Pt>

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 : ResizeArray<Pt>
checkAgainst : ResizeArray<Pt>
Returns: int * int

Points.mostDistantPointIdx (findPointFrom, checkAgainst)

Full Usage: Points.mostDistantPointIdx (findPointFrom, checkAgainst)

Parameters:
    findPointFrom : ResizeArray<Pnt>
    checkAgainst : ResizeArray<Pnt>

Returns: int * int

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

findPointFrom : ResizeArray<Pnt>
checkAgainst : ResizeArray<Pnt>
Returns: int * int

Points.normalOfPoints pts

Full Usage: Points.normalOfPoints pts

Parameters:
Returns: Vec

Finds the mean normal of many points. It finds the center point and then takes cross-products iterating all points in pairs of two. The first three points define the orientation of the normal. So it considers the current order of points too. If the order is counterclockwise in the World X-Y plane then the normal is in world Z orientation.

pts : Pnt[]
Returns: Vec

Points.normalOfPoints pts

Full Usage: Points.normalOfPoints pts

Parameters:
    pts : ResizeArray<Pnt>

Returns: Vec

Finds the mean normal of many points. It finds the center point and then takes cross-products iterating all points in pairs of two. The first three points define the orientation of the normal. So it considers the current order of points too. If the order is counterclockwise in the World X-Y plane then the normal is in world Z orientation.

pts : ResizeArray<Pnt>
Returns: Vec

Points.offsetInCorner (prevPt, thisPt, nextPt, prevDist, nextDist)

Full Usage: Points.offsetInCorner (prevPt, thisPt, nextPt, prevDist, nextDist)

Parameters:
    prevPt : Pnt
    thisPt : Pnt
    nextPt : Pnt
    prevDist : float
    nextDist : float

Returns: ValueOption<Pnt>

It finds the inner offset point in a corner (defined by a Polyline from 3 points (prevPt, thisPt and nextPt) The offset from first and second segment are given separately and can vary (prevDist and nextDist). Use negative distance for outer offset. If Points are collinear by 0.25 degrees or less than 1-e6 units apart returns: ValueNone. Use negative distances to get outside offset.

prevPt : Pnt
thisPt : Pnt
nextPt : Pnt
prevDist : float
nextDist : float
Returns: ValueOption<Pnt>

Points.offsetInCorner (thisPt, prevToThis, thisToNext, prevDist, nextDist)

Full Usage: Points.offsetInCorner (thisPt, prevToThis, thisToNext, prevDist, nextDist)

Parameters:
    thisPt : Pnt
    prevToThis : Vec
    thisToNext : Vec
    prevDist : float
    nextDist : float

Returns: ValueOption<Pnt>

It finds the inner offset point in a corner (defined a point, a previous vector to this point and a next vector from this point) The offset from first and second segment are given separately and can vary (prevDist and nextDist). Use negative distance for outer offset. If Points are collinear by 0.25 degrees or less than 1-e6 units apart returns: ValueNone. Use negative distances to get outside offset.

thisPt : Pnt
prevToThis : Vec
thisToNext : Vec
prevDist : float
nextDist : float
Returns: ValueOption<Pnt>

Points.offsetInCornerEx (prevPt, thisPt, nextPt, prevDist, nextDist, referenceNormal)

Full Usage: Points.offsetInCornerEx (prevPt, thisPt, nextPt, prevDist, nextDist, referenceNormal)

Parameters:
    prevPt : Pnt
    thisPt : Pnt
    nextPt : Pnt
    prevDist : float
    nextDist : float
    referenceNormal : Vec

Returns: ValueOption<Pnt * UnitVec * Vec * Vec>

It finds the inner offset point in a corner (defined by a Polyline from 3 points (prevPt, thisPt and nextPt) The offset from first and second segment are given separately and can vary (prevDist and nextDist). Use negative distance for outer offset. If Points are collinear by 0.25 degrees or less than 1-e6 units apart returns: ValueNone. Use negative distances to get outside offset. The 'referenceNormal' is' An approximate orientation Normal to help find the correct offset side, To be in Z Axis orientation for Counter-Clockwise loops in 2D. Returns the offset point, the unitized normal vector aligned with the referenceNormal, the shift direction for prev and next line.

prevPt : Pnt
thisPt : Pnt
nextPt : Pnt
prevDist : float
nextDist : float
referenceNormal : Vec
Returns: ValueOption<Pnt * UnitVec * Vec * Vec>

Points.offsetInCornerEx (thisPt, prevToThis, thisToNext, prevDist, nextDist, referenceNormal)

Full Usage: Points.offsetInCornerEx (thisPt, prevToThis, thisToNext, prevDist, nextDist, referenceNormal)

Parameters:
    thisPt : Pnt
    prevToThis : Vec
    thisToNext : Vec
    prevDist : float
    nextDist : float
    referenceNormal : Vec

Returns: ValueOption<Pnt * UnitVec * Vec * Vec>

It finds the inner offset point in a corner (defined a point, a previous vector to this point and a next vector from this point) The offset from first and second segment are given separately and can vary (prevDist and nextDist). Use negative distance for outer offset. If Points are collinear by 0.25 degrees or less than 1-e6 units apart returns: ValueNone. Use negative distances to get outside offset. The 'referenceNormal' is' An approximate orientation Normal to help find the correct offset side, To be in Z Axis orientation for Counter-Clockwise loops in 2D. Returns the offset point, the unitized normal vector aligned with the referenceNormal, the shift direction for prev and next line.

thisPt : Pnt
prevToThis : Vec
thisToNext : Vec
prevDist : float
nextDist : float
referenceNormal : Vec
Returns: ValueOption<Pnt * UnitVec * Vec * Vec>

Points.offsetInCornerEx2D (prevPt, thisPt, nextPt, prevDist, nextDist, referenceOrient)

Full Usage: Points.offsetInCornerEx2D (prevPt, thisPt, nextPt, prevDist, nextDist, referenceOrient)

Parameters:
    prevPt : Pt
    thisPt : Pt
    nextPt : Pt
    prevDist : float
    nextDist : float
    referenceOrient : float

Returns: ValueOption<Pt * Vc * Vc>

It finds the inner offset point in a corner (defined by a Polyline from 3 points (prevPt, thisPt and nextPt) The offset from first and second segment are given separately and can vary (prevDist and nextDist). Use negative distance for outer offset. If Points are collinear by 0.25 degrees or less than 1-e6 units apart returns: ValueNone. Use negative distances to get outside offset. 'referenceOrient' is positive for counterclockwise loops otherwise negative. Returns the offset point, the shift direction for prev and next line.

prevPt : Pt
thisPt : Pt
nextPt : Pt
prevDist : float
nextDist : float
referenceOrient : float
Returns: ValueOption<Pt * Vc * Vc>

Points.offsetInCornerEx2D (thisPt, prevToThis, thisToNext, prevDist, nextDist, referenceOrient)

Full Usage: Points.offsetInCornerEx2D (thisPt, prevToThis, thisToNext, prevDist, nextDist, referenceOrient)

Parameters:
    thisPt : Pt
    prevToThis : Vc
    thisToNext : Vc
    prevDist : float
    nextDist : float
    referenceOrient : float

Returns: ValueOption<Pt * Vc * Vc>

It finds the inner offset point in a corner (defined a point, a previous vector to this point and a next vector from this point) The offset from first and second segment are given separately and can vary (prevDist and nextDist). Use negative distance for outer offset. If Points are collinear by 0.25 degrees or less than 1-e6 units apart returns: ValueNone. Use negative distances to get outside offset. 'referenceOrient' is positive for counterclockwise loops otherwise negative. Returns the offset point, the shift direction for prev and next line.

thisPt : Pt
prevToThis : Vc
thisToNext : Vc
prevDist : float
nextDist : float
referenceOrient : float
Returns: ValueOption<Pt * Vc * Vc>

Type something to start searching.