38
March 10, 2017 Shape Modeling and Geometry Processing Assignment 2 - Implicit Surfaces Michael Rabinovich - [email protected] Acknowledgments: Olga Diamanti, Christian Schüller

Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017

Shape Modeling and Geometry ProcessingAssignment 2 - Implicit Surfaces

Michael Rabinovich [email protected]

Acknowledgments: Olga Diamanti, Christian Schüller

Page 2: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Assignments

• Please regularly check the main repository for updates and new instruction:‣ https://github.com/eth-igl/GP2018-Assignments

• Any general issues, problems or questions?

Page 3: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Implicit Surface Reconstruction

Page 4: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

• A set of points givenin 3D• And normals per point

Implicit Surface Reconstruction

Page 5: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

• Find a function (scalar-field)

• Value < 0 outside• Value > 0 inside

Implicit Surface Reconstruction

Page 6: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

• Extract the zero-set

• Surface is guaranteed• 2-Manifold• No holes (watertight)

Implicit Surface Reconstruction

Page 7: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Assignment 2

• Input:.off/.obj filewith points and normals

Page 8: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Step 1: Build constraint set

Incorporate normal info width off-surface constraints:

Page 9: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Step 2: Construct Interpolant

• Construct regular grid• Compute nodal scalar field

satisfying constraints(approximately)

• Method: MLS(Moving Least Squares)

Page 10: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

The Least Squares Family

• LS

http://www.nealen.net/projects/mls/asapmls.pdf

• WLS

• MLS

LS

coefficientsleast-square approximation

sample points

value of the desired function at

MLS

Page 11: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Basis function

• For this assignment, we’ll use polynomial basis functions

• For polynomial degree 1 (a plane) we have:

Page 12: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Standard LS reconstruction

• Standard least-squares fit

• Solve a overdetermined linear system (use Eigen library)

Page 13: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Standard LS reconstruction

polynomial basis

• Standard least-squares fit

• Solve a overdetermined linear system (use Eigen library)

Page 14: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Standard LS reconstruction

• Standard least-squares fit

• Solve a overdetermined linear system (use Eigen library)

desired function values

Page 15: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Standard LS reconstruction

• Standard least-squares fit

• Solve a overdetermined linear system (use Eigen library)

coefficients ofpolynomial basis

Page 16: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

MLS reconstruction

• MLS fit 1/2

Page 17: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

MLS reconstruction

• MLS fit

proximity weights proximity weights

: weight function

Page 18: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

• Step 3: Marching Cubes

• Use the marching cubes algorithm to extract the grid function’s zero isosurface

• Use igl::copyleft::marching_cubes

Page 19: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Step 3: Marching Cubes• Look up triangles to be created in each grid cell, based on corner values:

Page 20: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Final Mesh

Page 21: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Provided Example

• Implements pipeline but uses analytic signed distance function for sphere in place of MLS

Page 22: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Provided Example: Implicit Sphere

• Step 1: Compute an axis-aligned bounding box

Page 23: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Provided Example: Implicit Sphere

• Step 2: construct a grid over the bounding box

Page 24: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Provided Example: Implicit Sphere

• Step 3: Fill grid with the values of the implicit function

Page 25: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Provided Example: Implicit Sphere

• Step 4: run marching cubes

input: implicit function values at grid points

Page 26: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Provided Example: Implicit Sphere

• Step 4: run marching cubes

input: grid point positions

Page 27: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Provided Example: Implicit Sphere

• Step 4: run marching cubes

input: grid size (x, y, z)

Page 28: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Provided Example: Implicit Sphere

• Step 4: run marching cubes

output: vertices and faces

Page 29: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

NanoGUI

• IGL Viewer uses NanoGUI:http://nanogui.readthedocs.io/

• You’ll need to add widgets to configure additional variables.

Page 30: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

NanoGUI: Adding Settings

Page 31: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Bonus: Better Normal Constraints

• In the previous, we require the implicit function to approximate some desired values at points

• The normals are simulated in the constraints by using inward and outward value constraints• Leads to undesirable surface oscillation

• Solution: use the normal to define a linear function at each sample point; interpolate these functions with MLS.‣ Chen Shen, James F. O'Brien, and Jonathan R. Shewchuk. "Interpolating and

Approximating Implicit Surfaces from Polygon Soup". In Proceedings of ACM SIGGRAPH 2004, pages 896–904. ACM Press, August 2004. (Section 3.3)

Page 32: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

MLS reconstruction with normal constraints

Page 33: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

MLS reconstruction with normal constraints

function values

Page 34: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 4, 2015 Christian Schüller #

Normal Constraints

x

pk

n

Page 35: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 4, 2015 Christian Schüller #

Normal Constraints

x

pk

n

Page 36: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Bonus: Poisson Reconstruction

• Explicitly fit a scalar function’s gradient to the normal• Smooth out sampled normals to create a global vector

field

• Find scalar function whose gradient best approximates this vector field

• Advantages• No spurious sheets far from surface

• Robust to noise

• Michael Kazhdan, Matthew Bolitho, Hugues Hoppe“Poisson Surface Reconstruction"In Eurographics Symposium on Geometry Processing, 2006

Page 37: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

Assignment 2

• Due-date: Wednesday 23.03.2018• Add results (files/notes) to your private repository,

and refer to them from the ‘README.md’:‣ directory: assignment2/results/

• 16% of the final grade• Bonus tasks: directly added to your exercise grades

• Eg. 67/80 points from mandatory exercises + 4 bonus points = 71/80 • total cannot exceed 80

Page 38: Assignment2 -Implicit Surfaces - ETH Zcrl.ethz.ch/teaching/shape-modeling-18/exercises/ex2_slides.pdf · ‣directory: assignment2/results/ •16% of the final grade •Bonus tasks:directly

March 10, 2017 Christian Schüller #

• Exercise sessions • Office hours: Wednesday, 13:00 - 14:00, CNB 108

• Email: [email protected]

• Appointment• Bug reports/suggestions also welcome!

38

Questions?