package cpdf

  1. Overview
  2. Docs

Basic Shapes

type fpoint = float * float
type winding_rule =
  1. | EvenOdd
  2. | NonZero
type segment =
  1. | Straight of fpoint * fpoint
  2. | Bezier of fpoint * fpoint * fpoint * fpoint
type hole =
  1. | Hole
  2. | Not_hole
type closure =
  1. | Closed
  2. | Open
type subpath = hole * closure * segment list
type path = winding_rule * subpath list
val kappa : float

The factor by which the radius of a circle is multiplied to find the length of the bezier control lines when approximating quarter arcs to make circles.

val restrict_angle : float -> float -> float

Calling restrict_angle s a restricts an angle a to one of those at s, 2s, 3s... returning the chosen one.

val circle : float -> float -> float -> path

Calling circle x y r builds a path representing a circle at (x, y) with radius r.

val rectangle : float -> float -> float -> float -> path

Calling rectangle x y w h builds a path representing a rectangle with top left (x, y), width w and height h.

OCaml

Innovation. Community. Security.