introduction to computer graphics modeling (3)

44
Introduction to Computer Graphics – Modeling (3) – April 28, 2016 Kenshi Takayama

Upload: others

Post on 28-Mar-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

• Main usage:
Predicate function of a solid model
• Function that returns true/false if a 3D point ∈ 3 is inside/outside of the model :3 true, false
• The whole interior of the model: = true } ⊂ 3
• Examples:
4
Sphere of radius centered at
− < , , min < < max
∧ min < < max
∧ min < < max
5
Union
Intersection
Subtraction
Solid model represented by Singed Distance Field
• Shortest distance from 3D point to model surface: :3 • Signed: positive/negative for outside/inside
• Corresponding predicate: () < 0
• Zero isosurface model surface: { | () = 0} ⊂ 3
• Aka. “implicit” or “volumetric” representation
• Gradient () matches with normal direction
6
− −
Examples of implicit functions
7
Torus with major & minor radii R & a Not necessarily distance functions
Examples of implicit functions: Metaballs
8
= 1 − 2()
= 1 + 2()
= −
− = 1 + 2 + 3 + 4 c1
c4
c3
c2
9
Modeling by combining implicit functions
10
Visualizing implicit functions: Marching Cubes
• Extract isosurface as triangle mesh
• For every lattice cell: (1) Compute function values at 8 corners
(2) Determine type of output triangles based on the sign pattern • Classified into 15 using symmetry
(3) Determine vertex positions by linearly interpolating function values
• Once with patent issue, now expired
11Marching Cubes: A High Resolution 3D Surface Construction Algorithm [Lorensen SIGGRAPH87]
Ambiguity in Marching Cubes
12The asymptotic decider: resolving the ambiguity in marching cubes [Nielson VIS91]
Discontinuous faces across neighboring cells New rules to resolve ambiguity
Marching Tetrahedra
• Use tetrahedra instead of cubes • Fewer patterns, no ambiguity Simpler implementation
• A cube split into 6 tetrahedra • (Make sure consistent splitting across neighboring cubes)
• Some techniques to improve mesh quality
13
http://paulbourke.net/geometry/polygonise/
14
Dual Contouring of Hermite Data [Ju SIGGRAPH02]
http://www.graphics.rwth-aachen.de/IsoEx/
Marching Cubes Improved version Marching Cubes (only uses function values)
Improved version (uses function gradient as well)
• Volumetric representation (=isosurface extraction using MC) Approximation accuracy depends on grid resolution
• CSG with surface representation only Exactly keep original mesh geometry
• Difficult to implement robust & efficient • Floating point error
• Exactly coplanar faces
15
Exact and Robust (Self-)Intersections for Polygonal Meshes [Campen EG10]
Mesh Arrangements for Solid Geometry [Zhou SIGGRAPH16]
16 Simplification and Repair of Polygonal Models Using Volumetric Techniques [Nooruddin TVCG03]
Robust Inside-Outside Segmentation using Generalized Winding Numbers [Jacobson SIGGRAPH13]
Decide inside/outside
17
• Sometimes noise-laden 18
• Input: N points
• Coordinate = , , & normal = x, y , z , ∈ 1,… ,
• Output: function () satisfying value & gradient constraints • = 0
• =
• “Scattered Data Interpolation” • Moving Least Squares
• Radial Basis Function Important to other fields (e.g. Machine Learning) as well
19

• Additional value constraints at offset locations • Simple
• Directly include gradient constraint in the mathematical formulation (Hermite interpolation) • High-quality
20
Hermite Radial Basis Functions Implicits [Macedo CGF10]
Value+gradient constraints Hermite interpolation Simple offsetting
Interpolation using Moving Least Squares
21
Starting point: Least SQuares
• For now, assume the function as linear: = + + + • Unknowns: , , ,
• Value constraints at data points
• (Forget about gradient constraints for now) 22
(, , )
1

=
1 = 1 + 1 + 1 + = 1 2 = 2 + 2 + 2 + = 2
= + + + =

• #unknowns < #constraints (i.e. taller matrix) cannot exactly satisfy all the constraints
• Minimizing fitting error


Geometric interpretation of LSQ
• Project onto a plane spanned by & • Fitting error = projection distance
2 = + − 2
24
• Minimize the following fitting error:
=1
25
1

=
=
Moving Least Squares
• Weight is a function of evaluation point : = ( − )
• Popular choices for the function (kernel):
• = − 2/2
• = 1
2+2
• Weighting matrix is a function of Coeffs , , , are functions of
27
() () () ()
Larger the weight as
Introducing gradient (normal) constraints
• Consider linear function represented by each data point: = + −

=1
28
1

1 2
Introducing gradient (normal) constraints
Input : Polygon Soup Interpolation Approximation 1 Approximation 2 Approximation 3
Interpolation using Radial Basis Functions
30
= =1
( − )
• Radial Basis Function () : only depends on the length of
• = − 2/2 (Gaussian)
• = 1
2+2 (Inverse Multiquadric)
• Determine weights from constraints at data points =
31
Basic idea
Notation: , = −

,1 ,2 ,
• How to obtain the as-smooth-as-possible result?
33
Scattered Data Interpolation for Computer Graphics [Anjyo SIGGRAPH14 Course]

• 2nd derivative (=curvature) magnitude integrated over the whole domain
2 = ∈ Δ() 2
• 1D case:
2
• 3D case:
2 + 2zx 2
34
Known theory in the math literature
• Of all functions satisfying = , the minimizer of 2 is represented as RBFs with the following basis:
• 1D case: = 3
• 2D case: = 2 log
• 3D case: =
• FYI • Finite Element Method: Find minimizing 2 discretized over mesh
• RBF: Find minimizing 2 analytically
35Scattered Data Interpolation for Computer Graphics [Anjyo SIGGRAPH14 Course]
Additional linear term
• 2[] is defined using 2nd derivative Any additional linear term = + + + has no effect:
2 + = 2[]
• Make unique by regarding linear term as additional unknowns:
= =1
36

1 2
1 2
constraints needed
Additional constraints: reproduction of all linear functions • “If all data points , are sampled from a linear function, RBF
should reproduce the original function”
• Additional constraints: • =1 = 0
• =1 = 0
• =1 = 0
• =1 = 0
38
1,1 1,2 1, 1 1 1 1
2,1 2,2 2, 2 2 2 1
,1 ,2 , 1
1 2 0 0 0 0 1 2 0 0 0 0 1 2 0 0 0 0 1 1 1 0 0 0 0
1 2
1 2


=


Introducing gradient constraints
= =1

− + − + + + +
• Gradient of :

− + H − +
• Incorporate gradient constraints =
39
H =
Gradient constraint:
1 = 11,1 + H1,11 + 21,2 + H1,22 ++1, + H1, + = 1
Value constraint:
1,2 ++1, + 1, + 1 + 1 + 1 + = 1
Introducing gradient constraints
• 1st data point:
1

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0
value constraints only
References
• State of the Art in Surface Reconstruction from Point Clouds [Berger EG14 STAR]
• A survey of methods for moving least squares surfaces [Cheng PBG08]
• Scattered Data Interpolation for Computer Graphics [Anjyo SIGGRAPH14 Course]
• An as-short-as-possible introduction to the least squares, weighted least squares and moving least squares for scattered data approximation and interpolation [Nealen TechRep04]