Point3dArray Class

The Point3dArray class contains static methods that act on arrays of 3d points.

Methods

Name Description
constructor(): Point3dArray    
centroid(points: IndexedXYZCollection | Point3d[], result?: Point3d): Point3d Static return simple average of all coordinates.  
cloneDeepJSONNumberArrays(data: MultiLineStringDataVariant): number[][] Static return similarly-structured array, array of arrays, etc, with the lowest level point data specifically structured as arrays of 3 numbers [1,2,3]  
cloneDeepXYZPoint3dArrays(data: MultiLineStringDataVariant): any[] Static return similarly-structured array, array of arrays, etc, with the lowest level point data specifically structured as Point3d.  
clonePoint2dArray(data: Readonly<WritableXYAndZ>[]): Point2d[] Static Return an array containing Point2d with xy parts of each Point3d  
clonePoint3dArray(data: Float64Array | XYZProps[]): Point3d[] Static Return an array containing clones of the Point3d data[]  
cloneWithMaxEdgeLength(points: Point3d[], maxEdgeLength: number): Point3d[] Static clone points in the input array, inserting points within each edge to limit edge length.  
cloneXYZPropsAsFloat64Array(data: XYZProps[]): Float64Array Static clone an array of XYZProps data, specifically as flattened array of number  
cloneXYZPropsAsNumberArray(data: XYZProps[]): number[][] Static clone an array of XYZProps data, specifically as arrays of 3 numbers  
closestPointIndex(data: Readonly<WritableXYAndZ>[], spacePoint: Readonly<WritableXYAndZ>): number Static Return the index of the closest point in the array (full xyz)  
computeConvexHullXY(points: Point3d[], hullPoints: Point3d[], insidePoints: Point3d[], addClosurePoint: boolean = false): void Static Computes the hull of the XY projection of points.  
countNonDuplicates(points: Point3d[], tolerance: number = Geometry.smallMetricDistance): number Static Count the number of points, but ...  
distanceIndexedPointBToSegmentAC(points: Point3d[], indexA: number, indexB: number, indexC: number, extrapolate: boolean): number Static Return perpendicular distance from points[indexB] to the segment from points[indexA] to points[indexC].  
evaluateTrilinearDerivativeTransform(points: Point3d[], u: number, v: number, w: number, result?: Transform): Transform Static Compute a point and derivatives wrt uvw by trilinear mapping.  
evaluateTrilinearPoint(points: Point3d[], u: number, v: number, w: number, result?: Point3d): Point3d Static Compute a point by trilinear mapping.  
evaluateTrilinearWeights(weights: Float64Array, u0: number, u1: number, v0: number, v1: number, w0: number, w1: number): void Static Compute the 8 weights of trilinear mapping  
indexOfMostDistantPoint(points: Point3d[], spacePoint: XYZ, farVector: Vector3d): undefined | number Static Return the index of the point most distant from spacePoint  
indexOfPointWithMaxCrossProductMagnitude(points: Point3d[], spacePoint: Point3d, vector: Vector3d, farVector: Vector3d): undefined | number Static return the index of the point whose vector from space point has the largest magnitude of cross product with given vector.  
isAlmostEqual(dataA: undefined | Float64Array | Point3d[], dataB: undefined | Float64Array | Point3d[]): boolean Static Test arrays for near equality of all corresponding numeric values, treated as coordinates.  
isCloseToPlane(data: Float64Array | Point3d[], plane: Plane3dByOriginAndUnitNormal, tolerance: number = Geometry.smallMetricDistance): boolean Static return true iff all points' altitudes are within tolerance of the plane.  
minMaxPoints(data: Point3d[]): undefined | { maxXPoint: Point3d, maxYPoint: Point3d, minXPoint: Point3d, minYPoint: Point3d } Static Return (clones of) points in data[] with min and max x and y parts.  
multiplyInPlace(transform: Transform, xyz: Float64Array): void Static multiply a transform times each x,y,z triple and replace the x,y,z in the packed array  
packToFloat64Array(data: Point3d[], result?: Float64Array): Float64Array Static Copy 3d points into a packed buffer.  
sumEdgeLengths(data: Float64Array | Point3d[], addClosureEdge: boolean = false, maxPointsToUse?: number): number Static Sum lengths of edges.  
sumWeightedX(weights: Float64Array, points: Point3d[]): number Static sum the weighted x components from a point array.  
sumWeightedY(weights: Float64Array, points: Point3d[]): number Static sum the weighted x components from a point array.  
sumWeightedZ(weights: Float64Array, points: Point3d[]): number Static sum the weighted x components from a point array.  
unpackNumbersToNestedArrays(data: Float64Array, numPerBlock: number): any[] Static return an 2-dimensional array containing all the values of data in arrays of numPerBlock  
unpackNumbersToNestedArraysIJK(data: Float64Array, numPerBlock: number, numPerRow: number): any[] Static Return a 3-dimensional array containing all the values of data in rows of numPerRow blocks of size numPerBlock.  
unpackNumbersToPoint3dArray(data: Float64Array | number[]): Point3d[] Static unpack from a number array or Float64Array to an array of Point3d  

Defined in

Last Updated: 16 April, 2024