Module Gg.Box3
val dim : intdimis the dimension of the boxes of typebox3.
type v= v3The type for 3D vectors.
type p= p3The type for 3D points.
type size= size3The type for 3D sizes.
type m= m3The type for matrices representing linear transformations of 3D space.
Constructors, accessors and constants
val empty : box3emptyis the empty box.
val ox : box3 -> floatox bisV3.x (o b).
val oy : box3 -> floatoy bisV3.y (o b).
val oz : box3 -> floatoz bisV3.z (o b).
val w : box3 -> floatw bisSize3.w (size b).
val h : box3 -> floath bisSize3.h (size b).
val d : box3 -> floatd bisSize3.d (size b).
val zero : box3zerois a box whose origin and size is zero.
val unit : box3unitis the unit box which extends from zero to one in all dimensions.
Functions
val minx : box3 -> floatminx bisV3.x (min b).
val miny : box3 -> floatminy bisV3.y (min b).
val minz : box3 -> floatminz bisV3.z (min b).
val max : box3 -> p3max bis the greatest point ofb(its size added to the origin).- raises Invalid_argument
on
empty
val maxx : box3 -> floatmaxx bisV3.x (max b).
val maxy : box3 -> floatmaxy bisV3.y (max b).
val maxz : box3 -> floatmaxz bisV3.z (max b).
val midx : box3 -> floatmidx bisV3.x (mid b).
val midy : box3 -> floatmidy bisV3.y (mid b).
val midz : box3 -> floatmidz bisV3.z (mid b).
val fbr_pt : box3 -> p3fbl_pt bis the far-bottom-right corner ofb.- raises Invalid_argument
on
empty.
val nbl_pt : box3 -> p3nbl_pt bis the near-bottom-left corner ofb.- raises Invalid_argument
on
empty.
val nbr_pt : box3 -> p3nbl_pt bis the near-bottom-right corner ofb.- raises Invalid_argument
on
empty.
val area : box3 -> floatarea bis the surface area ofb.
val volume : box3 -> floatvolume bis the volume ofb.
val inter : box3 -> box3 -> box3inter b b'is a box whose space is the intersection of S(b) and S(b').
val inset : v3 -> box3 -> box3inset d bisbwhose edges are inset in each dimension according to amounts ind. Negative values indoutset. If the resulting size is negative returnsempty. Returnsemptyonempty.
val round : box3 -> box3round bis the smallest box containingbwith integer valued corners. Returnsemptyonempty.
val ltr : m3 -> box3 -> box3ltr m bis the smallest box containing the corners ofbtransformed bym. Returnsemptyonempty.
Predicates and comparisons
val is_pt : box3 -> boolis_pt bistrueiffbis notemptyand its size is equal to 0 in every dimension.
val is_plane : box3 -> boolis_plane bistrueiff the size ofbis equal to 0 in exactly one dimension.
val is_seg : box3 -> boolis_seg bistrueiffbis notemptyand its size is equal to 0 in exactly two dimensions.
Printers
val pp : Stdlib.Format.formatter -> box3 -> unitpp ppf bprints a textual representation ofbonppf.
val pp_f : (Stdlib.Format.formatter -> float -> unit) -> Stdlib.Format.formatter -> box3 -> unitpp_f pp_fl ppf bprintsblikeppbut usespp_flto print floating point values.