IndexedXYZCollection Class

abstract base class for read-only access to XYZ data with indexed reference.

  • This allows algorithms to work with Point3d[] or GrowableXYZ.
    • GrowableXYZArray implements these for its data.
    • Point3dArrayCarrier carries a (reference to) a Point3d[] and implements the methods with calls on that array reference.
  • In addition to "point by point" accessors, other abstract members compute commonly useful vector data "between points".
  • Methods that create vectors among multiple indices allow callers to avoid creating temporaries.

Extended by

Methods

Name Description
constructor(): IndexedXYZCollection    
accumulateCrossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result: Vector3d): void Abstract Return the cross product of vectors from origin point at indexA to target points at indexB and indexC  
accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void Abstract Accumulate scale times the x,y,z values at index.  
crossProductIndexIndexIndex(origin: number, indexA: number, indexB: number, result?: Vector3d): undefined | Vector3d Abstract Return the cross product of vectors from origin to points at indexA and indexB  
crossProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: Readonly<WritableXYAndZ>, result?: Vector3d): undefined | Vector3d Return the cross product of the vectors from origin to the point at indexA and to targetB  
crossProductXYAndZIndexIndex(origin: Readonly<WritableXYAndZ>, indexA: number, indexB: number, result?: Vector3d): undefined | Vector3d Abstract Return the cross product of the vectors from origin to points at indexA and indexB  
cyclicIndex(i: number): number Adjust index into range by modulo with the length.  
distanceIndexIndex(index0: number, index1: number): undefined | number Abstract Return distance between indicated points.  
distanceSquaredIndexIndex(index0: number, index1: number): undefined | number Abstract Return distance squared between indicated points.  
distanceSquaredIndexXYAndZ(index0: number, target: Readonly<WritableXYAndZ>): undefined | number Return distance squared between the point at index0 and target.  
dotProductIndexIndexIndex(origin: number, indexA: number, indexB: number): undefined | number Return the dot product of the vectors from the point at origin to the points at indexA and indexB.  
dotProductIndexIndexXYAndZ(origin: number, indexA: number, targetB: Readonly<WritableXYAndZ>): undefined | number Return the dot product of the vectors from the point at origin to the point at indexA and to targetB.  
findOrderedDuplicates(tolerance: number = Geometry.smallMetricDistance): number[] For each run of points with indices i+1 to i+n within distance tolerance of points[i], return the indices i+1, ..., i+n.  
getArray(): Point3d[] convert to Point3d[]  
getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): undefined | Point3d Abstract Return the point at index as a strongly typed Point3d.  
getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d Abstract Return the point at index as a strongly typed Point3d, without checking the point index validity.  
getRange(): Range3d Return the range of the points.  
getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): undefined | Vector3d Abstract Get from index as a strongly typed Vector3d.  
getXAtUncheckedPointIndex(pointIndex: number): number Abstract access x of indexed point  
getYAtUncheckedPointIndex(pointIndex: number): number Abstract access y of indexed point  
getZAtUncheckedPointIndex(pointIndex: number): number Abstract access z of indexed point  
interpolateIndexIndex(index0: number, fraction: number, index1: number, result?: Point3d): undefined | Point3d Interpolate the points at the given indices.  
linearCombination(scales: number[], result?: Point3d | Vector3d): XYZ Compute the linear combination s of the indexed p_i and given scales s_i.  
vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): undefined | Vector3d Abstract Return a vector from the point at indexA to the point at indexB  
vectorIndexXYAndZ(indexA: number, target: Readonly<WritableXYAndZ>, result?: Vector3d): undefined | Vector3d Return a vector from the point at indexA to target  
vectorXYAndZIndex(origin: Readonly<WritableXYAndZ>, indexB: number, result?: Vector3d): undefined | Vector3d Abstract Return a vector from origin to the point at indexB  

Properties

Name Type Description
length Accessor AbstractReadOnly number read-only property for number of XYZ in the collection.  
points Accessor ReadOnly Iterable<Point3d> Return iterator over the points in this collection.  

Defined in

Last Updated: 20 June, 2023