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): Box | undefined 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
v = 0 as the z=0 local plane
v = 1 as the z=1 local plane
Return the (rectangular) section at fractional v
 
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(): Transform | undefined Return a coordinate frame (right handed unit vectors)
origin lower left of box
x direction on base rectangle x edge
y direction in base rectangle
z direction perpendicular
 
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(baseOrigin: Point3d, vectorX: Vector3d, vectorY: Vector3d, topOrigin: Point3d, baseX: number, baseY: number, topX: number, topY: number, capped: boolean): Box | undefined Static Create a new box from vector and size daa.  
createDgnBoxWithAxes(baseOrigin: Point3d, axes: Matrix3d, topOrigin: Point3d, baseX: number, baseY: number, topX: number, topY: number, capped: boolean): Box | undefined Static Create a new box with xy directions taken from columns of the axes matrix.  
createRange(range: Range3d, capped: boolean): Box | undefined Static Create an axis-aligned Box primitive for a range.  

Inherited methods

Name Inherited from Description
range(transform?: Transform, result?: Range3d): Range3d GeometryQuery return the range of the entire (tree) GeometryQuery
tryTranslateInPlace(dx: number, dy: number = 0, dz: number = 0): boolean GeometryQuery try to move the geometry by dx,dy,dz

Properties

Name Type Description
isClosedVolume Accessor ReadOnly boolean    
solidPrimitiveType "box" = "box"    

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 Ask if this is a capped solid
children Accessor ReadOnly GeometryQuery[] | undefined GeometryQuery return GeometryQuery children for recursive queries.

* leaf classes do not need to implement.
geometryCategory "solid" = "solid" SolidPrimitive  

Defined in

Last Updated: 10 September, 2019