module type Box =`sig`

..`end`

Implemented by all axis-aligned box types.

`type `

t

The type for boxes.

`val dim : ``int`

`type `

v

The type for

`Gg.Box.dim`

vectors.`type `

p

The type for

`Gg.Box.dim`

points.`type `

size

The type for

`Gg.Box.dim`

sizes.`type `

m

`val v : ``p -> size -> t`

`v o size`

is a box whose origin is `o`

and size is `size`

.`val v_mid : ``p -> size -> t`

`val empty : ``t`

`empty`

is `val o : ``t -> p`

`val size : ``t -> size`

`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.`val of_pts : ``p -> p -> t`

`of_pts p p'`

is the smallest box whose space contains `p`

and `p'`

.`val min : ``t -> p`

`val max : ``t -> p`

`max b`

is the greatest point of `b`

(its size added to the origin).`Invalid_argument`

on `Gg.Box.empty`

`val mid : ``t -> p`

`val area : ``t -> float`

`area b`

is the surface area of `b`

.`val inter : ``t -> t -> t`

`inter b b'`

is a box whose space is the intersection of S(`b`

)
and S(`b'`

).`val union : ``t -> t -> t`

`union b b'`

is the smallest box whose space contains
S(`b`

) and S(`b'`

).`val inset : ``v -> t -> t`

`inset d b`

is `b`

whose edges are inset in each dimension
according to amounts in `d`

. Negative values in `d`

outset. If
the resulting size is negative returns `Gg.Box.empty`

. Returns
`Gg.Box.empty`

on `Gg.Box.empty`

.`val round : ``t -> t`

`round b`

is the smallest box containing `b`

with integer valued
corners. Returns `Gg.Box.empty`

on `Gg.Box.empty`

.`val move : ``v -> t -> t`

`val ltr : ``m -> t -> t`

`ltr m b`

is the smallest box containing the corners of `b`

transformed
by `m`

. Returns `Gg.Box.empty`

on `Gg.Box.empty`

.`val map_f : ``(float -> float) -> t -> t`

`map_f f b`

is the box whose origin and size are those of `b`

with
their components mapped by `f`

. Returns `Gg.Box.empty`

on `Gg.Box.empty`

.`val is_empty : ``t -> bool`

`val is_pt : ``t -> bool`

`val isects : ``t -> t -> bool`

`isects b b'`

is `not (is_empty (inter b b'))`

.`val subset : ``t -> t -> bool`

`subset b b'`

is `true`

iff S(`b`

) is included in S(`b'`

).`val mem : ``p -> t -> bool`

`mem p b`

is `true`

iff `p`

is in S(`b`

).`val equal : ``t -> t -> bool`

`equal b b'`

is `b = b'`

.`val equal_f : ``(float -> float -> bool) -> t -> t -> bool`

`val compare : ``t -> t -> int`

`compare u v`

is `Pervasives.compare u v`

.`val compare_f : ``(float -> float -> int) -> t -> t -> int`

`compare_f cmp b b'`

compares `b`

and `b'`

like `Gg.Box.compare`

but uses `cmp`

to compare floating point values.`val pp : ``Format.formatter -> t -> unit`

`pp ppf b`

prints a textual representation of `b`

on `ppf`

.`val pp_f : ``(Format.formatter -> float -> unit) -> Format.formatter -> t -> unit`