Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Geometric Modeling
Introduction
Geometric Modeling: Introduction
p2
p1
p0
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Geometric Modeling: Introduction
● Other approaches:
● 3D scanners
● Photography for measuring
optical properties
● Simulations, e.g., for flow
data 3D Scanning
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Geometric Modeling: Introduction
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Geometric Modeling: Introduction
● Surface Models
● describe an object using boundary surfaces
● Solid Models
● describe an object as a solid
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Geometric Modeling: Introduction
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Geometric Modeling: Introduction
Surface Models
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Geometric Modeling: Introduction
Solid Models
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Geometric Modeling: Introduction
Chrome-cobalt disc with crowns for dental implants, manufactured using WorkNC CAM
Sescoi CAD/CAM
http://www.flickr.com/photos/cadcamzone/4679188766/. Licensed under CC BY-SA 2.0 via Commons -
https://commons.wikimedia.org/wiki/File:Disc_with_dental_implants_made_with_WorkNC.jpg#/media/File:Disc_with_dental_implants_made_with_WorkNC.jpg
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Introduction to Visualization and Computer Graphics
DH2320, Fall 2015
Prof. Dr. Tino Weinkauf
Geometric Modeling
de Casteljau Algorithm
Bernstein Form
Bezier Splines
Tensor Product Surfaces
Total Degree Surfaces
Bezier Curves
de Casteljau algorithm
Given: p0, …, pn
Example:
De Casteljau algorithm
Another parabola construction
parabola x(t)
De Casteljau algorithm
Example
De Casteljau algorithm
b0(0)
b0(0) b3(0)
b1(0)
b2(0)
b3(0)
De Casteljau algorithm
repeated convex combination of control points
bi(r) = (1-t)·bi(r-1) + t·bi+1(r-1)
b1(1)
b1(0) b2(0)
b0(1)
b2(1)
b0(0)
1-t b0(0) b3(0)
t
b1(0) b0(1)
1-t
t
b2(0) b1(1)
1-t
t
b3(0) b2(1)
De Casteljau algorithm
repeated convex combination of control points
bi(r) = (1-t)·bi(r-1) + t·bi+1(r-1)
b1(1)
b1(0) b2(0)
b0(2) b1(2)
b0(1)
b2(1)
b0(0)
1-t b0(0) b3(0)
t
b1(0) b0(1)
1-t 1-t
t t
b2(0) b1(1) b0(2)
1-t 1-t
t t
b3(0) b2(1) b1(2)
De Casteljau algorithm
repeated convex combination of control points
bi(r) = (1-t)·bi(r-1) + t·bi+1(r-1)
b1(1)
b1(0) b2(0)
b0(2) b1(2)
b0(1) b0(3) = x(t)
b2(1)
b0(0)
1-t b0(0) b3(0)
t
b1(0) b0(1)
1-t 1-t
t t
b2(0) b1(1) b0(2)
1-t 1-t 1-t
t t t
b3(0) b2(1) b1(2) b0(3) = x(t)
de Casteljau scheme
De Casteljau algorithm
The intermediate coefficients bir(t) can be written in
a triangular matrix: the de Casteljau scheme:
De Casteljau algorithm
b1(1)
b1(0) b2(0)
b0(2) b1(2)
b0(1) b0(3) = x(t)
b2(1)
• Affine invariance:
Bezier curve and Bezier polygon are invariant under affine
transformations
• Linear precision:
Bezier curve is line segment, if b0,…, bn are
collinear
b0(0)
1-t b1(1)
b1(0) b2(0)
b0(2) b1(2)
t
b1(0) b0(1) b0(1) b0(3) = x(t)
1-t 1-t b2(1)
t t
b2(0) b1(1) b0(2) b0(0) b3(0)
1-t 1-t 1-t
-1
1 𝑛−1 𝑛−1
b3(0) t b2(1) t
b1(2)
t 𝐱 𝑡 = 𝑛 𝐛1 − 𝐛0
de Casteljau scheme
De Casteljau algorithm
• Second derivative of a Bezier curve
b0(0)
1-t b1(1)
b1(0) b2(0)
b0(2) b1(2)
t
b1(0) b0(1) b0(1) b0(3) = x(t)
1-t -1 b2(1)
t 1
b2(0) b1(1) b0(2) b0(0) b3(0)
1-t -1 -1
t 1 1 𝑛−2 𝑛−2 𝑛−2
b3(0) b2(1) b1(2) 𝐱 𝑡 =𝑛 𝑛−1 𝐛2 − 2𝐛1 + 𝐛0
de Casteljau scheme
Bezier Curves
Bernstein form
Bernstein Basis
Bezier curves are algebraically defined using the
Bernstein basis:
• Bernstein basis of degree n:
B B0( n) , B1( n) ,..., Bn( n)
n i
B (t ) : t 1 t
( n) ni
i
i
n = 2 (quad.) n = 3 (cubic) n = 10
B0 B2 B0 B3
B1 B1 B2
Bernstein Basis
de Casteljau algorithm
𝑛
𝑛 Bernstein form
𝑓 𝑡 = 𝐵𝑖 𝑡 𝐩i
𝑖=0
B0(2) : 1 t B1(2) : 2t 1 t
2
B2(2) : t 2
B0(3) : 1 t B1(3) : 3t 1 t
3 2
n = 2 (quad.) n = 3 (cubic)
B2(3) : 3t 2 1 t B3(3) : t 3 B0 B2 B0 B3
B1 B1 B2
n i
B (t ) : t 1 t
( n) ni
i
i
Bezier Curves in Bernstein form
Bezier Curves: p2 n = 3 (cubic)
n
• f (t ) pi Bi( n) p1
B0 B3
i 0
p3 B1 B2
t [0..1]
p0
p3
p3
p0 p2
p1
p2
p1 p3
p2
p1
p0
p0
Summary for Bezier Curves
Bezier curves and curve design:
• The rough form is specified by the position of the control
points
• Result: smooth curve approximating the control points
• Computation / Representation:
de Casteljau algorithm
Bernstein form
• Problems:
high polynomial degree
moving a control point can change the whole curve
interpolation of points
Bezier splines
Towards Bezier Splines
Approximation Interpolation
Towards Bezier Splines
Interpolation problem:
• given:
control points
knot sequence
• wanted:
interpolating curve x(t), i.e., x(ti) = ki for i = 0, …, n
• Approach:
"Joining" of n Bezier curves with certain intersection conditions
Towards Bezier Splines
The following issues arise when stitching together
Bezier curves:
• Continuity
• Degree
• (Parameterization)
Bezier Splines
Parametric and Geometric Continuity
Continuity
Joining of curves - continuity
• given: 2 curves
x1(t) over [t0, t1]
x2(t) over [t1, t2]
C1 continuity C2 continuity
Continuity
Parametric Continuity Cr:
• C0, C1, C2... continuity.
• Does a particle moving on this curve have a smooth
trajectory (position, velocity, acceleration,...)?
• Useful for animation (object movement, camera paths)
• Depends on parameterization
p(i)
2
p(i+1)
p1(i) 3
p(i)
3
p(i+1)
p0(i) 0
p(i+1)
2
p1(i+1)
Bezier Spline Continuity
Rules for Bezier spline continuity:
• C0 continuity:
Each spline segment interpolates the first and last control point
Therefore: Points of neighboring segments have to coincide for
C0 continuity.
p(i+1)
2
p1(i+1)
p(i)
2
p(i+1)
p1(i) 3
p(i)
3
p(i+1)
0
p0(i)
Bezier Spline Continuity
Rules for Bezier spline continuity:
• Additional requirement for C1 continuity:
Tangent vectors are proportional to differences p1 – p0, pn – pn-1
Therefore: These vectors must be identical for C1 continuity
p(i+1)
2
p(i)
2
p(i+1)
p1(i) 3
p(i)
3
p0(i) p(i+1)
0
p1(i+1)
Bezier Spline Continuity
Rules for Bezier spline continuity:
• Additional requirement for C2 continuity:
𝐝 − = 𝐝+
Continuity
G1 continuity C1 continuity
Bezier Splines
Choosing the degree
Choosing the Degree...
Candidates:
b(u,0,0; v,0,0)
b(0,0,0; 0,0,0) u
Tensor Product Surfaces
Tensor Product Surfaces:
n n
f (u, v ) bi (u)b j (v )pi , j
i 1 j 1
n n
bi (u) b j (v )pi , j
i 1 j 1
n n
b j (u) bi (v )pi , j
j 1 i 1
• “Curves of Curves”
• Order does not matter
Tensor Product Surfaces
Bezier Patches
Bezier Patches
Bezier Patches:
• Remember endpoint interpolation:
Boundary curves are Bezier
curves of the boundary
control points
d=3 d = 10
B0 B3
B1 B2
Continuity Conditions
For C0 continuity:
• Boundary control points must match
For C1 continuity:
• Difference vectors must match at the boundary
C0 Continuity
C1 Continuity
C1 Continuity
Total Degree Surfaces
Spline Surfaces
Two different approaches
• Tensor product surfaces
Simple construction
Everything carries over
from curve case
Quad patches
Degree anisotropy
p(c,c,a) p(c,c,b)
p(c,a,a) p(c,b,b)
p(a,b,c)
a b
p(a,a,a) p(b,a,a) p(b,b,a) p(b,b,b)
De Casteljau Algorithm
c
x a b c, p(c,c,c)
1
p(x,c,c)
p(c,c,a)
p(c,c,b)
p(x,x,c)
G d
F
a
c
• Two Bezier triangles meet along a common edge.
Parametrization: T1 = {a, b, c}, T2 = {c, b, d}
Polynomial surfaces F(T1), G(T2)
Control points:
– F(T1): f(a, a), f(a, b), f(b, b), f(a, c), f(c, c), f(b, c)
– G(T2): g(d, d), g(d, b), g(b, b), g(d, c), g(c, c), g(b, c)
Continuity
Situation:
f(b, b) b g(b, b)
g(b, d)
f(a, b)
d
G g(d, d)
f(b, c) g(b, c)
a F
g(c, d)
f(a, a)
f(a, c)
f(c, c) c g(c, c)
Continuity
C0 Continuity:
• The points on the boundary
have to agree:
f(b, b) = g(b, b)
f(b, c) = g(b, c)
f(c, c) = g(c, c)
• Proof: Let x : b c, 1
f ( x , x ) f ( b , x ) f (c , x )
2 f ( b, b) 2 f ( b, c) 2 f (c , c )
|| || ||
g( b,b) g( b,c ) g(c ,c )
2 g( b, b) 2 g( b, c) 2 g(c , c )
g( b, x ) g(c , x ) g( x , x )
Continuity
C1 Continuity:
• We need C0 continuity.
In addition:
• Points at hatched
quadrilaterals are coplanar
• Hatched quadrilaterals are
an affine image of the same
parameter quadrilateral
Curves on Surfaces, trimmed NURBS
Quad patch problem:
• All of our shapes are parameterized over rectangular or
triangular regions
• General boundary curves are hard to create
• Topology fixed to a disc (or cylinder, torus)
• No holes in the middle
• Assembling complicated shapes is painful
Lots of pieces
Continuity conditions for assembling pieces become complicated
Cannot use C2 B-Splines continuity along boundaries when using
multiple pieces
Curves on Surfaces, trimmed NURBS
Consequence:
• We need more control over the parameter domain
• One solution is trimming using curves on surfaces (CONS)
• Standard tool in CAD: trimmed NURBS
Basic idea:
• Specify a curve in the parameter domain that
encapsulates one (or more) pieces of area
• Tessellate the parameter domain accordingly to cut out
the trimmed piece (rendering)
Curves-on-Surfaces (CONS)
Curves-on-Surfaces (CONS)
Curves-on-Surfaces (CONS)
Summary
• Bezier Curves
• de Casteljau algorithm
• Bernstein form
• Bezier Splines