Gg_kit.Ring2
2D linear rings.
Linear rings are closed lists of straight segments. They may self-intersect.
Rings are oriented using the right-hand rule. Counterclockwise rings bound a positive surface and clockwise ones a negative one (holes).
Rings may self-interesect and be degenerate when made of less than three points.
of_pts pts
is a linear ring defined by points pts
. Any two consecutive points of pts
defines a segment of the ring. The last point is connected to the first one.
val empty : t
empty
is an empty ring.
val area : t -> float
area r
is the signed area of the ring r
. You may be suprised by results on self-intersecting rings. Returns 0.
on degenerate rings.
val is_empty : t -> bool
is_empty r
is true
iff r
is empty, that is if has no points.
swap_orientation r
turns counterclockwise rings into clockwise ones and vice versa.
fold_pts f r acc
is the result of folding f
with acc
on the points of r
. This is acc
if c
is empty.