2D/3D Shape Manipulation , 3D Printing

55
2D/3D Shape Manipulation, 3D Printing Surface Reconstruction March 6, 2013 Slides from Olga Sorkine

description

2D/3D Shape Manipulation , 3D Printing. Surface Reconstruction. Slides from Olga Sorkine. Geometry Acquisition Pipeline. Scanning: results in range images. Registration: bring all range images to one coordinate system. Stitching / reconstruction: Integration of scans into a single mesh. - PowerPoint PPT Presentation

Transcript of 2D/3D Shape Manipulation , 3D Printing

Page 1: 2D/3D Shape Manipulation , 3D  Printing

2D/3D Shape Manipulation,3D Printing

Surface Reconstruction

March 6, 2013

Slides from Olga Sorkine

Page 2: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Scanning:results in range images

Registration:bring all range images to one coordinate system

Stitching/reconstruction:Integration of scans into a single mesh

Postprocess:• Topological and geometric filtering• Remeshing• Compression

Geometry Acquisition Pipeline

March 6, 2013 2

Page 3: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

4G sample points → 8M triangles1G sample points → 8M triangles

March 6, 2013 3

Digital Michelangelo Project

Page 4: 2D/3D Shape Manipulation , 3D  Printing

Connelly Barnes #

Registration

● Iterative Closest Points (ICP):

Efficient Variants of the ICP Algorithm

March 6, 2013 4

Page 5: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Input to Reconstruction Process

● Input option 1: just a set of 3D points, irregularly spaced Need to estimate

normals next class

● Input option 2: normals come from the range scans

set of raw scans reconstructed model

March 6, 2013 5

Page 6: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

How to Connect the Dots?

● Explicit reconstruction: stitch the range scans together

March 6, 2013 6

Page 7: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

How to Connect the Dots?

● Explicit reconstruction: stitch the range scans together

Connect sample points by triangles

Exact interpolation of sample points

Bad for noisy or misaligned data

Can lead to holes or non-manifold situations

March 6, 2013 7

Page 8: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

How to Connect the Dots?

● Implicit reconstruction: estimate a signed distance function (SDF); extract 0-level set mesh using Marching Cubes

March 6, 2013 8

Page 9: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

How to Connect the Dots?

● Implicit reconstruction: estimate a signed distance function (SDF); extract 0-level set mesh using Marching Cubes

March 6, 2013 9

Page 10: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

How to Connect the Dots?

● Implicit reconstruction: estimate a signed distance function (SDF); extract 0-level set mesh using Marching Cubes

Approximation of input points

Watertight manifold results by construction

March 6, 2013 10

Page 11: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

How to Connect the Dots?

● Implicit reconstruction: estimate a signed distance function (SDF); extract 0-level set mesh using Marching Cubes

Approximation of input points

Watertight manifold results by construction

< 0 > 00

March 6, 2013 11

Page 12: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Implicit vs. Explicit

Input Implicit Explicit

March 6, 2013 12

Page 13: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

SDF from Points and Normals

● Compute signed distance to the tangent plane of the closest point

● Normals help to distinguish between inside and outside

- +

March 6, 2013 13

Page 14: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

SDF from Points and Normals

● Compute signed distance to the tangent plane of the closest point

● Problem??

March 6, 2013 14

Page 15: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

SDF from Points and Normals

● Compute signed distance to the tangent plane of the closest point

● The function will be discontinuous

March 6, 2013 15

Page 16: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Smooth SDF

● Instead find a smooth formulation for F.

● Scattered data interpolation: F is smooth Avoid trivial

0

0

0 0

March 6, 2013 16

Page 17: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Smooth SDF

● Scattered data interpolation: F is smooth Avoid trivial

● Add off-surface constraints

0

0

0 0

March 6, 2013 17

Page 18: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Radial Basis Function Interpolation

● RBF: Weighted sum of shifted, smooth kernels

Scalar weightsUnknowns

Smooth kernels (basis functions)

centered at constrained points.

For example:

March 6, 2013 18

Page 19: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Radial Basis Function Interpolation

● Interpolate the constraints:

0

0

0 0

March 6, 2013 19

Page 20: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Radial Basis Function Interpolation

● Interpolate the constraints:

Symmetric linear system to get the weights:

March 6, 2013 20

Page 21: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

RBF Kernels

● Triharmonic: Globally supported Leads to dense symmetric linear system C2 smoothness Works well for highly irregular sampling

March 6, 2013 21

Page 22: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

RBF Kernels

● Polyharmonic spline

● Multiquadratic

● Gaussian

● B-Spline (compact support)

March 6, 2013 22

Page 23: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

RBF Reconstruction Examples

March 6, 2013 23

Page 24: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Off-Surface Points

Insufficient number/badly placed off-surface points

Properly chosen off-surface points

March 6, 2013 24

Page 25: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Distanceto plane

Compact RBF Global RBFTriharmonic

Comparison of the various SDFs so far

March 6, 2013 25

Page 26: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

RBF – Discussion

● Global definition!

● Global optimization of the weights, even if the basis functions are local

0

0

0 0

March 6, 2013 26

Page 27: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Extracting the Surface● Wish to compute a manifold mesh of

the level set

Imag

e fr

om: w

ww

.farf

ield

tech

nolo

gy.c

om

F(x) > 0 outside

F(x) = 0 surface

F(x) < 0 inside

March 6, 2013 27

Page 28: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Sample the SDF

March 6, 2013 28

Page 29: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Sample the SDF

March 6, 2013 29

Page 30: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Tessellation

• Want to approximate an implicit surface with a mesh

• Can‘t explicitly compute all the roots– Sampling the level set is hard (root finding)

• Solution: find approximate roots by trapping the implicit surface in a grid (lattice)

+- -

-

March 6, 2013 30

Page 31: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Marching Squares

• 16 different configurations in 2D• 4 equivalence classes (up to rotational and

reflection symmetry + complement)

… …

March 6, 2013 31

Page 32: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Tessellation in 2D

• 4 equivalence classes (up to rotational and reflection symmetry + complement)

?

March 6, 2013 32

Page 33: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Tessellation in 2D

• Case 4 is ambiguious:

• Always pick consistently to avoid problems with the resulting mesh

March 6, 2013 33

Page 34: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

3D: Marching Cubes

Layer k+1

Layer k

March 6, 2013 34

Page 35: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Layer k+1

Layer k

• Marching Cubes (Lorensen and Cline 1987) 1. Load 4 layers of the grid

into memory2. Create a cube whose

vertices lie on the two middle layers

3. Classify the vertices of the cube according to theimplicit function (inside, outside or on the surface)

Marching Cubes

March 6, 2013 35

Page 36: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

4. Compute case index. We have 28= 256 cases (0/1 for each of the eight vertices) – can store as 8 bit (1 byte) index.

e1

e4

e9 e10

e5

e6

v1

v6

0 0 0 0 0 01 1index = = 33

e1

e4

e9 e10

e5

e6

v2

v6

e2

e3

e7e8

e11e12

v3v4

v1

v5

v7v8

v1index = v2 v3 v4 v5 v6 v7 v8

Marching Cubes

March 6, 2013 36

Page 37: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Marching Cubes

• Unique cases (by rotation, reflection and complement)

March 6, 2013 37

Page 38: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Tessellation3D – Marching Cubes

5. Using the case index, retrieve the connectivity in the look-up table

• Example: the entry for index 33 in the look-up table indicates that the cut edges are e1; e4; e5; e6; e9 and e10 ; the output triangles are (e1; e9; e4) and (e5; e10; e6).

e1

e4

e9 e10

e5

e6

v1

v6

0 0 0 0 0 01 1index = = 33

March 6, 2013 38

Page 39: 2D/3D Shape Manipulation , 3D  Printing

#

Marching Cubes

6. Compute the position of the cut vertices by linear interpolation:

7. Move to the next cube

March 6, 2013

Page 40: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Marching Cubes – Problems

• Have to make consistent choices for neighboring cubes – otherwise get holes

3 3–

March 6, 2013 40

Page 41: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Marching Cubes – Problems

• Resolving ambiguities

Ambiguity No Ambiguity

March 6, 2013 41

Page 42: 2D/3D Shape Manipulation , 3D  Printing

Connelly Barnes #

Resolving Ambiguities

● Marching Cubes 33

March 6, 2013 42

Page 43: 2D/3D Shape Manipulation , 3D  Printing

Connelly Barnes #

Resolving Ambiguities

March 6, 2013 43

Page 44: 2D/3D Shape Manipulation , 3D  Printing

Connelly Barnes #

Resolving Ambiguities

March 6, 2013 44

Page 45: 2D/3D Shape Manipulation , 3D  Printing

Connelly Barnes #

Marching Cubes 33

March 6, 2013 45

Page 46: 2D/3D Shape Manipulation , 3D  Printing

Connelly Barnes #

Marching Cubes 33

March 6, 2013 46

Page 47: 2D/3D Shape Manipulation , 3D  Printing

Connelly Barnes #

Libraries

● Short, portable code:Paul Bourke -- Marching Cubes / Marching Tetrahedrons

● Part of larger libraries/programs:OpenMeshMeshLab

March 6, 2013 47

Page 48: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Images from: “Dual Marching Cubes: Primal Contouring of Dual Grids” by Schaeffer et al.

Marching Cubes – Problems

● Grid not adaptive● Many polygons required to represent

small features

March 6, 2013 48

Page 49: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Marching Cubes – Problems

March 6, 2013 49

Page 50: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Marching Cubes – Problems

• Problems with short triangle edges– When the surface intersects the cube close to a corner,

the resulting tiny triangle doesn‘t contribute much area to the mesh

– When the intersection is close to an edge of the cube, we get skinny triangles (bad aspect ratio)

• Triangles with short edges waste resources but don‘t contribute to the surface mesh representation

March 6, 2013 50

Page 51: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Grid Snapping

• Solution: threshold the distances between the created vertices and the cube corners

• When the distance is smaller than dsnap we snap the vertex to the cube corner

• If more than one vertex of a triangle is snapped to the same point, we discard that triangle altogether

March 6, 2013 51

Page 52: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Grid Snapping

• With Grid-Snapping one can obtain significant reduction of space consumption

Parameter 0 0,1 0,2 0,3 0,4 0,46 0,495

Vertices 1446 1398 1254 1182 1074 830 830Reduction 0 3,3 13,3 18,3 25,7 42,6 42,6

March 6, 2013 52

Page 53: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Sharp Corners and Features

• (Kobbelt et al. 2001, a.k.a "Extended Marching Cubes"):– Evaluate the normals (use gradient of F)– When they significantly differ, create

additional vertex

March 6, 2013 53

Page 54: 2D/3D Shape Manipulation , 3D  Printing

Olga Sorkine-Hornung #

Sharp Corners and Features

March 6, 2013 54

Page 55: 2D/3D Shape Manipulation , 3D  Printing

Thank You

March 6, 2013