Geometry representations
Signed distance fields
The signed distance function is defined as a function \(S: \mathbb{R}^3 \rightarrow \mathbb{R}\), and returns the signed distance to the object. It has the additional property
The normal vector is always
EBGeometry uses the following convention for the sign:
which means that the normal vector \(\mathbf{n}\) points away from the object.
Conceptually, every signed distance field in EBGeometry is just such a function \(S\), mapping a query point \(\mathbf{x}\) to a distance
Every kind of signed distance field described on the following pages – analytic shapes, surface meshes, and constructive solid geometry (CSG) combinations of either – implements exactly this mapping, which is why they can be freely combined and swapped for one another.
Implicit functions
Like distance functions, implicit functions also determine whether or not a point \(\mathbf{x}\) is inside or outside an object. Signed distance functions are also implicit functions, but not vice versa. For example, the signed distance function for a sphere with center \(\mathbf{x}_0\) and radius \(R\) can be written
An example of an implicit function for the same sphere is
An important difference between these is the Eikonal property in Eq. 1, ensuring that the signed distance function always returns the exact distance to the object. Signed distance functions are more useful objects, but many operations (e.g. CSG unions) do not preserve the signed distance property (but still provide bounds for the signed distance).