API Reference > geometry-core > ArraysAndInterfaces > GrowableXYZArray GrowableXYZArray Class GrowableXYArray manages a (possibly growing) Float64Array to pack xy coordinates. Extends IndexedReadWriteXYZCollection Methods Name Description constructor(numPoints: number = 8): GrowableXYZArray Construct a new GrowablePoint3d array. accumulateCrossProductIndexIndexIndex(originIndex: number, targetAIndex: number, targetBIndex: number, result: Vector3d): void * compute the cross product from indexed origin t indexed targets targetAIndex and targetB index. accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void * compute the cross product from indexed origin t indexed targets targetAIndex and targetB index. addSteppedPoints(other: GrowableXYZArray, pointIndex0: number, step: number, numAdd: number): void add points at regular steps from other areaXY(): number Sum the signed areas of the projection to xy plane back(result?: Point3d): Point3d | undefined Return the last point, or undefined if the array is empty. clear(): void Clear all xyz data, but leave capacity unchanged. clone(result?: GrowableXYZArray): GrowableXYZArray Make a copy of the (active) points in this array. compareLexicalBlock(ia: number, ib: number): number compare two blocks in simple lexical order. component(pointIndex: number, componentIndex: number): number Access a single double at offset within a block. crossProductIndexIndexIndex(originIndex: number, targetAIndex: number, targetBIndex: number, result?: Vector3d): Vector3d | undefined Compute the cross product of vectors from from indexed origin to indexed targets i and j crossProductXYAndZIndexIndex(origin: XYAndZ, targetAIndex: number, targetBIndex: number, result?: Vector3d): Vector3d | undefined Compute the cross product of vectors from from origin to indexed targets i and j distance(i: number, j: number): number | undefined Return the distance between two points in the array. Deprecated distanceIndexIndex(i: number, j: number): number | undefined Return distance between indicated points. distanceIndexToPoint(i: number, spacePoint: XYAndZ): number | undefined Return the distance between an array point and the input point. distanceSquaredIndexIndex(i: number, j: number): number | undefined Return distance squared between indicated points. ensureCapacity(pointCapacity: number): void If necessary, increase the capacity to a new pointCount. evaluateUncheckedIndexDotProductXYZ(pointIndex: number, x: number, y: number, z: number): number Compute the dot product of pointIndex with [x,y,z] evaluateUncheckedIndexPlaneAltitude(pointIndex: number, plane: PlaneAltitudeEvaluator): number Compute the dot product of pointIndex with [x,y,z] extendRange(rangeToExtend: Range3d, transform?: Transform): void Extend range to extend by all points. fillLocalXYTriangleFrame(originIndex: number, targetAIndex: number, targetBIndex: number, result?: Transform): Transform | undefined * Triangle for (unchecked!) for three points identified by index float64Data(): Float64Array Return the raw packed data. front(result?: Point3d): Point3d | undefined Return the first point, or undefined if the array is empty. getPoint2dAtCheckedPointIndex(pointIndex: number, result?: Point2d): Point2d | undefined copy xy into strongly typed Point2d getPoint2dAtUncheckedPointIndex(pointIndex: number, result?: Point2d): Point2d Get a point by index, strongly typed as a Point2d. getPoint3dArray(): Point3d[] Copy all points into a simple array of Point3d getPoint3dAtCheckedPointIndex(pointIndex: number, result?: Point3d): Point3d | undefined copy xyz into strongly typed Point3d getPoint3dAtUncheckedPointIndex(pointIndex: number, result?: Point3d): Point3d Get a point by index, strongly typed as a Point3d. getRange(transform?: Transform): Range3d get range of points. getVector3dAtCheckedVectorIndex(vectorIndex: number, result?: Vector3d): Vector3d | undefined copy xyz into strongly typed Vector3d getXAtUncheckedPointIndex(pointIndex: number): number access x of indexed point getYAtUncheckedPointIndex(pointIndex: number): number access y of indexed point getZAtUncheckedPointIndex(pointIndex: number): number access y of indexed point interpolate(i: number, fraction: number, j: number, result?: Point3d): Point3d | undefined Compute a point at fractional coordinate between points i and j isCloseToPlane(plane: Plane3dByOriginAndUnitNormal, tolerance: number = Geometry.smallMetricDistance): boolean test if all points are within tolerance of a plane. isIndexValid(index: number): boolean Test if index is valid for an xyz (point or vector) within this array mapComponent(componentIndex: 0 | 1 | 2, func: (x: number, y: number, z: number) => number): void Pass the (x,y,z) of each point to a function which returns a replacement for of of the 3 components. moveIndexToIndex(fromIndex: number, toIndex: number): void move the coordinates at fromIndex to toIndex. multiplyAndRenormalizeMatrix3dInverseTransposeInPlace(matrix: Matrix3d): boolean multiply each xyz (as a vector) by matrix inverse transpose, renormalize the vector, replace values. multiplyMatrix3dInPlace(matrix: Matrix3d): void multiply each xyz (as a vector) by matrix, replace values. multiplyTransformInPlace(transform: Transform): void multiply each point by the transform, replace values. pop(): void Remove one point from the back. push(toPush: XYAndZ): void push a point to the end of the array pushAll(points: Point3d[]): void push all points of an array pushFrom(p: any): void Push points from variant sources. pushFromGrowableXYZArray(source: GrowableXYZArray, sourceIndex?: number): number push coordinates from the source array to the end of this array. pushInterpolatedFromGrowableXYZArray(source: GrowableXYZArray, i: number, fraction: number, j: number): void * Compute a point at fractional coordinate between points i and j of source pushWrap(numWrap: number): void Replicate numWrap xyz values from the front of the array as new values at the end. pushXYZ(x: number, y: number, z: number): void append a new point with given x,y,z resize(pointCount: number): void Resize the actual point count, preserving excess capacity. reverseInPlace(): void reverse the order of points. scaleInPlace(factor: number): void Multiply each x,y,z by the scale factor. setAtCheckedPointIndex(pointIndex: number, value: XYAndZ): boolean Set the coordinates of a single point. setRange(range: Range3d, transform?: Transform): void Initialize range with coordinates in this array. setXYZAtCheckedPointIndex(pointIndex: number, x: number, y: number, z: number): boolean Set the coordinates of a single point given as coordinates sortIndicesLexical(): Uint32Array Return an array of block indices sorted per compareLexicalBlock function sumLengths(): number Sum the lengths of segments between points. transferFromGrowableXYZArray(destIndex: number, source: GrowableXYZArray, sourceIndex: number): boolean Read coordinates from source array, place them at index within this array. tryTransformInverseInPlace(transform: Transform): boolean multiply each point by the transform, replace values. vectorIndexIndex(i: number, j: number, result?: Vector3d): Vector3d | undefined Compute a vector from index origin i to indexed target j vectorXYAndZIndex(origin: XYAndZ, j: number, result?: Vector3d): Vector3d | undefined Compute a vector from origin to indexed target j create(data: any, result?: GrowableXYZArray): GrowableXYZArray Static Create an array from various point data formats. distanceBetweenPointsIn2Arrays(arrayA: GrowableXYZArray, i: number, arrayB: GrowableXYZArray, j: number): number | undefined Static Return the distance between points in distinct arrays. distanceRangeBetweenCorrespondingPoints(arrayA: GrowableXYZArray, arrayB: GrowableXYZArray): Range1d Static find the min and max distance between corresponding indexed points. isAlmostEqual(dataA: GrowableXYZArray | undefined, dataB: GrowableXYZArray | undefined): boolean Static test for near equality between two GrowableXYZArray. Inherited methods Name Inherited from Description cyclicIndex(i: number): number IndexedXYZCollection Adjust index into range by modulo with the length. Properties Name Type Description float64Length Accessor ReadOnly number Return the number of float64 in use. length Accessor number The number of points in use. Inherited properties Name Type Inherited from Description points Accessor ReadOnly Iterable<Point3d> IndexedXYZCollection Return iterator over the points in this collection. Usage:ts<br> for (const point: Point3d of collection.points) { ... }<br> Defined in core/geometry/src/geometry3d/GrowableXYZArray.ts Line 24 Last Updated: 13 June, 2024