Module Clpr.Path64

Rectangular clipping, simplification, and other transformations on sequences of vertices (int64) defining a single contour (open or closed path).

type t

the Clipper2 path type (std::vector of point)

Construction

val make : unit -> t
val reserve : t -> int -> unit

reserve t n

Reserves memory for up to n points in the path vector t.

val of_tups : (int64 * int64) list -> t
val ellipse : ?fn:int -> ?centre:Point64.t -> int64 -> int64 -> t
val add_point : t -> Point64.t -> unit

Access

val length : t -> int
val unsafe_get : t -> int -> Point64.t
val get : t -> int -> Point64.t

Transformation

val translate : t -> int64 -> int64 -> t

Rectangular Clipping

val bounds : t -> {rect64}5
val rect_clip : ?closed:bool -> t -> {rect64}5 -> {paths64}7

Simplification

val trim_collinear : ?closed:bool -> t -> t
val strip_near_equal : ?closed:bool -> ?eps:float -> t -> t
val strip_duplicates : ?closed:bool -> t -> unit
val simplify : ?closed:bool -> ?eps:float -> t -> t
val ramer_douglas_peucker : ?eps:float -> t -> t

Minkowski

val minkowski_sum : ?closed:bool -> pattern:t -> t -> {paths64}7
val minkowski_diff : ?closed:bool -> pattern:t -> t -> {paths64}7

Geometry

val area : t -> float
val point_inside : t -> Point64.t -> [> `Inside | `OnBorder | `Outside ]
val is_positive : t -> bool