Module Hugin_gg
Geometry and colour.
These are the values every other Hugin library speaks in: points P2, boxes Box2, affine maps Affine, paths Path and the pen that strokes them Stroke, and colours Color. The library depends on nothing.
Conventions
- The plane. The x axis points right and the y axis points down, as on a page or a screen. Units are the caller's; Hugin uses points, 1/72 inch. Angles are in radians, and a positive angle turns from the positive x axis towards the positive y axis, clockwise on screen.
- Argument order. Functions that build or transform a value take it last, so they chain with
|>:Path.empty |> Path.move_to p |> Path.line_to q.Path.appendfollows the rule, which makes it the opposite ofList.append. - Equality.
equalfunctions compare structure, with floats compared byFloat.equal, sonanequalsnanand0.equals-0.. One shape can have several structures: a rectangle fromPath.rectand the same rectangle drawn from another corner are not equal.comparefunctions are total orders compatible withequal. - Printing.
ppfunctions format values for debugging and tests. Their output may change between releases unless the function says otherwise. - Non-finite numbers. Points and affine maps hold any floats, and functions on them follow float arithmetic: a non-finite coordinate or coefficient makes the points it reaches non-finite. In a path such points are gaps (Gaps). Boxes, stroke styles and colours never hold a non-finite number: their constructors raise
Invalid_argument, as each states.