Box Class

A box-like solid defined by

  • A local coordinate frame
    • (0,0,0) is left lower rear corner of box (considering "left" to reference x, "lower" to reference y, "rear and front" to reference z=0 and z=1)
    • (0,0,1) is left lower front corner.
    • (baseX,baseY,z) is right upper corner at z
    • note that the frame x and y columns are usually unit vectors in local space, but z is full rear to front vector
  • The separate values for base and top x and y allow the box to be a "view frustum" with parallel back and front planes but independent x and y bellows effects.

Extends

Methods

Name Description
constructor(map: Transform, baseX: number, baseY: number, topX: number, topY: number, capped: boolean): Box Protected    
clone(): Box Return a clone  
cloneTransformed(transform: Transform): undefined | Box Clone the box and immediately apply transform to the local frame of the clone.  
constantVSection(zFraction: number): CurveCollection Consider the box sides (not top and bottom) as a (u,v) surface with  
dispatchToGeometryHandler(handler: GeometryHandler): any Second step of double dispatch: call handler.handleBox(this)  
extendRange(rangeToExtend: Range3d, transform?: Transform): void Extend rangeToExtend by each of the 8 corners  
getBaseOrigin(): Point3d (property accessor) return the local coordinates point (0,0,0) to world  
getBaseX(): number (property accessor) return the x length at z = 0  
getBaseY(): number (property accessor) return the y length at z = 0  
getConstructiveFrame(): undefined | Transform Return a coordinate frame (right handed unit vectors)  
getCorners(): Point3d[] Returns the 8 corners in x fastest, then y, finally z lexical order.  
getTopOrigin(): Point3d (property accessor) return the local coordinates point (0,0,1) to world  
getTopX(): number (property accessor) return the x length at z = 1  
getTopY(): number (property accessor) return the x length at z = 1  
getVectorX(): Vector3d (property accessor) return the local coordinate frame x vector  
getVectorY(): Vector3d (property accessor) return the local coordinate frame y vector  
getVectorZ(): Vector3d (property accessor) return the local coordinate frame z vector  
isAlmostEqual(other: GeometryQuery): boolean test for near equality  
isSameGeometryClass(other: any): boolean Test of other is also of class Box  
strokeConstantVSection(zFraction: number): LineString3d Return strokes of the cross-section rectangle at local z coordinate  
tryTransformInPlace(transform: Transform): boolean Apply the transform to the box's localToWorld frame.  
createDgnBox(origin: Point3d, vectorX: Vector3d, vectorY: Vector3d, topOrigin: Point3d, baseX: number, baseY: number, topX: number, topY: number, capped: boolean): undefined | Box Static Create a new box from vector and size daa.  
createDgnBoxWithAxes(origin: Point3d, axes: Matrix3d, topOrigin: Point3d, baseX: number, baseY: number, topX: number, topY: number, capped: boolean): undefined | Box Static Create a new box with xy directions taken from columns of the axes matrix.  
createRange(range: Range3d, capped: boolean): undefined | Box Static Create an axis-aligned Box primitive for a range.  

Inherited methods

Name Inherited from Description
range(transform?: Transform, result?: Range3d): Range3d SolidPrimitive return the range of the entire (tree) GeometryQuery
tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean SolidPrimitive try to move the geometry by dx,dy,dz
areAlmostEqual(a: undefined | GeometryQuery, b: undefined | GeometryQuery): boolean Static SolidPrimitive apply instance method isAlmostEqual if both are defined.

Properties

Name Type Description
isClosedVolume Accessor ReadOnly boolean    
solidPrimitiveType Readonly "box" String name for schema properties  

Inherited properties

Name Type Inherited from Description
_capped Protected boolean SolidPrimitive flag indicating whether cap region is considered closed (i.e.
capped Accessor boolean SolidPrimitive Whether this is a capped solid
children Accessor ReadOnly undefined | GeometryQuery[] SolidPrimitive return GeometryQuery children for recursive queries.

* leaf classes do not need to implement.
geometryCategory Readonly "solid" SolidPrimitive String name for schema properties

Defined in

Last Updated: 20 June, 2023