• Parameters

    • points: number[][]

      an array of unsorted points, in any dimension

    • Optional padding: number = 0

      optionally add padding around the box

    Returns Box

    an object where "min" and "max" are two points and "span" is the lengths. returns "undefined" if no points were provided.

    Description

    Make an axis-aligned bounding box that encloses a set of points. the optional padding is used to make the bounding box inclusive / exclusive by adding padding on all sides, or inset in the case of negative number. (positive=inclusive boundary, negative=exclusive boundary)