-
Notifications
You must be signed in to change notification settings - Fork 42
The Number Types
CGAL provides a number of kernels depending on the level of precision needed. The exact representation the kernel uses can vary but CGALDotNet provides 5 premade kernels. The kernels are as follows.
This is the lowest level of precision offered and stands for exact predicates inexact construction kernel. Internally this representation uses double precision and offers the fastest computation at the cost of finite precision.
This is generally the recommended kernel to use and offers variable precision through MP_Float. This representation can vary the number of bytes used to represent multi-precision floating point values. This is a trade off in memory and performance but is optimized to use a double representation when multi-precision is not actually needed to represent the number.
While the EEK kernel offers variable precision it can not represent infinite numbers like the square root of two. These last 3 kernels support algorithms requiring roots. These kernel are only needed for certain algorithm's like those using circular geometry. As such they are not implemented for all algorithms and may throw a exception if a objects is created with one of these kernels when it is not supported.
Most objects also offer a function to convert from one kernel to the other.
//Convert EEK polygon to a EIK polygon.
var eik_polygon = eek_polygon.Convert<EIK>();
For more information see CGALs page on number types and the class reference here