package camlgpc

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Boolean operations on polygons

type gpc_clipop =
  1. | Difference
  2. | Intersection
  3. | ExclusiveOR
  4. | Union

The clip operators.

type gpc_vertex = {
  1. x : float;
  2. y : float;
}

A vertex

type gpc_contour = int * gpc_vertex array

A contour is the number of vertices and an array of them.

type gpc_polygon = int * int array * gpc_contour array

The type of polygons. Number of contours, array of hole/not hole, array of contours. 0 = not a hole, 1 = a hole.

val nullpoly : gpc_polygon

The null gpc_polygon.

val gpcml_printpolygon : gpc_polygon -> unit

Debug printing of a polygon.

val gpc_polygon_of_box : float -> float -> float -> float -> gpc_polygon

gpc_polygon_of_box xmin xmax ymin ymax builds the obvious polygon.

val make_gpcpolygon : bool array -> gpc_vertex array array -> gpc_polygon

Build a polygon from an array of booleans (hole / not hole) and an array of vertex arrays

val gpcml_clippolygon : gpc_clipop -> gpc_polygon -> gpc_polygon -> gpc_polygon

gpcml_clippolygon op a b clips polygons a and b using operator op, returning the result.

OCaml

Innovation. Community. Security.