mesh editing: deformation & other operationssheffa/dgp/ppts/edit.pdf · in least square fashion...

16
1 University of British Columbia Mesh Editing: Deformation & Other Operations University of British Columbia Deformation Modify global shape preserve local features & global continuity Control mechanism anchors (triangles/vertices) – moved by user Region of influence (ROI)

Upload: others

Post on 25-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

1

University ofBritish Columbia

Mesh Editing: Deformation & Other Operations

University ofBritish Columbia

Deformation

Modify global shape preserve local features & global continuity

Control mechanism anchors (triangles/vertices) – moved by user Region of influence (ROI)

Page 2: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

2

University ofBritish Columbia

Capturing Geometry - Local Coordinates

Define local geometry Vertex Based Triangle Based

Preserve under deformation

University ofBritish Columbia

Local coordinates - Laplacian

( )

1i i j

j N i id

δ v v

( )

1i i j

j N iid

δ v v v correlates to via

=L v

0i

ij

d i jD

otherwise

otherwise

jNiAij 0

)(1

1L I D A Can always add weights:

( )

( )

ij i jj N ii

ijj N i

w

w

v v

Page 3: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

3

University ofBritish Columbia

Surface Reconstruction Pose new constraints on mesh

c = set of constraints

Minimize error in reconstructed surface In least square fashion

ciii ;uv

ci

ii

n

iii LE

2

1

2')'()'( uvvV

University ofBritish Columbia

Least Square Fitting

Ax=b with m equations, n unknowns

Least square solution: x=(ATA)-1ATb

Use your favourite solver to solve ATA x = ATb

Page 4: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

4

University ofBritish Columbia

Problem

Only translation invariant

University ofBritish Columbia

Laplacian Coordinates

Translation invariant Not rotation/scale invariant

δi

3);()( ttvv iii LL

δiδi

Page 5: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

5

University ofBritish Columbia

Solution

Add rotations into framework

Interleave rotate/position (local/global) iterations

Challenge Too local… (consistency between adjacent

umbrellas)

ci

ii

n

iiii LRE

2

1

2')'()'( uvvV

University ofBritish Columbia

As-Rigid-As-Possible Surface Modelling

12

Page 6: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

6

University ofBritish Columbia

As-rigid-as-possible (ARAP)

13

University ofBritish Columbia

ARAP in a nutshell…

• Decompose surface into small overlapping “cells”• Measure local rigidity => define local rotations • Non-linear but small

• Use to solve globally• Quadratic

15

Page 7: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

7

University ofBritish Columbia

Cell Construction

Characterize local shape Used to enforce local rigidity constraints Overlapping, to prevent shearing/stretching at cell boundaries

Desired Properties:

16

University ofBritish Columbia

Cell Construction

Vertex Umbrella Covers entire surface One cell per vertex All triangles exist in 3 cells

Within cell, define translation-invariant “features”:• Vectors from central vertex to neighbours

pipj1

pj2

eij1

Simplest logical choice for cells?

17

Page 8: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

8

University ofBritish Columbia

Local “Rigidity” If cell i moved as a rigid unit, we could write:

pipj1

eij1

p'i

p'j1

e'ij1

• What if they didn’t move as a rigid unit?

7

University ofBritish Columbia

Edge WeightsShould all edge vectors be weighted equally?

19

Uniform Weights Cotangent Weights

Cotangent weights:pi

pj

ij

ij

Page 9: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

9

University ofBritish Columbia

Global Rigidity

Rigid Error 𝐶 , 𝐶′ 𝑤 𝒑 𝒑′ 𝑅 𝒑 𝒑∈

• Given 𝒑 and 𝒑 , what are the optimal rigid transforms {𝑅 ? ◦ Least squares + SVD!!!

20

Local Rigidity:

All local cells as-rigid-as-possible global shape is as-rigid-as-possible

Global energy function:

Energy 𝑤 𝒑 𝒑′ 𝑅 𝒑 𝒑∈

Global Rigidity:

University ofBritish Columbia

Mesh Deformation

soft constraints

• Positional constraints: 𝒑 𝒖 , 𝑖 ∈ 𝐶

• Determine locations 𝒑 for all points by minimizing global energy

Energy 𝑤 𝒑 𝒑′ 𝑅 𝒑 𝒑∈

𝜇 𝑤 𝒑 𝒖∈

Caveats:• 𝒑 and 𝑅 are unknown

• Non-linear optimization problem

21

Page 10: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

10

University ofBritish Columbia

Mesh DeformationSolution:

Start with initial guess of 𝒑 , solve for 𝑅 Compute for each cell independently ( L.S. + SVD ) Embarrassingly parallel

Given 𝑅 , minimize energy to find 𝒑

𝑤 𝒑 𝒑∈

𝑤2

𝑅 𝑅 𝒑 𝒑∈

𝐿𝒑′ 𝒃

22

University ofBritish Columbia

Advantages “L” is only a function of the cotangent

weights Depends only on original mesh Only needs to be factored ONCE!! Sparse linear system

Rotations can be computed in parallel

FAST!!

• Each iteration reduces energy◦ Updating rotations guaranteed to reduce cell-error◦ Updating positions guaranteed to reduce global error

Gauranteed Convergence!!12

Page 11: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

11

University ofBritish Columbia

Results (vs Poisson)

Poisson:

ARAP:

25

University ofBritish Columbia

ARAP summary Method tries to keep “cells” as-rigid-as-possible Requires:

Estimating rotation per umbrella Minimizing global energy iteratively

Advantages: Fast Guaranteed convergence (to something...) (Almost) Edge-length preserving Easy to implement

Disadvantages Non-linear optimization Depends on mesh resolution Not volume-preserving

29

Page 12: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

12

University ofBritish Columbia

More Model Editing: Composition

Specify parts to glue – cut boundaries Align/specify correspondence Create common connectivity Define smooth geometry transition

University ofBritish Columbia

More Model Editing: Morphing

Require common connectivity & feature correspondence

Vertex trajectories preserve shape avoid (as much as possible) self-intersections

Page 13: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

13

University ofBritish Columbia

More Model Editing: Blending

Special case of morphing Single frame with non-uniform (smooth) time

parameter

=

+

+3K 3.5K

4K 4.5K

University ofBritish Columbia

Numerical Issues

Page 14: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

14

University ofBritish Columbia

Minimization (Unconstrained)

To find x that minimizes F(x) – find x such that F’(x)=0 Check if got minimum/maximum/saddle point Note: finds LOCAL minimum

Typically no need for explicit check (assume function does not have maxima/saddles

Translate problem into: find x such that f(x)=0

University ofBritish Columbia

Minimization with Constraints

Need to Find x such that F(x) minimal WHEN constraints c(x) = 0 satisfied

Achieved when F’(x)=c’(x)

for unknown General formulation

F*(x,)=F(x)+c(x)

Find x, which extremize F*

Known as min-max min on x max on

Page 15: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

15

University ofBritish Columbia

Solution Use Lagrange Multipliers

Solve the min-max problem (minimum on x, maximum on )

Reached when all derivatives are zero

Have linear (or non-linear) system of equations If non linear - use Newton method to solve

F*(x,)=F(x)+c(x)

University ofBritish Columbia

Solving Linear System

Solve Ax=B (A nn matrix) Choice I: Compute A-1 O(n3) TERRIBLY

expensive Choice II: Iterative (Gauss/Gauss-Seidel)

Set x to initial guess Solve one equation at a time

Aix=Bi - consider all xj (j i) as constant and compute xi

xi = (bi-ajxj)/ai

Repeat (for all i) till convergence Works only for a very small set of matrices

Page 16: Mesh Editing: Deformation & Other Operationssheffa/dgp/ppts/edit.pdf · In least square fashion vi ui;i c i c i i n i E i L i 2 1 (V') (v')2 v' u University of British Columbia Least

16

University ofBritish Columbia

Solving Linear System

Choice III: LU (or LDLT) decomposition Compute matrices L & U such that

LU=A

L – lower matrix (has 1’s on diagonal & 0’s above) U – upper matrix (has 0’s below diagonal Use off-the-shelf algorithm/code

Take advantage of sparsity (if applicable) Solve:

Solve Ly=B (use Gauss iterations) Works (at each point add ONE variable)

Solve Ux=y (use Gauss iterations) Start from i=n-1 and go “up” Works (at each point add ONE variable)