Safe Haskell | Safe-Infered |
---|
This module provides the BBox3
type for 3-dimensional bounding boxes ("bounding volumes").
- data BBox3 = BBox3 {}
- rangeX :: BBox3 -> Range
- rangeY :: BBox3 -> Range
- rangeZ :: BBox3 -> Range
- rangeXYZ :: Range -> Range -> Range -> BBox3
- bound_corners :: Vector3 -> Vector3 -> BBox3
- bound_points :: [Vector3] -> BBox3
- within_bounds :: Vector3 -> BBox3 -> Bool
- min_point :: BBox3 -> Vector3
- max_point :: BBox3 -> Vector3
- union :: BBox3 -> BBox3 -> BBox3
- isect :: BBox3 -> BBox3 -> Maybe BBox3
- unions :: [BBox3] -> BBox3
Documentation
rangeXYZ :: Range -> Range -> Range -> BBox3Source
Given ranges for each coordinate axis, construct a bounding box.
bound_corners :: Vector3 -> Vector3 -> BBox3Source
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] -> BBox3Source
Find the bounds of a list of points. (Throws an exception if the list is empty.)
within_bounds :: Vector3 -> BBox3 -> BoolSource
Test whether a given 3D vector is inside this bounding box.
union :: BBox3 -> BBox3 -> BBox3Source
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.