# Implementing Simulation of Simplicity for geometric degeneracies

W. Randolph Franklin and Salles Viana Gomes de Magalhães.
**Implementing simulation of simplicity for geometric degeneracies.**
In *4th ACM SIGSPATIAL International Workshop on Spatial Gems (SpatialGems 2022)*. 1 Nov 2022.

[full text]
[BibTeX▼]

## Abstract

We describe how to implement Simulation of Simplicity (SoS). SoS removes geometric degeneracies in point-in-polygon queries, polyhedron intersection, map overlay, and other 2D and 3D geometric and spatial algorithms by determining the effect of adding non-Archimedian infinitesimals of different orders to the coordinates. Then it modifies the geometric predicates to emulate that, and evaluates them in the usual arithmetic. A geometric degeneracy is a coincidence, such as a vertex of one polygon on an edge of another polygon, that would have probability approaching zero if the objects were distributed i.i.d. uniformly. However, in real data, they can occur often. Especially in 3D, there are too many types of degeneracies to reliably enumerate. But, if they are not handled, then predicates evaluate wrong, and the output topology may be wrong. We describe the theory of SoS, and how several algorithms and programs were successfully modified, including volume of the union of many cubes, point location in a 3D mesh, and intersecting 3D meshes.

## Full Text

[download]