Signed Distance Functions in 3D
A signed distance function answers how far any point sits from the surface and whether it lies inside or outside.
Why Does This Exist?
Meshes and points describe the surface itself but cannot answer inside versus outside. Planning, collision, and fusion need that answer everywhere. A signed distance function returns the distance from to the nearest surface, negative inside and positive outside. The surface is the zero set . This page covers the field view; learned versions live in neural SDFs.
Think of It Like This
Depth marks painted through a frozen lake
Drill holes through lake ice and paint each water layer by depth below the surface, with ice layers marked negative above water. Any diver reading a mark knows distance to the surface and which side they are on without seeing the surface.
Sign is the side and magnitude is the meters. The analogy stops at nearest-surface detail: real SDFs track the closest point, not just vertical depth.
How It Actually Works
For surface , with inside and outside. Valid SDFs satisfy the Eikonal property almost everywhere, and at the surface equals the outward normal. Truncated SDFs clamp to with m to bound fusion. Marching cubes extracts the zero set into a mesh.
Worked example
A sphere of radius m centered at origin has . Point gives m, inside by half a meter. Point gives m, outside. Gradient at is , the outward normal. Truncation at stores instead of far inside.
Watch Out For
Sign flips from unoriented scans
Normals from raw scans point randomly inward or outward, so fusion writes where belongs and the surface cancels out. Orient normals consistently before integrating, or the zero set vanishes.
The Quick Version
- SDFs store signed meters to the surface; zero is the shape.
- The gradient has unit length and gives the surface normal.
- Truncation at about m bounds memory during fusion.
- Do not use SDFs for open sheets with no clear inside; use unsigned distance.
- Marching cubes turns the zero set back into a mesh for display.