Class BoundingBox

Constructors

  • Parameters

    • min: number[]

      Point containing all the minimum coordinates.

    • max: number[]

      Point containing all the maximum coordinates.

    Returns BoundingBox

    Description

    Constructs a new bounding box from two corner points.

  • Parameters

    • minX: number

      Lower extreme for box X size.

    • minY: number

      Lower extreme for box Y size.

    • minZ: number

      Lower extreme for box Z size.

    • maxX: number

      Upper extreme for box X size.

    • maxY: number

      Upper extreme for box Y size.

    • maxZ: number

      Upper extreme for box Z size.

    Returns BoundingBox

    Description

    Constructs a bounding box from numeric extremes.

Properties

area: number

Gets the area of this BoundingBox.

center: number[]

Gets the point in the center of the bounding box.

diagonal: number[]

Gets the diagonal vector of this BoundingBox. The diagonal connects the Min and Max points.

isValid: boolean

Gets a value that indicates whether or not this bounding box is valid. Empty boxes are not valid, and neither are boxes with unset points.

max: number[]

Gets or sets the point in the maximal corner.

min: number[]

Gets or sets the point in the minimal corner.

volume: number

Gets the volume of this BoundingBox.

Methods

  • Parameters

    • point: number[]

      Sample point.

    Returns number[]

    The point on or in the box that is closest to the sample point.

    Description

    Finds the closest point on or in the bounding box.

  • Parameters

    • point: number[]

      Point to test.

    Returns boolean

    true if the point is on the inside of or coincident with this bounding box; otherwise false.

    Description

    Tests a point for bounding box inclusion. This is the same as calling Contains(point, false)

  • Parameters

    • amount: number

      Amount (in model units) to inflate this box in all directions.

    Returns void

    Description

    Inflates the box with equal amounts in all directions. Inflating with negative amounts may result in decreasing boxes. Invalid boxes can not be inflated.

  • Parameters

    • xAmount: number

      Amount (in model units) to inflate this box in the x direction.

    • yAmount: number

      Amount (in model units) to inflate this box in the y direction.

    • zAmount: number

      Amount (in model units) to inflate this box in the z direction.

    Returns void

    Description

    Inflate the box with custom amounts in all directions. Inflating with negative amounts may result in decreasing boxes. InValid boxes can not be inflated.

  • Parameters

    • tolerance: number

      Distances <= tolerance will be considered to be zero. If tolerance is negative (default), then a scale invariant tolerance is used.

    Returns number

    0 = box is not degenerate 1 = box is a rectangle (degenerate in one direction). 2 = box is a line (degenerate in two directions). 3 = box is a point (degenerate in three directions) 4 = box is not valid.

    Description

    Determines whether a bounding box is degenerate (flat) in one or more directions.

  • Returns Brep

    If this operation is successful, a Brep representation of this box; otherwise null.

    Description

    Constructs a Brep representation of this bounding box.

  • Parameters

    Returns boolean

    true if this operation is successful; otherwise false.

    Description

    Updates this bounding box to be the smallest axis aligned bounding box that contains the transformed result of its 8 original corner points.

  • Parameters

    • json: object

      A js object with the following format:

      { 
      Min: { X: <number>, Y: <number>, Z: <number> },
      Max: { X: <number>, Y: <number>, Z: <number> }
      }

    Returns BoundingBox

    Description

    Decodes a json object to a BoundingBox

  • Parameters

    Returns void

    Description

    Updates this BoundingBox to represent the union of itself and another box.

Generated using TypeDoc