Introduction to Computer Graphics – Modeling (3) –
April 27, 2017 Kenshi Takayama
Introduction to Computer Graphics Modeling (3) April 27, 2017 - - PowerPoint PPT Presentation
Introduction to Computer Graphics Modeling (3) April 27, 2017 Kenshi Takayama Solid modeling 2 Thin shapes represented Unorientable Solid models by single polygons Clear definition of inside & outside at any 3D
April 27, 2017 Kenshi Takayama
2
3
3D printing Physics simulation
Open boundaries (holes) Self-intersections Thin shapes represented by single polygons Unorientable
Non-solid cases Klein bottle
𝐪 ∈ ℝ3 is inside/outside of the model 𝑔 𝐪 : ℝ3 ↦ true, false
𝐪 𝑔 𝐪 = true } ⊂ ℝ3
4
Box whose min & max corners are 𝑦min, 𝑧min, 𝑨min & 𝑦max, 𝑧max, 𝑨max Sphere of radius 𝑠 centered at 𝐝 𝑔 𝐪 ≔ 𝐪 − 𝐝 < 𝑠 𝑔 𝑦, 𝑧, 𝑨 ≔ 𝑦min < 𝑦 < 𝑦max ∧ 𝑧min < 𝑧 < 𝑧max ∧ 𝑨min < 𝑨 < 𝑨max c r 𝐪max 𝐪min
5
Union
𝑔
𝐵∪𝐶 𝐪 ≔ 𝑔 𝐵(𝐪) ∨ 𝑔 𝐶(𝐪)
𝑔
𝐵∩𝐶 𝐪 ≔ 𝑔 𝐵(𝐪) ∧ 𝑔 𝐶(𝐪)
𝑔
𝐵∖𝐶 𝐪 ≔ 𝑔 𝐵(𝐪) ∧ ¬𝑔 𝐶(𝐪)
Intersection Subtraction
CSG Tree
A B C D E
𝐵 ∩ 𝐶 ∖ 𝐷 ∪ 𝐸 ∪ 𝐹
3D point to model surface: 𝑒 𝐪 : ℝ3 ↦ ℝ
𝑔 𝐪 ≔ 𝑒(𝐪) < 0
{𝐪 | 𝑒(𝐪) = 0} ⊂ ℝ3
6
c r Sphere of radius 𝑠 centered at 𝐝 𝑒 𝐪 ≔ 𝐪 − 𝐝 − 𝑠
7
Torus with major & minor radii R & a Not necessarily distance functions
8
𝑒 𝐪 = 𝑒1 𝐪 − 𝑒2(𝐪) 𝑒 𝐪 = 𝑒1 𝐪 + 𝑒2(𝐪) 𝑒𝑗 𝐪 = 𝑟𝑗 𝐪 − 𝐝𝑗 − 𝑠
𝑗
𝑒 𝐪 = 𝑒1 𝐪 + 𝑒2 𝐪 + 𝑒3 𝐪 + 𝑒4 𝐪
c1 c4 c3 c2
9
𝑒1 𝒒 = 0 2 3 𝑒1 𝒒 + 1 3 𝑒2 𝒒 = 0 1 3 𝑒1 𝒒 + 2 3 𝑒2 𝒒 = 0 𝑒2 𝒒 = 0
10
(1) Compute function values at 8 corners (2) Determine type of output triangles based on the sign pattern
(3) Determine vertex positions by linearly interpolating function values
11
Marching Cubes: A High Resolution 3D Surface Construction Algorithm [Lorensen SIGGRAPH87]
12
The asymptotic decider: resolving the ambiguity in marching cubes [Nielson VIS91]
Discontinuous faces across neighboring cells New rules to resolve ambiguity
Simpler implementation
13
http://paulbourke.net/geometry/polygonise/ Regularised marching tetrahedra: improved iso-surface extraction [Treece C&G99]
14
Feature Sensitive Surface Extraction from Volume Data [Kobbelt SIGGRAPH01] Dual Contouring of Hermite Data [Ju SIGGRAPH02] http://www.graphics.rwth-aachen.de/IsoEx/
Grid size: 65×65×65 Marching Cubes Improved version Marching Cubes (only uses function values) Improved version (uses function gradient as well)
15
Fast, exact, linear booleans [Bernstein SGP09] Exact and Robust (Self-)Intersections for Polygonal Meshes [Campen EG10] Mesh Arrangements for Solid Geometry [Zhou SIGGRAPH16] https://libigl.github.io/libigl/tutorial/tutorial.html#booleanoperationsonmeshes
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 based on generalized winding number Decide inside/outside by shooting rays from outside Volumetric representation Surface representation
17
18
Range Scanner (LIDAR) Structured Light Multi-View Stereo Depth Camera
Typical Computer Vision problems
x, 𝑜𝑗 y, 𝑜𝑗 z , 𝑗 ∈ 1, … , 𝑂
Important to other fields (e.g. Machine Learning) as well
19
𝑔
𝑗
20
Modelling with implicit surfaces that interpolate [Turk TOG02] Hermite Radial Basis Functions Implicits [Macedo CGF10] Value+gradient constraints Hermite interpolation Simple offsetting
21
22
𝐲 ≔ (𝑦, 𝑧, 𝑨)
𝑦1 𝑧1 𝑨1 1 𝑦2 𝑧2 𝑨2 1 𝑦𝑂 𝑧𝑂 𝑨𝑂 1 𝑏 𝑐 𝑑 𝑒 𝑔
1
𝑔
2
𝑔
𝑂 ・・・ ・・・
=
𝐠 𝑔 𝐲1 = 𝑏𝑦1 + 𝑐𝑧1 + 𝑑𝑨1 + 𝑒 = 𝑔
1
𝑔 𝐲2 = 𝑏𝑦2 + 𝑐𝑧2 + 𝑑𝑨2 + 𝑒 = 𝑔
2
𝑔 𝐲𝑂 = 𝑏𝑦𝑂 + 𝑐𝑧𝑂 + 𝑑𝑨𝑂 + 𝑒 = 𝑔
𝑂 ・・・
23
𝐠
𝐠
𝐵⊺𝐵 −1
𝐠
= = = 𝑩 𝐝 − 𝐠 2 =
𝑗=1 𝑂
𝑔 𝐲𝑗 − 𝑔
𝑗 2 “normal equation”
𝑒2 = 𝛽𝐪 + 𝛾𝐫 − 𝐬 2
24
𝑞x 𝑞y 𝑞z = 𝛽 𝛾 𝑟x 𝑟y 𝑟z 𝑠
x
𝑠
y
𝑠
z
𝑗=1 𝑂
𝑥𝑗 𝑔 𝐲𝑗 − 𝑔
𝑗 2
25
𝑦1 𝑧1 𝑨1 1 𝑦2 𝑧2 𝑨2 1 𝑦𝑂 𝑧𝑂 𝑨𝑂 1 𝑏 𝑐 𝑑 𝑒 𝑔
1
𝑔
2
𝑔
𝑂 ・・・ ・・・
= 𝑥1 𝑥2 𝑥𝑂 𝑥1 𝑥2 𝑥𝑂
𝐠
26
𝐠
𝐵⊺𝑋2𝐵 −1
𝐠
= =
𝑥𝑗 𝐲 = 𝑥( 𝐲 − 𝐲𝑗 )
1 𝑠2+𝜗2
Coeffs 𝑏, 𝑐, 𝑑, 𝑒 are functions of 𝐲
27
𝑔 𝐲 = 𝑦 𝑧 𝑨 1 𝑏(𝐲) 𝑐(𝐲) 𝑑(𝐲) 𝑒(𝐲)
𝐵⊺𝑋 𝐲 2𝐵 −1
𝐠 𝐵⊺𝑋 𝐲 2 Larger the weight as 𝐲 is closer to 𝐲𝑗
𝑗 𝐲 = 𝑔
𝑗 + 𝐲 − 𝐲𝑗 ⊺𝐨𝑗
𝑗=1 𝑂
𝑥𝑗 𝐲 𝑔 𝐲 − 𝑗 𝐲
2
28
𝑦 𝑧 𝑨 1 𝑦 𝑧 𝑨 1 𝑦 𝑧 𝑨 1 𝑏 𝑐 𝑑 𝑒 1 𝐲 2 𝐲 𝑂 𝐲
・・・ ・・・
= 𝑥1(𝐲) 𝑥2(𝐲) 𝑥𝑂(𝐲) 𝑥1(𝐲) 𝑥2(𝐲) 𝑥𝑂(𝐲)
Interpolating and Approximating Implicit Surfaces from Polygon Soup [Shen SIGGRAPH04]
29
Normal constraints Simple offsetting
Interpolating and Approximating Implicit Surfaces from Polygon Soup [Shen SIGGRAPH04] Input : Polygon Soup Interpolation Approximation 1 Approximation 2 Approximation 3
30
𝑗=1 𝑂
(Gaussian)
1 𝐲 2+𝑑2
(Inverse Multiquadric)
𝑗
31
Basis function translated to each data point 𝐲𝑗
Unknown
32
𝑔 𝐲1 = 𝑥1𝜚1,1 + 𝑥2𝜚1,2 + ⋯ + 𝑥𝑂𝜚1,𝑂 = 𝑔
1
𝑔 𝐲2 = 𝑥1𝜚2,1 + 𝑥2𝜚2,2 + ⋯ + 𝑥𝑂𝜚2,𝑂 = 𝑔
2
𝑔 𝐲𝑂 = 𝑥1𝜚𝑂,1 + 𝑥2𝜚𝑂,2 + ⋯ + 𝑥𝑂𝜚𝑂,𝑂 = 𝑔
𝑂
Notation: 𝜚𝑗,𝑘 = 𝜚 𝐲𝑗 − 𝐲𝑘 ・・・
𝜚1,1 𝜚1,2 𝜚1,𝑂 𝜚2,1 𝜚2,2 𝜚2,𝑂 𝜚𝑂,1 𝜚𝑂,2 𝜚𝑂,𝑂 𝑥1 𝑥2 𝑥𝑂 𝑔
1
𝑔
2
𝑔
𝑂 ・・・
=
・・・
𝐠
33
Scattered Data Interpolation for Computer Graphics [Anjyo SIGGRAPH14 Course]
𝜏
小 大
𝐹2 𝑔 =
𝐲∈ℝ𝑒 Δ𝑔(𝐲) 2𝑒𝐲
𝐹2 𝑔 =
𝑦∈ℝ
𝑔′′ 𝑦 2𝑒𝑦
𝐹2 𝑔 =
𝐲∈ℝ2 𝑔 xx 𝐲 2 + 2𝑔 xy 𝐲 2 + 𝑔 yy 𝐲 2 𝑒𝐲
𝐹2 𝑔 =
𝐲∈ℝ3 𝑔 xx 𝐲 2 + 𝑔 yy 𝐲 2 + 𝑔 zz 𝐲 2 + 2𝑔 xy 𝐲 2 + 2𝑔 yz 𝐲 2 + 2𝑔 zx 𝐲 2 𝑒𝐲
34
Laplacian operator
𝑗 , the minimizer of 𝐹2 is represented
𝐲 2 log 𝐲
𝐲
35
Scattered Data Interpolation for Computer Graphics [Anjyo SIGGRAPH14 Course]
𝑗=1 𝑂
36
37
𝑔 𝐲1 = 𝑥1𝜚1,1 + 𝑥2𝜚1,2 + ⋯ + 𝑥𝑂𝜚1,𝑂 + 𝑏𝑦1 + 𝑐𝑧1 + 𝑑𝑨1 + 𝑒 = 𝑔
1
𝑔 𝐲2 = 𝑥1𝜚2,1 + 𝑥2𝜚2,2 + ⋯ + 𝑥𝑂𝜚2,𝑂 + 𝑏𝑦2 + 𝑐𝑧2 + 𝑑𝑨2 + 𝑒 = 𝑔
2
𝑔 𝐲𝑂 = 𝑥1𝜚𝑂,1 + 𝑥2𝜚𝑂,2 + ⋯ + 𝑥𝑂𝜚𝑂,𝑂 + 𝑏𝑦𝑂 + 𝑐𝑧𝑂 + 𝑑𝑨𝑂 + 𝑒 = 𝑔
𝑂
・・・
𝜚1,1 𝜚1,2 𝜚1,𝑂 𝑦1 𝑧1 𝑨1 1 𝜚2,1 𝜚2,2 𝜚2,𝑂 𝑦2 𝑧2 𝑨2 1 𝜚𝑂,1 𝜚𝑂,2 𝜚𝑂,𝑂 𝑦𝑂 𝑧𝑂 𝑨𝑂 1 𝑥1 𝑥2 𝑥𝑂 𝑏 𝑐 𝑑 𝑒 𝑔
1
𝑔
2
𝑔
𝑂 ・・・ ・・・
=
・・・
𝐠
4 unknowns 𝑏, 𝑐, 𝑑, 𝑒 added 4 new constraints needed
𝑗 are sampled from a linear function, RBF
𝑂
𝑥𝑗 = 0
𝑂
𝑦𝑗𝑥𝑗 = 0
𝑂
𝑧𝑗𝑥𝑗 = 0
𝑂
𝑨𝑗𝑥𝑗 = 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
𝑔
𝑂 ・・・ ・・・
=
・・・ ・・・
𝐠
Scattered Data Interpolation for Computer Graphics [Anjyo SIGGRAPH14 Course]
𝑗=1 𝑂
⊺𝛂𝜚 𝐲 − 𝐲𝑗
𝑗=1 𝑂
39
= 𝜚xx 𝜚xy 𝜚xz 𝜚yx 𝜚yy 𝜚yz 𝜚zx 𝜚zy 𝜚zz
Hermite Radial Basis Functions Implicits [Macedo CGF10] Hessian matrix (function) Unknown 3D vector
Gradient constraint: 𝛂𝑔 𝐲1 = 𝑥1𝛂𝜚1,1 + H𝜚
1,1𝐰1 + 𝑥2𝛂𝜚1,2 + H𝜚 1,2𝐰2 + ⋯ + 𝑥𝑂𝛂𝜚1,𝑂 + H𝜚 1,𝑂𝐰𝑂 +
𝑏 𝑐 𝑑 = 𝐨1 Value constraint: 𝑔 𝐲1 = 𝑥1𝜚1,1 + 𝐰1
⊺𝛂𝜚1,1 + 𝑥2𝜚1,2 + 𝐰2 ⊺𝛂𝜚1,2 + ⋯ + 𝑥𝑂𝜚1,𝑂 + 𝐰𝑂 ⊺ 𝛂𝜚1,𝑂 + 𝑏𝑦1 + 𝑐𝑧1 + 𝑑𝑨1 + 𝑒 = 𝑔 1
40
Hermite Radial Basis Functions Implicits [Macedo CGF10]
𝐨1 𝑔
1
𝜚1,1 𝛂𝜚1,1
⊺
H𝜚
1,1
𝛂𝜚1,1 𝜚1,2 𝛂𝜚1,2
⊺
H𝜚
1,2
𝛂𝜚1,2 𝜚1,𝑂 𝛂𝜚1,𝑂
⊺
H𝜚
1,𝑂
𝛂𝜚1,𝑂 𝑦1 𝑧1 𝑨1 1 1 0 0 0 0 1 0 0 0 0 1 0
・・・
=
1 𝑥1 𝐰1 𝐰2 𝑥2
・・・
𝐰𝑂 𝑥𝑂 𝑏 𝑐 𝑑 𝑒
41
𝐨1 𝑔
1
=
𝑥1 𝐰1 𝐰2 𝑥2
・・・
𝐰𝑂 𝑥𝑂 𝑏 𝑐 𝑑 𝑒
1
・・・ ・・・
2
𝑂
・・・
1 ⊺
2 ⊺
⊺ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 𝐨2 𝑔
2
𝐨𝑂 𝑔
𝑂
・・・ ・・・
42
Gradient constraints Simple offsetting with value constraints only
43
44