Selva Compute API Reference - v2.1.0
    Preparing search index...
    Index

    Constructors

    • Parameters

      • min: number[]

        Point containing all the minimum coordinates.

      • max: number[]

        Point containing all the maximum coordinates.

      Returns BoundingBox

      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

      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.

      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.

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

    • ...

      Returns object

    • Parameters

      • amount: number

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

      Returns void

      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

      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.

      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.

      Constructs a Brep representation of this bounding box.

    • ...

      Returns object

    • Parameters

      Returns boolean

      true if this operation is successful; otherwise false.

      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

      Decodes a json object to a BoundingBox

    • Parameters

      Returns void

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