Clpr.RectD
An axis-aligned rectangle used bounding box computations and quick rectangular clipping (boolean intersection) operations. (see PathsD.rect_clip
)
val make : l:float -> t:float -> r:float -> b:float -> t
make ~l ~t ~r ~b
Create an axis-aligned rectangle with the bounds l
eft, t
op, r
ight, and b
ottom.
of_pts a b
Create an axis-aligned bounding box (rectangle) that contains the points a
and b
.
val as_path : t -> {pathd}2
as_path t
Obtain a path describing the perimeter of the rectangle t
.
val width : t -> float
width t
Obtain the width of the rectangle t
.
val height : t -> float
height t
Obtain the height of the rectangle t
.
contains_pt t p
Determine whether the point p
lies within the rectangle t
.
contains_rect a b
Determine whether the rectangle a
fully contains the rectangle b
.
val is_empty : t -> bool
is_empty t
Check whether the rectangle t
has an area of zero.