Module Clpr.PathsD

Clipping (boolean), offseting, simplification, and minkowski operations on sequences of PathD.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 / Conversion

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 : (float * float) list list -> t
val add_path : t -> PathD.t -> unit
val of_pathd : PathD.t -> t
val to_paths64 : t -> {paths64}7
val scale_to_paths64 : ?sx:float -> ?sy:float -> t -> ({paths64}7, string) Stdlib.result

Access

val length : t -> int
val get : t -> int -> int -> PointD.t
val sublength : t -> int -> int
val subpath : t -> int -> PathD.t
val unsafe_sublength : t -> int -> int
val unsafe_subpath : t -> int -> PathD.t
val unsafe_get : t -> int -> int -> PointD.t

Transformation

val translate : t -> float -> float -> t

Clipping (Boolean) Operations

val boolean_op : ?fill_rule:fill_rule -> ?precision:int -> op:clip_type -> t -> t -> t
val boolean_op_tree : ?fill_rule:fill_rule -> ?precision:int -> op:clip_type -> t -> t -> {polytreed}4
val intersect : ?fill_rule:fill_rule -> ?precision:int -> t -> t -> t
val union : ?fill_rule:fill_rule -> ?precision:int -> t -> t
val difference : ?fill_rule:fill_rule -> ?precision:int -> t -> t -> t
val xor : ?fill_rule:fill_rule -> ?precision:int -> t -> t -> t
val rect_clip : ?precision:int -> ?closed:bool -> t -> RectD.t -> t

Offsetting

val inflate : ?precision:int -> ?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 : ?precision:int -> ?closed:bool -> ?fill_rule:fill_rule -> pattern:PathD.t -> t -> t
val minkowski_diff : ?precision:int -> ?closed:bool -> ?fill_rule:fill_rule -> pattern:PathD.t -> t -> t

Geometry

val area : t -> float
val bounds : t -> {rectd}1