Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Representing CurvesFoley & Van Dam, Chapter 11
Representing Curves
• Motivations• Techniques for Object Representation• Curves Representation• Free Form Representation• Approximation and Interpolation• Parametric Polynomials• Parametric and Geometric Continuity • Polynomial Splines
• Hermite Interpolation
3D Objects Representation• Solid Modeling attempts to develop methods and algorithms to model and represent real objects by computers
Objects Representation• Three types of objects in 3D:
• 1D curves• 2D surfaces• 3D objects
• We need to represent objects when:• Modeling of existing objects (3D scan)
- modeling is not precise• Modeling a new object “from scratch” (CAD)
- modeling is precise- interactive sculpting capabilities
General Techniques
• Primitive Based:A composition of “simple” components
• Not precise• Efficient and simple
• Free Form:Global representation, curved manifolds
• Precise• Complicated
• Statistical:Modeling of objects generated by statisticalphenomena, such as fog, trees, rocks
Curves Representation
-1
-0.5
0
0.5
1
-1
-0.5
0
0.5
10
5
10
15
20
Primitive Based Representation
• Line segments: A curve is approximated by a collection of connected line segments
Free Form Representations• Explicit form: z = f(x, y)
• f(x,y) must be a function• Not a rotation invariant representation• Difficult to represent vertical tangents
• Implicit form: f(x, y, z) = 0• Difficult to connect two curves in a smooth manner• Not efficient for drawing• Useful for testing object inside/outside
• Parametric: x(t), y(t), z(t)• A mapping from [0,1] →R3
• Very common in modeling
Free Form Representations
Example: A Circle of radius R
• Implicit: x2 + y2 + z2 - R2 = 0 & z = 0
• Parametric: x(θ) = R cos(θ)y(θ) = R sin(θ)z(θ) = 0 θ
x
y
z
Approximated vs. Interpolated Curves
• Given a set of control points Pi known to be on the curve, find a parametric curve that interpolates/approximates the points
P0
P1
P2
P3
P4
P0
P1
P2
P3
P4
Interpolating Curve
Approximating Curve
Parametric Polynomials• For interpolating n points we need a polynomial of degree n-1
• Example: Linear polynomial. For interpolating 2 points we need a polynomial of degree 1
+++=
+++=
+++=
2
2
2
)(
)(
)(
ucubauz
ucubauy
ucubaux
zzz
yyy
xxx
p0
p1
p2
p3
p4
ubauzubauyubaux
zz
yy
xx
+=
+=+=
)()()(
p0
p1
Example: Linear Polynomial• The geometrical constraints for x(u) are:
• Solving the coefficients for x(u) we get:
• Solving for [x(u) y(u) z(u)] we get:
xxx
xx PbaxPax 10 )1(;)0( =+===
xxx
xx PPbPa 010 ; −==
0 1 0( ) ( )x x xx u P P P u⇒ = + −
0 1 0
( )( ) ( ) ( )
( )
x uV u y u P P P u
z u
= = + −
p0
p1
u=0u=1
Example: Linear Polynomial
p0
p1
p2
p3
p4V1(u) V2(u) V3(u)
V4(u)
1 0 1 0
( )( ) ( ) ( )
( )
x uV u y u P P P u
z u
= = + −
p0
p1u=0 u=1
( )( )( )
( ) ( )ii
x uV u y u V u
z u
= =
∑
( ) ( ) 1[ , ]0
i i ii
V u if u u uwhere V u
otherw ise+ ∈
=
Parametric Polynomials• Polynomial interpolation has several disadvantages:
• Polynomial coefficients are geometrically meaningless• Polynomials of high degree introduce unwanted wiggles• Polynomials of low degree give little flexibility
• Solution: Polynomial Splines
p0
p1
p2
p3
p4
Polynomial Splines• Piecewise, low degree, polynomial curves, with continuous joints
• Advantages:• Rich representation• Geometrically meaning coefficients• Local effects• Interactive sculpting capabilities
( )( )( )
( ) ( )ii
x uC u y u C u
z u
= =
∑
( ) ( ) 1[ , ]0
i i ii
C u if u u uwhere C u
otherw ise+ ∈
=
p0
p1
p2
p3
p4c1(u)
c2(u) c3(u) c4(u)
Tangent Vector• Let V(u)=[x(u), y(u), z(u)], u→[0,1] be a continuous univariate parametric curve in R3
• The tangent vector at u0, T(u0), is:
• V(u) may be thought of as the trajectory of a point in time• In this case, T(u0) is the instantaneous velocity vector at time u0
00 uuuu00 du
dzdudy
dudx
du)u(dV)u(V)u(T
==
==′=
T(u0)
u0u=0
u=1
Parametric Continuity• Let V1(u) and V2(u) , u→[0,1], be two parametric curves•Level of parametric continuity of the curves at the joint between V1(1) and V2(0):
• C-1: The joint is discontinuous, V1(1)≠V2(0)• C0: Positional continuos, V1(1)=V2(0)• C1: Tangent continuos, C0 & V’1(1)=V’2(0)• Ck, k>0: Continuous up to the k-th derivative,
V1(j) (1)=V2
(j) (0), 0 ≤ j ≤ k
C-1 C0C1
V1(1)
V2(0)
Geometric Continuity• In computer aided geometry design, we also consider the notion of geometric continuity:
• G-1, G0: Same as C-1 and C0
• G1: Same tangent direction: V’1(1)=αV’2(0)• Gk: All derivatives up to the k-th order are proportional
• Given a set of points {pi}:• A piecewise constant interpolant is C-1
• A piecewise linear interpolant is C0
Parametric and Geometric Continuity
• Q1-Q2 both C1 and G1
• Q1-Q3 is G1 but not C1
• S-C0 is C0
• S-C1 is C1
• S-C2 is C2
• In general, Ci implies Gi
(not vice versa)• Exception when the tangents are zero
Parametric Cubic Curves• Cubic polynomials defining a curve in R3 have the form:
Where u is in [0,1]. Defining:
The curve can be rewritten as:
zzzz
yyyy
xxxx
ducubuauz
ducubuauy
ducubuaux
+++=
+++=
+++=
23
23
23
)(
)(
)(
[ ]
==
zyx
zyx
zyx
zyx
T
dddcccbbbaaa
QuuuuU and1)( 23
[ ]( ) ( ) ( ) ( ) ( ) T Tx u y u z u V u U u Q= =
Parametric Cubic Curves
• The coefficients Q are unknown and should be determined
• For this purpose we have to supply 4 geometrical constraints
• Different types of constraints define different types of Splines
Hermite Curves• Assume we have n control points {pk} with their tangents {Tk}• W.L.O.G. V(u) represents a parametric cubic function for the section between pk and pk+1• For V(u) we have the following geometric constraints:
V(0)=pk; V(1)=pk+1V'(0)=Tk; V'(1)=Tk+1
pk
Pk+1
V(u)V(0)
V(1)Tk
Tk+1
Hermite CurvesSince
we have that
We can write the constraints in a matrix form:
And thus
Where
3 2
2
( ) 1
( ) ( ) 3 2 1 0
T
T
V u u u u Q
V u u u Q
=
′ =
Q
TTpp
MQG
k
k
k
k
=
⇒=
+
+
0123010011111000
1
1
G MGMuUQuUuV TTT 1)()()( −==
−−−
−
=−
00010100
12331122
1M
Hermite Curves13 2
1
2 2 1 13 3 2 1
( ) [ 1 ]0 0 1 01 0 0 0
k
k
k
k
pp
V u u u uTT
+
+
− − − − =
Geometrymatrix
=
=
−+−
+−+−
=
+
+
+
+
1
1
3
2
1
0
1
1
23
23
23
23
)()()()(
232
132
)(
k
k
k
k
k
k
k
k
TTppT
uHuHuHuH
TTppT
uuuuu
uuuu
uV
Blending functions
Hermite Curves
0 0 .1 0 .2 0 .3 0 .4 0 .5 0 .6 0 .7 0 .8 0 .9 1-0 .2
0
0 .2
0 .4
0 .6
0 .8
1
1 .2
H0=H(0)H1=H(1)
H2=H’(0)
H3=H’(1)
Hermite Blending Functions
Hermite Curves
Change in Magnitude of T0
Change in Direction of T0
P0 P1
x(u)
y(u)
T0
T1
x(u)
y(u)
Hermite CurvesProperties:
• The Hermite curve is composed of a linear combinations of tangents and locations (for each u)
• Alternatively, the curve is a linear combination of Hermitebasis functions (the matrix M)
• It can be used to create geometrically intuitive curves
• The piecewise interpolation scheme is C1 continuous
• The blending functions have local support; changing a control point or a tangent vector, changes its local neighborhood while leaving the rest unchanged
Hermite Curves
• Main Drawback:
Requires the specification of the tangents This information is not always available