AC-Vector-2.4.0: Efficient geometric vectors and transformations.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.BoundingBox.B3

Description

This module provides the BBox3 type for 3-dimensional bounding boxes ("bounding volumes").

Synopsis

Documentation

data BBox3 Source #

A BBox3 is a 3D bounding box (aligned to the coordinate axies).

Constructors

BBox3 

Fields

Instances

Instances details
Show BBox3 Source # 
Instance details

Defined in Data.BoundingBox.B3

Methods

showsPrec :: Int -> BBox3 -> ShowS #

show :: BBox3 -> String #

showList :: [BBox3] -> ShowS #

Eq BBox3 Source # 
Instance details

Defined in Data.BoundingBox.B3

Methods

(==) :: BBox3 -> BBox3 -> Bool #

(/=) :: BBox3 -> BBox3 -> Bool #

rangeX :: BBox3 -> Range Source #

Return the X-range that this bounding box covers.

rangeY :: BBox3 -> Range Source #

Return the Y-range that this bounding box covers.

rangeZ :: BBox3 -> Range Source #

Return the Z-range that this bounding box covers.

rangeXYZ :: Range -> Range -> Range -> BBox3 Source #

Given ranges for each coordinate axis, construct a bounding box.

bound_corners :: Vector3 -> Vector3 -> BBox3 Source #

Given a pair of corner points, construct a bounding box. (The points must be from opposite corners, but it doesn't matter which corners nor which order they are given in.)

bound_points :: [Vector3] -> BBox3 Source #

Find the bounds of a list of points. (Throws an exception if the list is empty.)

within_bounds :: Vector3 -> BBox3 -> Bool Source #

Test whether a given 3D vector is inside this bounding box.

min_point :: BBox3 -> Vector3 Source #

Return the minimum values for all coordinates.

max_point :: BBox3 -> Vector3 Source #

Return the maximum values for all coordinates.

union :: BBox3 -> BBox3 -> BBox3 Source #

Take the union of two bounding boxes. The result is a new bounding box that contains all the points the original boxes contained, plus any extra space between them.

isect :: BBox3 -> BBox3 -> Maybe BBox3 Source #

Take the intersection of two bounding boxes. If the boxes do not overlap, return Nothing. Otherwise return a new bounding box containing only the points common to both argument boxes.

unions :: [BBox3] -> BBox3 Source #

Efficiently compute the union of a list of bounding boxes.