Point3dArray Class

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

Methods

Name Description
centroid(points: IndexedXYZCollection, result?: Point3d): Point3d Static return simple average of all coordinates.  
cloneDeepJSONNumberArrays(data: MultiLineStringDataVariant): any[] 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: XYAndZ[]): Point2d[] Static Return an array containing Point2d with xy parts of each Point3d  
clonePoint3dArray(data: XYAndZ[]): 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.  
closestPointIndex(data: XYAndZ[], spacePoint: XYAndZ): 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.  
createRange(data: MultiLineStringDataVariant): Range3d Static Point3dArray.createRange(data) is deprecated. Deprecated
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
By appropriate choice of weights, this can be used for both point and derivative mappings.
 
indexOfMostDistantPoint(points: Point3d[], spacePoint: XYZ, farVector: Vector3d): number | undefined Static Return the index of the point most distant from spacePoint  
indexOfPointWithMaxCrossProductMagnitude(points: Point3d[], spacePoint: Point3d, vector: Vector3d, farVector: Vector3d): number | undefined Static return the index of the point whose vector from space point has the largest magnitude of cross product with given vector.  
isAlmostEqual(dataA: Point3d[] | Float64Array | undefined, dataB: Point3d[] | Float64Array | undefined): boolean Static Apply Geometry.isAlmostEqual to corresponding coordinates  
isCloseToPlane(data: Point3d[] | Float64Array, plane: Plane3dByOriginAndUnitNormal, tolerance: number = Geometry.smallMetricDistance): boolean Static return true iff all points' altitudes are within tolerance of the plane.  
minMaxPoints(data: Point3d[]): object | undefined 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[]): Float64Array Static pack x,y,z to Float64Array  
streamXYZ(data: MultiLineStringDataVariant, startChainCallback: (chainData: MultiLineStringDataVariant, isLeaf: boolean) => void | undefined, pointCallback: (x: number, y: number, z: number) => void, endChainCallback: (chainData: MultiLineStringDataVariant, isLeaf: boolean) => void | undefined): number Static Point3dArray.streamXYZ is deprecated -- use VariantPointStream.streamXYZ (handler) Deprecated
streamXYZXYZ(data: MultiLineStringDataVariant, startChainCallback: (chainData: MultiLineStringDataVariant, isLeaf: boolean) => void | undefined, segmentCallback: (x0: number, y0: number, z0: number, x1: number, y1: number, z1: number) => void, endChainCallback: (chainData: MultiLineStringDataVariant, isLeaf: boolean) => void | undefined): number Static Point3dArray.streamXYZXYZ is deprecated -- use VariantPointStream.streamXYZXYZ (handler) Deprecated
sumEdgeLengths(data: Point3d[] | Float64Array, addClosureEdge: boolean = false): 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 an 3-dimensional array containing all the values of data in arrays numPerRow blocks of numPerBlock  
unpackNumbersToPoint3dArray(data: Float64Array | number[]): Point3d[] Static unpack from a number array or Float64Array to an array of Point3d  

Defined in

Last Updated: 20 September, 2019