@webviz/subsurface-viewer
Version:
3D visualization component for subsurface reservoir data
33 lines (32 loc) • 1.34 kB
TypeScript
import type { Point3D } from "./Point3D";
/**
* 3D bounding box defined as [xmin, ymin, zmin, xmax, ymax, zmax].
*/
export type BoundingBox3D = [number, number, number, number, number, number];
/**
* Returns the bounding box encompassing both boxes.
* @param box1 first box.
* @param box2 second box.
* @param defaultBox in case both boxes are undefined.
* @returns the bounding box encompassing both boxes.
*/
export declare const boxUnion: (box1: BoundingBox3D | undefined, box2: BoundingBox3D | undefined, defaultBox?: BoundingBox3D) => BoundingBox3D;
/**
* Returns the center of the bounding box.
* @param box1 bounding box.
* @returns the center of the bounding box.
*/
export declare const boxCenter: (box: BoundingBox3D) => Point3D;
/**
* Returns true if the bounding box is not empty.
* @param box1 bounding box.
* @returns true if the bounding box is not empty.
*/
export declare const isEmpty: (box: BoundingBox3D | undefined) => boolean;
/**
* Calculates the axis-aligned bounding box for a set of 3D points.
*
* @param dataArray - A flat `Float32Array` containing 3D coordinates in the order [x0, y0, z0, x1, y1, z1, ...].
* @returns The BoundingBox representing the minimum and maximum coordinates along each axis.
*/
export declare function computeBoundingBox(dataArray: Float32Array): BoundingBox3D;