TL;DR

  1. There is no “best” way to encode geometry. Implicit representations define a surface by a condition (easy inside/outside tests, hard to sample). Explicit ones list the points directly (easy to sample, hard inside/outside tests).
  2. A distance field gives the distance to the surface, the normal and the closest point for free.
  3. Marching cubes turns a grid of field values into a triangle mesh (lookup table + linear interpolation). It misses sharp features; dual contouring, dual marching cubes and the differentiable FlexiCubes improve on it.
  4. Poisson surface reconstruction turns an oriented point cloud into a watertight mesh: find the indicator function whose gradient matches the normals, i.e. solve .
  5. Procrustes gives the optimal similarity transform for known correspondences: translation = centroid difference, rotation from the SVD of the cross-covariance, scale = quotient of sums.
  6. ICP alternates between finding closest-point correspondences and solving Procrustes. It converges to a local minimum. Point-to-surface distances and gradient-based ICP improve it.

Exam relevance

Confirmed exam task: a museum has a point cloud of a statue and wants a mesh. Draw the pipeline using a signed distance field, and say what happens at training and at inference time. Minimal answer: point cloud → SDF → marching cubes → mesh. See Putting It Together: From a Point Cloud to a Mesh. The learning overview also lists Procrustes (translation, rotation, scale; know the notation).

The lecture has three parts: 5.0 surface reconstruction (representations of geometry), 5.2 Procrustes alignment, and ICP.

Part 1: Representations of Geometry

How Can We Describe Geometry?

Slides 2-12

To model virtual humans we need the kinematics and transformations (→ Lecture 2.2), then the geometry of the shape, and finally materials, lighting and textures for a photorealistic result. This lecture is about geometry.

A simple circle can be described in many ways: implicitly (), linguistically (“unit circle”), explicitly (), tomographically, dynamically, by symmetry, by curvature (), discretely…

Many ways to describe a circle: implicit, linguistic, explicit, tomographic, dynamic, symmetric, curvature, discrete
Slide 4: how can we describe geometry?

Real geometry is much harder: faces, cloth blowing in the wind, splashing water (shapes that break apart and merge again, like a fluid), a whole city with detail at different scales, a dog with long fur (a nightmare with meshes; a volumetric representation is probably better).

No one "best" choice, geometry is hard!

“I hate meshes. I cannot believe how hard this is. Geometry is hard.” (David Baraff, Senior Research Scientist, Pixar Animation Studios)

Many Ways to Digitally Encode Geometry

Slide 13

ExplicitImplicit
point cloudlevel set
polygon meshalgebraic surface
subdivision, NURBSL-systems
……

Each choice is best suited to a different task or type of geometry. See Implicit and Explicit Representations.

Implicit Representations

Surfaces as an Implicit Function

Slides 14-19

Implicit representation

Points aren’t known directly, but satisfy some relationship. E.g. the unit sphere is all points with . More generally:

The function can be an occupancy indicator (0 outside, 1 inside, see Occupancy Field). The surface is the set of points at a threshold (the boundary):

Occupancy function with points inside and outside a shape
Slide 15: a surface as the level set of an occupancy function.

In graphics, basic primitives (ellipsoids, Gaussian blobs, …) are often combined into complex shapes. In machine learning, the implicit function has no closed form: a neural network approximates it.

A game: I'm thinking of an implicit surface . Find any point on it.

Another game: . Is the point inside?

Algebraic surfaces

Slide 20

The surface is the zero set of a polynomial in (sphere, torus, heart, …). Easy to evaluate and store. But for complicated shapes (a cow, a car) it is very hard to come up with polynomials.

Constructive solid geometry

Slide 21

Build more complicated shapes via Boolean operations: union , intersection , difference . Then chain the expressions into a tree.

Union, intersection and difference of a cylinder and a sphere, and a CSG tree
Slide 21: constructive solid geometry.

Blending distance functions

Slides 22-23

A distance function gives the distance to the closest point on the object. Any two distance functions can be blended, e.g.

The appearance depends on how we combine them.

How do we implement a Boolean union of and ?

Whole scenes can be made of pure signed distance functions (Shadertoy). Art with math, but really hard.

Nowadays: neural distance fields

Slide 24

Storing an implicit function in a 3D grid is costly. Today, a neural network is trained to return, for every point in space, its distance to the surface. From this we recover the surface. Example: Neural Distance Fields (Chibane et al., NeurIPS 2020), which also represent open surfaces with an unsigned distance.

Slide 24: NDF, input point cloud and output.

Distance Field, Normals and Closest Points

Slide 25

A good representation should make closest points and normals easy to compute. With a distance field this is straightforward:

Distance field

Distance to the surface is the field itself:

The surface normal is the gradient of the function:

Closest points are found trivially:

Why is the gradient the normal?

Along the level set the function does not change value. The gradient points in the direction of maximum change, so it must be orthogonal to the level set curve or surface. Hence the gradient is the normal. The closest point is found by walking the distance against the gradient.

Distance field of a bus with its gradient field
Slide 25: distance field and field normals.

See Signed Distance Function.

Surface Reconstruction from an Implicit Representation

Slide 26

  • Implicit surfaces have nice features (e.g. merging and splitting).
  • But complex shapes are hard to describe in closed form.
  • Alternative: store a grid of values approximating the function.
  • The surface is found where the interpolated values equal zero.
Grid of signed values with the zero level curve
Slide 26: a grid of values, the surface is where the interpolation is zero.

Marching Cubes

Slides 27-31

Level sets are widely used in medical imaging, they are great for volumes. Marching cubes extracts a triangle mesh from them:

Marching cubes algorithm

  1. Read four slices into memory.
  2. Scan two slices and create a cube from four neighbors on one slice and four neighbors on the next slice.
  3. Calculate an index for the cube by comparing the eight density values at the cube vertices with the surface constant (inside or outside: cases).
  4. Using the index, look up the list of edges from a precalculated table.
  5. Using the densities at each edge vertex, find the surface-edge intersection via linear interpolation.
  6. Calculate a unit normal at each cube vertex using central differences. Interpolate the normal to each triangle vertex.
  7. Output the triangle vertices and vertex normals.
A cube between two slices of the grid
Slide 27: a cube between two slices
The 15 base cases of the marching cubes lookup table
Slide 28: the lookup table cases

Once we have the values of the implicit function at the cube vertices, we only create mesh vertices in the cubes that the lookup table marks as crossing the surface, by interpolating along their edges.

2D grid with inside and outside vertices and the extracted contour
Slide 30: the extracted contour (2D version: marching squares).

Challenges with marching cubes

  • generates one polygon for each portion of the contour
  • can only approximate the restriction of the contour
  • fails to capture sharp details of the surface
  • the generated mesh is difficult to simplify
  • extracting the surface becomes challenging for higher grid sizes: a 3D uniform grid has cubic cost in the resolution

Trap

A higher resolution does not make sharp edges exact; it only costs 8 times more per doubling.

Dual Contouring

Slides 32-34

  • Can capture sharp edges along the corners of a surface.
  • Uses the gradient information at the edge intersections to reproduce polyhedral shapes as well as curved or sharp edges.
  • Uses an octree instead of a 3D uniform grid for better efficiency.
  • Uses the normals to define a Quadratic Error Function (QEF) for each leaf of the octree (inspired by Extended Marching Cubes):

Dual contouring QEF

: intersections and normals of the contour with the edges of the cube (Hermite data). One vertex is placed per cell: the point that lies as well as possible on all tangent planes ( must be perpendicular to the normal).

Signed grid with Hermite data, marching cubes contour and dual contour
Slide 33: Hermite data, marching cubes contour and dual contour. The dual contour keeps the sharp corner.

Challenges: limited expressivity because of the structured grid; very thin surfaces and features can’t be extracted faithfully (they would need a very fine grid); limited by the amount of surface simplification.

Dual Marching Cubes

Slides 35-36

  • Aligns the features of the implicit function with the features of the structured grid, which enables the extraction of sharp features.
  • Generates adaptive polygonalizations that are crack-free and topologically manifold.
  • Reproduces thin features without excessive subdivision of the octree.

Dual marching cubes QEF

Tangent planes to at sample points over the cell :

The denominator normalizes the contribution of each tangent plane.

Dual contouringDual marching cubes
Samplesonly on sign-changing edges of the cellall sample points in and around the cell
Sample locationon the surface (edge crossings)anywhere, typically cube corners
Data per sampleposition + normal (Hermite data)field value + gradient
QEF minimizesdistance to tangent planesmismatch between local linear models and the field

Comparison and FlexiCubes

Slides 37-39

  • MC fails to capture sharp features.
  • DC captures sharp features, but can produce non-manifold vertices.
  • DMC does not introduce non-manifold vertices and generates crack-free adaptive polygonalizations.
MC, DC and DMC on the same 2D grid
Slide 37: MC vs. DC vs. DMC
Rocket model extracted with the three methods
Slide 38: ground truth, DMC, MC, DC

FlexiCubes (flexible iso-surface extraction): the classical methods are non-differentiable. If a neural network predicts the surface, we can’t supervise directly on the extracted mesh. FlexiCubes is an iso-surface representation designed for optimizing an unknown mesh w.r.t. geometric, visual or even physical objectives. It adds carefully chosen parameters that locally adjust the extracted mesh geometry and connectivity. They are updated together with the scalar field via automatic differentiation.

Slide 39: FlexiCubes.

Trap

FlexiCubes is not “a faster marching cubes”. Its point is that it is differentiable.

Level Sets: Storage and Pros & Cons

Slides 40-41

Although a level set gives much more explicit control over the shape (like a texture), it

  • runs into problems of aliasing (unlike closed-form expressions)
  • induces storage for 3D surface extraction
  • can save space by only storing a narrow band around the surface

Implicit representations: pros and cons

Pros:

  • the description can be very compact (e.g. a polynomial)
  • easy to determine if a point is in the shape (just plug it in!)
  • other queries may also be easy (e.g. distance to the surface)
  • for simple shapes, exact description, no sampling error
  • easy to handle changes in topology (e.g. fluid)

Cons:

  • expensive to find all points in the shape (e.g. for drawing)
  • very difficult to model complex shapes

Explicit Representations

”Explicit” Representations of Geometry

Slides 42-48

Explicit representation

All points are given directly. E.g. the points on the sphere are for and . More generally:

(There might be many of these maps, e.g. one per triangle.)

Examples: triangle meshes, polygon meshes, subdivision surfaces, NURBS, point clouds.

A game: my surface is . Give me some points on it.

My surface is the torus . Is the point inside?

Conclusion

Some representations work better than others, it depends on the task!

ImplicitExplicit
Inside/outside testeasy (plug in)hard
Sampling pointshardeasy (plug in )

Point Clouds

Slide 49

  • Easiest representation: a list of points , often augmented with normals.
  • Easily represents any kind of geometry.
  • Easy to draw a dense cloud ( point per pixel).
  • Hard to interpolate under-sampled regions.
  • Hard to do processing, simulation, …

Point clouds are the output of many 3D scanners and reconstruction methods (SfM, MVS). See Point Cloud.

From Points to Surfaces: Poisson Surface Reconstruction

Slides 50-54

Why do we need surface reconstruction?

  • Point clouds are discrete and unordered: no connectivity or topology.
  • Downstream tasks (rendering, simulation, 3D printing) need a continuous surface.
  • Goal: a method that is global, robust to noise, and produces watertight meshes.
  • Key idea: recast surface reconstruction as solving a Poisson equation.

Reconstructing a surface from a point cloud is underdetermined. Given an oriented point cloud, we look for an indicator function (1 inside, 0 outside). Its gradient is zero almost everywhere (the indicator is constant almost everywhere), except near the surface, where it equals the inward surface normal. So the oriented point samples can be viewed as samples of the gradient of the indicator function.

Oriented points, indicator gradient, indicator function, surface
Slide 51: oriented points V → indicator gradient ∇χ → indicator function χ → surface ∂M (Kazhdan et al., 2006).

Poisson surface reconstruction (Kazhdan et al., 2006)

Given an oriented point cloud with points and outward normals , find with

Step 1: interpolate the normals into a vector field with a convolutional kernel , in a box containing the points:

Step 2: find the function whose gradient best matches :

This variational problem is equivalent to the Poisson equation

solved by discretization with the finite element method on an octree and a purpose-built multigrid algorithm.

Screened PSR (Kazhdan and Hoppe, 2013) adds a term that pulls the function to zero at the input points:

(Screened) Poisson Reconstruction

Slides 55-60

  • It can extract the surface from oriented point clouds.
  • Screened PSR efficiently implements sparsity constraints and captures the details of the surface better.
  • Screened PSR uses an efficient octree and multigrid algorithm to reduce the time complexity.

However, these methods only output the likeliest surface given the points and their assumed prior. In reality there could be infinitely many surfaces for the same set of points with normals.

In the comparison, Poisson reconstruction (and to a lesser extent SSD) over-smooths the data, wavelet reconstruction has derivative discontinuities, and screened Poisson fits the samples faithfully without introducing noise.

Neptune and David reconstructed with Poisson, wavelet, SSD and screened Poisson
Slide 56: Poisson, wavelet, SSD and screened Poisson reconstructions.

Neural Stochastic Screened PSR (Sellan and Jacobson, SIGGRAPH Asia 2023) goes a step further: it models the posterior distribution (a Gaussian) over all possible reconstructions. Mean and covariance of the implicit field are parameterized with neural networks and optimized with gradient-based methods on losses derived from the variational Poisson equation. This allows statistical queries: the probability that a point is inside the shape, , or on the surface. In theory it strictly generalizes PSR; in practice its volumetric smoothness prior avoids overfitting. It can even suggest where to scan next.

Surface likelihood, volumetric likelihood, variance and mean of the reconstruction
Slide 58: neural stochastic screened PSR.

Trap

PSR does not interpolate the points exactly, it smooths (over-smoothing). Screened PSR still needs normals: the gradient term remains.

Polygon Meshes

Slides 61-64

  • Store vertices and polygons (most often triangles or quads).
  • Easier processing and simulation, adaptive sampling.
  • More complicated data structures, irregular neighborhoods.
  • Lightweight and easy to manipulate. Problem: topology!

Triangle mesh:

  • vertices as triples of coordinates
  • triangles as triples of vertex indices (e.g. a tetrahedron: 4 vertices, 4 triangles)
  • points inside a triangle via barycentric interpolation: with ,
Tetrahedron with vertex and triangle tables and barycentric coordinates
Slide 62: triangle mesh and barycentric interpolation.

Mesh normals

Option 1, one normal per face:

Option 2, interpolate the incident face normals at each vertex, then use barycentric interpolation inside the triangle:

Distance queries and closest points:

  • Smooth parametric surface: evaluation , normals . The closest surface point to is the with (the difference is parallel to the normal).
  • Mesh: find the closest triangle, then the closest point in that triangle. Use a kd-tree or AABB tree to find the closest triangles.

See Mesh.

Subdivision

Slides 65-68

An alternative starting point for curves and surfaces:

  • Start with a “control curve”.
  • Repeatedly split, and take a weighted average to get new positions.
  • For a careful choice of averaging rule, this approaches a nice limit curve, often exactly the same curve as well-known spline schemes!
Control polygon refined by subdivision into a smooth curve
Slide 65: subdivision of a control curve.

Is subdivision an explicit or an implicit representation?

Subdivision surfaces:

  • Start with a coarse polygon mesh (“control cage”), subdivide each element, update the vertices via local averaging.
  • Many possible rules: Catmull-Clark (quads), Loop (triangles), …
  • Common issues: interpolating or approximating (does the limit surface pass through the control points?), continuity at vertices (where more or fewer than 4 patches meet).
  • Easier than splines for modeling; harder to evaluate pointwise.
  • Widely used in practice: one of the first uses in animation was Pixar’s short film Geri’s Game. Tony DeRose, Michael Kass and Tien Truong received an Academy Award for their work on subdivision surfaces. In computer vision, e.g. What shapes are dolphins? (Cashman & Fitzgibbon).
Control cage subdivided several times into a smooth surface
Slide 67: subdivision surfaces.

Part 2: Procrustes Alignment

Aligning Point Clouds to a Common Frame

Slides 70-72, 86-99

Motivation: to learn a model of human pose and shape (like SMPL, ), we scan a lot of people in lots of poses. To learn a model we need correspondences between all these scans and a template. That needs non-rigid articulated registration; the first step is rigid alignment.

Many scans of people brought into correspondence with one template
Slide 90: to learn a model we need correspondence.

A mesh is (faces and vertices). How can we transform the set of points ?

Combined: , or in homogeneous coordinates

A point rotated, scaled and translated
Slide 99: rigid transformation + scale.

Procrustes alignment problem

Given two point sets and with known correspondences, find scale, rotation and translation:

Name: Procrustes is a bandit from Greek mythology who made his victims fit his bed by stretching their limbs or cutting them off (“he who stretches”).

Two human point clouds V and V' to be aligned
Slide 71: the Procrustes alignment problem.

Optimization Problem and SVD Recap

Slides 73-74

Is it linear or quadratic in the parameters? Quadratic in and , but must stay a rotation. It still has a closed-form solution, with the SVD:

Warning

The of the SVD is not the vertex matrix!

Procrustes Solution

Slide 75

Procrustes alignment steps

Matrices of points , , centered versions (centroid subtracted).

Rotation: SVD of the point cross-covariance

Scale: a quotient of eigenvalue sums

Translation: the centroid difference

( here are the centroids.)

Sign of t

Slide 75 writes , but the derivation on Slide 78 gives . The derivation is right: with , the centroids must map onto each other.

Trap

Procrustes does not find correspondences. They are its input.

Proof

Slides 76-84

Note

In practice one also checks : if it is , the result is a reflection, and the sign of the last column of is flipped. This is not on the slides.

Part 3: Iterative Closest Point (ICP)

What Is Missing?

Slides 117-126

Given correspondences, Procrustes finds the optimal rigid alignment. Problems:

  • How do we find the correspondences between shapes?
  • How do we align shapes non-rigidly?

Two tools: ICP optimizes alignment and correspondences together; continuous optimization handles general deformations.

The optimization is over the transform and the correspondences . With the closest point to the target shape point (and containing translation, rotation and isotropic scale):

Correspondence energy over transform and correspondences
Slide 124: optimize over the transform and the correspondences.

Solution: Iteratively Find Correspondences

Slides 127-138

What if we estimate the correspondences? Alternate between the two:

Alternation

Given the current best transformation, which are the closest correspondences?

Given the current best correspondences, which is the best transformation? (solved with Procrustes)

Walkthrough on the slides: start with a neutral initialization (initializing to align the centroids should work better!), make up reasonable correspondences (closest points), solve for the best transformation with Procrustes, apply it, and iterate until the shapes overlap.

Initial closest point correspondences
Slide 130: closest points
All correspondences, then solve with Procrustes
Slide 132: solve with Procrustes
After several iterations the shapes overlap
Slide 135: iterate

The ICP Algorithm

Slides 139-143

Iterative Closest Point (ICP)

  1. Initialize (typically better than 0: align the centroids)
  1. Compute correspondences according to the current best transform:
  1. Compute the optimal transformation with Procrustes:
  1. Terminate if converged (error below a threshold), otherwise iterate.
  2. Converges to local minima.
flowchart LR
  I["Initialize f⁰<br/>(align centroids)"] --> C["Closest points<br/>(correspondences)"]
  C --> P["Procrustes:<br/>best s, R, t"]
  P --> A["Apply transform"]
  A --> T{"Converged?"}
  T -- "no" --> C
  T -- "yes" --> D["Done<br/>(local minimum)"]

Trap

ICP finds only a local minimum, not the global optimum. A bad initialization gives a wrong alignment.

Is ICP the Best We Can Do?

Slides 144-150

Computing closest points:

  • Brute force is (for every point, check every point).
  • Tree-based methods (e.g. kd-tree) have an average complexity of per query.
  • Random point sampling also reduces the running time.
Brute force closest point search
Slide 145: brute force O(n²)
kd-tree partition of the points
Slide 146: kd-tree

ICP: tips to avoid local minima

  • Always find correspondences from target to source (proper data term).
  • Outliers → robust cost functions.
  • Use additional information (e.g. normals).
  • Compute the transformation from greedy subsets of points: RANSAC.

A much better objective: point-to-surface distance. Instead of the distance to the closest vertex of the target mesh (point-to-point), use the distance to the closest point on the surface (point-to-surface). The point-to-point closest vertex can be far away from the real closest surface point.

Point-to-point distance to the nearest vertex
Slide 149: point-to-point
Point-to-surface distance to the triangle
Slide 150: point-to-surface

Gradient-Based ICP

Slides 151-166

Procrustes gives the optimal rigid transformation and scale for given correspondences. What if the deformation model is not rigid? Can we generalize ICP to non-rigid deformation?

Instead of the optimal transformation, we only compute a transform that reduces the error: a descent step, by linearizing the energy (the Jacobian of the distance-based energy).

  • If is a rigid transformation, we can solve this with Procrustes.
  • If is a general non-linear function: gradient descent .
  • For least squares there is a better method: Gauss-Newton based methods.

Gradient-based ICP

  1. Energy:
  2. Consider the correspondences fixed in each iteration :
  3. Compute the gradient of the energy around the current estimate:
  4. Apply a step (gradient descent, dogleg, LM, BFGS, …): , for example
  5. Terminate if converged, otherwise iterate (go to step 2).
Registration with point-to-point vs point-to-surface objective
Slide 159: why is convergence with the point-to-point objective (left) less smooth? The correspondences jump between vertices.

The gradient is the derivative of the sum of squared distances w.r.t. the parameters of . Each derivative is easy, but nobody wants to write them all down: chain rule and automatic differentiation. Write the energy as if it was numpy code; it becomes an expression tree with Jacobians available at each step.

Why gradient-based ICP?

  • The formulation is much more generic: the energy can include other terms, more parameters, etc.
  • Lots of software for solving the least squares problem (cvx, Ceres, …).
  • However, for general deformation models the energy is non-convex. The optimization can get trapped in local minima.

Take-home message

  • Procrustes is optimal for rigid alignment problems with known correspondences.
  • For other problems, compute correspondences and solve for the best transformation iteratively with ICP.

Putting It Together: From a Point Cloud to a Mesh

The exam scenario: a museum has a point cloud of a statue (200 points) and wants a mesh, using a signed distance field. This page covers the classical tools; the learned SDF (DeepSDF, neural implicits) follows in Lecture 6.1.

flowchart LR
  P["Point cloud<br/>(+ normals)"] --> F["Implicit field<br/>SDF / indicator<br/>(PSR, or a network)"]
  F --> G["Evaluate on a grid"]
  G --> M["Marching cubes<br/>(level set f = 0)"]
  M --> O["Triangle mesh"]
StepWhat it needsNotes
Point cloud → implicit fieldoriented normals for PSR; for a learned SDF, a trained networkinside/outside comes from the normals (PSR) or is learned
Field → gridevaluate at grid verticescubic cost in the resolution
Grid → meshmarching cubes on the zero level setsharp features lost; dual contouring / DMC are better; FlexiCubes if it has to be differentiable

Training vs. inference (for a learned SDF)

Training: a network learns to predict the signed distance (or occupancy) of 3D query points from data where the ground truth distances are known (needs watertight shapes). Inference: encode the new point cloud, query the network on a dense grid, run marching cubes on the zero level set to get the mesh.

Why can't we compute a signed distance directly from the raw point cloud?

Self-Test

What is the difference between implicit and explicit representations? Which tasks does each make easy?

How do you get the normal and the closest surface point from a distance field?

How do you implement the union of two distance functions?

Describe marching cubes and its weaknesses.

What does dual contouring do better, and what does it need?

Why FlexiCubes?

Explain Poisson surface reconstruction.

Is subdivision explicit or implicit?

Give the Procrustes solution for , , .

Why is optimal?

Describe ICP. What does it converge to?

How can ICP be improved?