Gg.Box
Implemented by all axis-aligned box types.
dim
is the dimension of the boxes of type t
.
The type for dim
vectors.
The type for dim
points.
The type for dim
sizes.
The type for matrices representing linear transformations of dim
space.
val empty : t
empty
is the empty box.
val zero : t
zero
is a box whose origin and size is zero.
val unit : t
unit
is the unit box which extends from zero to one in all dimensions.
max b
is the greatest point of b
(its size added to the origin).
Raises Invalid_argument
on empty
val area : t -> float
area b
is the surface area of b
.
inset d b
is b
whose edges are inset in each dimension according to amounts in d
. Negative values in d
outset. If the size in dimension i
becomes negative it is clamped to 0
and the i
th coordinate of the mid point of b
is used for the i
th coordinate of the resulting box's origin. Returns empty
on empty
.
val is_pt : t -> bool
is_pt b
is true
iff b
is not empty
and its size is equal to 0 in every dimension.
equal_f eq b b'
tests b
and b'
like equal
but uses eq
to test floating point values.
compare_f cmp b b'
compares b
and b'
like compare
but uses cmp
to compare floating point values.
val pp : Stdlib.Format.formatter -> t -> unit
pp ppf b
prints a textual representation of b
on ppf
.