Home - govert/RobustGeometry.NET GitHub Wiki

Solution structure

The following projects form part of the solution.

  • RobustGeometry - main library containing:

    • Predicates - C# port of Shewchuk's exact arithmetic and geometric predicates.
    • HalfedgeMesh - data structure for polygon mesh representation
    • Triangulation - Delaunay triangulation routines (TODO)
  • RobustGeometry.Test - unit test library, with various helpers. Also contains:

    • FpuControl helper for accessing x86 FPU control state, and various tests to explore floating-point arithmetic.
    • Printing and parsing of binary floating-point representations.
  • RobustGeometry.Wpf - Integration with WPF and WPF 3D for visualization (TODO)

  • RobustGeometry.Viewer

Exact arithmetic and floating-point in .NET

To understand whether the exact arithmetic and hence the geometric predicates could be implemented correctly in .NET, I explored floating-point arithmetic in .NET. My conclusion is that under default settings using 'Float64' doubles, the .NET runtime behaves as expected. The actual ECMA/ISO CLI specification allows a more flexible implementation which could be problematic, but is not used in practice. For additional safety it would be possible to check or control the relevant FPU control state.