FrameBuilder Class

Helper class to accumulate points and vectors until there is enough data to define a coordinate system.

  • For the common case of building a right handed frame:
    • create the FrameBuilder and make calls to announcePoint and announceVector.
    • the frame will be fully determined by an origin and two vectors.
    • the first call to announcePoint will set the origin.
    • additional calls to announcePoint will produce announceVector call with the vector from the origin.
    • after each announcement, call getValidatedFrame(false)
    • getValidatedFrame will succeed when it has two independent vectors.
  • To build a left handed frame,
  • an origin and 3 independent vectors are required.
  • announce as above, but query with getValidatedFrame (true).
  • this will use the third vector to select right or left handed frame.

Methods

Name Description
constructor(): FrameBuilder    
announce(data: any): void Inspect the content of the data.  
announcePoint(point: Point3d): number Announce a new point.  
announceVector(vector: Vector3d): number Announce a new vector.  
applyDefaultUpVector(vector?: Vector3d): void If vector0 is known but vector1 is not, make vector1 the cross of the up-vector and vector0  
clear(): void Clear all accumulated point and vector data  
getValidatedFrame(allowLeftHanded: boolean = false, result?: Transform): undefined | Transform Try to assemble the data into a non-singular transform.  
savedVectorCount(): number Return the number of vectors saved.  
createFrameToDistantPoints(points: Point3d[], result?: Transform): undefined | Transform Static Try to create a frame whose xy plane is through points.  
createFrameWithCCWPolygon(points: Point3d[], result?: Transform): undefined | Transform Static Try to create a frame whose xy plane is through points, with the points appearing CCW in the local frame.  
createLocalToWorldTransformInRange(range: Range3d, scaleSelect: AxisScaleSelect = AxisScaleSelect.NonUniformRangeContainment, fractionX: number = 0, fractionY: number = 0, fractionZ: number = 0, defaultAxisLength: number = 1.0, result?: Transform): Transform Static Create the localToWorld transform from a range to axes of its parent coordinate system.  
createRightHandedFrame(defaultUpVector: undefined | Vector3d, ...params: any[]): undefined | Transform Static Create a localToWorld frame for the given data.  
createRightHandedLocalToWorld(...params: any[]): undefined | Transform Static Create a transform containing points or vectors in the given data.  

Properties

Name Type Description
hasOrigin Accessor ReadOnly boolean Ask if there is a defined origin for the evolving frame  

Defined in

Last Updated: 29 March, 2024