Module Clpr.Paths64

Clipping (boolean), offseting, simplification, and minkowski operations on sequences of Path64.t

type t

The Clipper2 paths type (std::vector of path)

These lists of contours are not organized hierarchically (by parent-child / outer-hole) relationships, and may include any number of open paths or polygons.

Construction

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

reserve t n

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

val of_tups : (int64 * int64) list list -> t
val add_path : t -> Path64.t -> unit
val of_path64 : Path64.t -> t

Access

val length : t -> int
val get : t -> int -> int -> Point64.t
val sublength : t -> int -> int
val subpath : t -> int -> Path64.t
val unsafe_get : t -> int -> int -> Point64.t
val unsafe_sublength : t -> int -> int
val unsafe_subpath : t -> int -> Path64.t

Transformations

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

Clipping (Boolean) Operations

val boolean_op : ?fill_rule:fill_rule -> op:clip_type -> t -> t -> t
val boolean_op_tree : ?fill_rule:fill_rule -> op:clip_type -> t -> t -> {polytree64}8
val intersect : ?fill_rule:fill_rule -> t -> t -> t
val union : ?fill_rule:fill_rule -> t -> t
val difference : ?fill_rule:fill_rule -> t -> t -> t
val xor : ?fill_rule:fill_rule -> t -> t -> t
val rect_clip : ?closed:bool -> t -> Rect64.t -> t

Offsetting

val inflate : ?miter_limit:float -> ?join_type:join_type -> ?end_type:end_type -> delta:float -> t -> t

Simplification

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 -> ?fill_rule:fill_rule -> pattern:Path64.t -> t -> t
val minkowski_diff : ?closed:bool -> ?fill_rule:fill_rule -> pattern:Path64.t -> t -> t

Geometry

val area : t -> float
val bounds : t -> {rect64}5