Skip to content
AI360Xpert
Beta

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 f(p)f(p) returns the distance from pp to the nearest surface, negative inside and positive outside. The surface is the zero set {p:f(p)=0}\{p : f(p) = 0\}. 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 SS, f(p)=s⋅min⁡q∈S∥p−q∥f(p) = s \cdot \min_{q \in S} \lVert p - q \rVert with s=−1s = -1 inside and +1+1 outside. Valid SDFs satisfy the Eikonal property ∥∇f∥=1\lVert \nabla f \rVert = 1 almost everywhere, and ∇f\nabla f at the surface equals the outward normal. Truncated SDFs clamp to [−τ,τ][-\tau, \tau] with τ=0.1\tau = 0.1 m to bound fusion. Marching cubes extracts the zero set into a mesh.

Worked example

A sphere of radius 1.01.0 m centered at origin has f(p)=∥p∥−1.0f(p) = \lVert p \rVert - 1.0. Point (0.5,0,0)(0.5, 0, 0) gives 0.5−1.0=−0.50.5 - 1.0 = -0.5 m, inside by half a meter. Point (1.2,0,0)(1.2, 0, 0) gives +0.2+0.2 m, outside. Gradient at (1,0,0)(1, 0, 0) is (1,0,0)(1, 0, 0), the outward normal. Truncation at τ=0.1\tau = 0.1 stores −0.1-0.1 instead of −0.5-0.5 far inside.

Watch Out For

Sign flips from unoriented scans

Normals from raw scans point randomly inward or outward, so fusion writes +0.3+0.3 where −0.3-0.3 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 0.10.1 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.