Sunteți pe pagina 1din 15

Geometric Modeling

91.580.201
Curves
Mortenson Chapter 2-5
and Angel Chapter 9
Curve Basics
Curve: Locus of a point moving with 1 degree of freedom.
Some types of equations to describe curves:
Intrinsic
No reliance on external frame of reference
Explicit
Value of dependent variable in terms of independent variable(s)
e.g. y = f (x)
Implicit
e.g. f (x,y) = 0
Parametric
Express value of each spatial variable in terms of an independent
variable (the parameter)
e.g. for parameter u in 3D:
x = x (u)
y = y (u)
z = z (u)

source: Mortenson, Angel


Intrinsic Definition
No reliance on external frame of reference
Requires 2 equations as functions of arc
length* s: 1
*length measured along the curve
f ( s)
1) Curvature:
2) Torsion: g (s)
Torsion (in 3D) measures how much
curve deviates from a plane curve.

For plane curves, alternatively:


1 d
ds

Treated in more detail in Chapter 12 of Mortenson and Chapters 10, 19 of Farin.


source: Mortenson
Explicit Form
Value of dependent variable in terms of
independent variable(s)
e.g. in 2D: one y value for each x value: y = f (x)
e.g. in 3D: y = f (x) and z = g (x)
Axis-dependent
Not guaranteed to exist
e.g. for 2D circle only one half is described by: y r2 x2
Special cases can be problematic
e.g. y = mx + h is inappropriate for vertical lines

source: Mortenson, Angel


Implicit Form
General form: f (x,y) = 0
Examples:
Straight line: Ax + By + C=0
Conic curve: Ax2 + 2Bxy + Cy2 + Dx + Ey + F=0
Axis-dependent
Can represent all lines and circles and
more
Some implicit forms are hard to
parameterize.

source: Mortenson, Angel


Parametric Form
Express value of each spatial
variable in terms of an
independent variable (the
parameter)
e.g. for parameter u in 3D:
x = x (u)
y = y (u)
z = z (u)
For a curve segment, typically
u [0,1]
Curve segments can be joined to
form composite spline*
(bendable) curves. *see Mortenson p. 105 (or Farin p. 167)
Parametric form of a given curve for spline definition as a minimum energy
is not necessarily unique. curve.
Every parametric form has an
implicit form.
source: Mortenson, Angel
Parametric Form

tangent
vector* Vector components of pu(u):

dx(u ) dy (u ) dz (u )
xu yu zu
du du du
vector

*unless otherwise noted, tangent vectors not drawn to scale. source: Mortenson
Parametric Form Advantages
Allow separation of variables and direct
computation of point coordinates.
Accommodate all slopes.
Bounded when parameter lies in a
bounded interval.
More degrees of freedom to control curve
shape.
Various forms of continuity can be
enforced at curve segment join points.
See Mortenson p.46 for more source: Mortenson
Continuity at Join Points
Discontinuous: physical separation
Parametric Continuity
Positional (C0 ): no physical separation
C1 : C0 and matching first derivatives
C2 : C1 and matching second
derivatives
Geometric Continuity
Positional (G0 ) = C0
Tangential (G1) : G0 and tangents are
proportional, point in same direction,
but magnitudes may differ
Curvature (G2) : G1 and tangent lengths
are the same and rate of length change
is the same

source: Mortenson, Angel, Wiki


4 Typical Types of Parametric Curves
Control points influence curve shape.
Interpolating
Curve passes through all control points.
Hermite
Defined by its 2 endpoints and tangent vectors at endpoints.
Interpolates all its control points.
Not invariant under affine transformations.
Special case of Bezier and B-Spline.
Bezier
Interpolates first and last control points.
Curve is tangent to first and last segments of control polygon.
Easy to subdivide.
Curve segment lies within convex hull of control polygon.
Variation-diminishing.
Special case of B-spline.
B-Spline
Not guaranteed to interpolate control points.
Invariant under affine transformations.
Curve segment lies within convex hull of control polygon.
Variation-diminishing.
Greater local control than Bezier.

source: Mortenson, Angel


Interpolating
Interpolates all control points.
Geometric form:
n
p(u ) bi (u )pi
i 0

Rarely used due to lack of


derivative continuity at curve
cubic case with equally spaced parameter values
segment join points.

source: Angel
Hermite
Geometric form (cubic case):

p(u) F1 (u)p0 F2 (u)p1 F3 (u)pu 0 F4 (u)pu1

F1 (u ) 2u 3 3u 2 1
F2 (u ) 2u 3 3u 2
F3 (u ) u 3 2u 2 u
F4 (u ) u 3 u 2

Hermite curves can provide C1


continuity at curve segment join
points.

source: Mortenson
Bezier
Geometric form (cubic case):
n
p(u) Bi ,n (u)pi
i 0
n
Bi ,n (u ) u i (1 u ) n i

i
Bernstein polynomials.
n+1 = number of control points = degree + 1
Adding a control point elevates degree by 1. n
Bi ,n (u ) 1
Bezier curves can provide C1 i 0
continuity at curve segment Convex combination, so Bezier curve points all lie
within convex hull of control polygon.
join points.
n
hi Bi ,n (u )p i
Rational form is invariant under perspective transformation: p(u ) i 0
n
where hi are projective space coordinates (weights)
hi Bi ,n (u )
i 0

source: Mortenson
B-Spline
Geometric form (non-uniform, n
p(u ) Ni , K (u)pi
non-rational case), where K i 0
controls degree (K -1) of basis
functions: N
N N
N i ,1 (u ) 1 if ti u ti 1

N i ,1 (u ) 0 otherwise N N

N N
(u ti ) N i ,k 1 (u ) (ti k u) Ni 1, k 1 (u )
N i ,k (u ) N N
ti k 1 ti ti k ti 1

ti are knot values that relate u to the control points.

Uniform case: space knots at equal intervals of u.


n
Repeated knots move curve closer to control points.
Ni , K (u) 1
Cubic B-splines can provide C2 i 0

continuity at curve segment join Convex combination, so B-spline curve points all
lie within convex hull of control polygon.
points. n
hi N i , K (u )p i
Rational form (NURBS) is invariant under perspective p(u ) i 0
n
transformation, where hi are projective space coordinates hi N i , K (u )
(weights). i 0
source: Mortenson
Geometric Modeling
91.580.201
OpenGL Demo
to accompany HW#2

S-ar putea să vă placă și