module Box3: sig
.. end
type
t = Gg.box3
val dim : int
dim
is the dimension of the boxes of type
Gg.box3
.
type
v = Gg.v3
The type for 3D vectors.
type
p = Gg.p3
The type for 3D points.
type
size = Gg.size3
The type for 3D sizes.
type
m = Gg.m3
Constructors, accessors and constants
val v : Gg.p3 -> Gg.size3 -> Gg.box3
v o size
is a box whose origin is o
and size is size
.
val v_mid : Gg.p3 -> Gg.size3 -> t
v_mid mid size
is a box whose
Gg.Box3.mid
point is
mid
and
size is
size
.
val empty : Gg.box3
empty
is the empty box.
val o : Gg.box3 -> Gg.p3
val ox : Gg.box3 -> float
ox b
is V3.x (o b)
.
val oy : Gg.box3 -> float
oy b
is V3.y (o b)
.
val oz : Gg.box3 -> float
oz b
is V3.z (o b)
.
val size : Gg.box3 -> Gg.size3
size b
is the size of
b
.
Raises Invalid_argument
on
Gg.Box3.empty
val w : Gg.box3 -> float
w b
is Size3.w (size b)
.
val h : Gg.box3 -> float
h b
is Size3.h (size b)
.
val d : Gg.box3 -> float
d b
is Size3.d (size b)
.
val zero : Gg.box3
zero
is a box whose origin and size is zero.
val unit : Gg.box3
unit
is the unit box which extends from zero to
one in all dimensions.
val of_pts : Gg.p3 -> Gg.p3 -> Gg.box3
of_pts p p'
is the smallest box whose space contains p
and p'
.
Functions
val min : Gg.box3 -> Gg.p3
min b
is the smallest point of
b
(its origin).
Raises Invalid_argument
on
Gg.Box3.empty
val minx : Gg.box3 -> float
minx b
is V3.x (min b)
.
val miny : Gg.box3 -> float
miny b
is V3.y (min b)
.
val minz : Gg.box3 -> float
minz b
is V3.z (min b)
.
val max : Gg.box3 -> Gg.p3
max b
is the greatest point of
b
(its size added to the origin).
Raises Invalid_argument
on
Gg.Box3.empty
val maxx : Gg.box3 -> float
maxx b
is V3.x (max b)
.
val maxy : Gg.box3 -> float
maxy b
is V3.y (max b)
.
val maxz : Gg.box3 -> float
maxz b
is V3.z (max b)
.
val mid : Gg.box3 -> Gg.p3
mid b
is the mid point between
min
and
max
.
Raises Invalid_argument
on
Gg.Box3.empty
val midx : Gg.box3 -> float
midx b
is V3.x (mid b)
.
val midy : Gg.box3 -> float
midy b
is V3.y (mid b)
.
val midz : Gg.box3 -> float
midz b
is V3.z (mid b)
.
val area : Gg.box3 -> float
area b
is the surface area of b
.
val volume : Gg.box3 -> float
volume b
is the volume of b
.
val inter : Gg.box3 -> Gg.box3 -> Gg.box3
inter b b'
is a box whose space is the intersection of S(b
)
and S(b'
).
val union : Gg.box3 -> Gg.box3 -> Gg.box3
union b b'
is the smallest box whose space contains
S(b
) and S(b'
).
val inset : Gg.v3 -> Gg.box3 -> Gg.box3
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.Box3.empty
. Returns
Gg.Box3.empty
on
Gg.Box3.empty
.
val round : Gg.box3 -> Gg.box3
val move : Gg.v3 -> Gg.box3 -> Gg.box3
val ltr : Gg.m3 -> Gg.box3 -> Gg.box3
val tr : Gg.m4 -> Gg.box3 -> Gg.box3
tr m b
is the smallest box containing the corners of
b
transformed
by
m
in homogenous 3D space. Returns
Gg.Box3.empty
on
Gg.Box3.empty
.
val map_f : (float -> float) -> Gg.box3 -> Gg.box3
map_f f b
is the box whose origin and size are those of
b
with
their components mapped by
f
. Returns
Gg.Box3.empty
on
Gg.Box3.empty
.
Predicates and comparisons
val is_empty : Gg.box3 -> bool
val is_pt : Gg.box3 -> bool
is_pt b
is
true
iff
b
is not
Gg.Box3.empty
and its size is equal
to 0 in every dimension.
val is_plane : Gg.box3 -> bool
is_plane b
is true
iff the size of b
is equal to 0 in exactly
one dimension.
val is_seg : Gg.box3 -> bool
is_seg b
is
true
iff
b
is not
Gg.Box3.empty
and its size is
equal to 0 in exactly two dimensions.
val isects : Gg.box3 -> Gg.box3 -> bool
isects b b'
is not (is_empty (inter b b'))
.
val subset : Gg.box3 -> Gg.box3 -> bool
subset b b'
is true
iff S(b
) is included in S(b'
).
val mem : Gg.p3 -> Gg.box3 -> bool
mem p b
is true
iff p
is in S(b
).
val equal : Gg.box3 -> Gg.box3 -> bool
equal b b'
is b = b'
.
val equal_f : (float -> float -> bool) -> Gg.box3 -> Gg.box3 -> bool
equal_f eq b b'
tests
b
and
b'
like
Gg.Box3.equal
but uses
eq
to test floating point values.
val compare : Gg.box3 -> Gg.box3 -> int
compare u v
is Pervasives.compare u v
.
val compare_f : (float -> float -> int) -> Gg.box3 -> Gg.box3 -> int
compare_f cmp b b'
compares
b
and
b'
like
Gg.Box3.compare
but uses
cmp
to compare floating point values.
Printers
val to_string : Gg.box3 -> string
to_string b
is a textual representation of b
.
val pp : Format.formatter -> Gg.box3 -> unit
pp ppf b
prints a textual representation of b
on ppf
.
val pp_f : (Format.formatter -> float -> unit) -> Format.formatter -> Gg.box3 -> unit
pp_f pp_fl ppf b
prints
b
like
Gg.Box3.pp
but uses
pp_fl
to print floating point values.