Class cInt

Clipper integer.

Notes from Clipper's docs: The IntPoint structure is used to represent all vertices in the Clipper Library. An integer storage type has been deliberately chosen to preserve numerical robustness. (Early versions of the library used floating point coordinates, but it became apparent that floating point imprecision would always cause occasional errors.)

A sequence of IntPoints are contained within a Path structure to represent a single contour.

Users wishing to clip or offset polygons containing floating point coordinates need to use appropriate scaling when converting these values to and from IntPoints.

See also the notes on rounding.

And elsewhere, with minor edits:

cInt is the integer type used by the Clipper Library to represent vertex coordinate values.

The library uses integers instead of floating point values to preserve numerical robustness. (Very early versions of the library used floating point coordinates, but it became apparent that floating point imprecision was always going to cause occasional errors.)

cInt represents a signed 64-bit integer and polygon coordinates can have any value in the range ±9.2e+18 (2^63). This accommodates the scaling of floating point coordinate values to very large integers so that very high degrees of precision can be retained during clipping. However, if coordinate values can be kept within the range ±3.0e+9, then by avoiding large integer math, a modest ~10% improvement in clipping performance is achieved.

(Note that Lua uses doubles. Beyond 2^53, only some integers are representable.)

generated by LDoc 1.4.6 Last updated 2018-08-13 18:06:38