AssocProf Dr Ahmet Zafer Şenalp email azsenalpgmailcom Mechanical Engineering Department Gebze Technical University ME 521 Computer Aided Design Curves are the basics for surfaces ID: 573738
Download Presentation The PPT/PDF document "7. Curves and Curve Modeling" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
7. Curves and Curve Modeling
Assoc.Prof
.Dr. Ahmet Zafer Şenalpe-mail: azsenalp@gmail.comMechanical Engineering DepartmentGebze Technical University
ME 521
Computer
Aided
DesignSlide2
Curves are the basics for surfacesBefore learning surfaces curves have to be knownWhen asked to modify a particular entity on a CAD system, knowledge of the entities can increase your productivityUnderstand how the math presentation of various curve entities relates to a user interfaceUnderstand what is impossible and which way can be more efficient when creating or modifying an entity
Purpose
Dr. Ahmet Zafer Şenalp ME 521
2
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide3
Purpose
Curves are the basics for surfaces
Dr. Ahmet Zafer Şenalp ME 521
3
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide4
Why Not Simply Use a Point Matrix toRepresent a Curve?Storage issue and limited resolutionComputation and transformation
Difficulties in calculating the intersections or curves and physical properties of objectsDifficulties in design (e.g. control shapes of an existing object)
Poor surface finish of manufactured parts Dr. Ahmet Zafer Şenalp ME 521
4
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide5
Advantages of AnalyticalRepresentation for
Geometric
EntitiesA few parameters to storeDesigners know the effect of data points on curve behavior, control, continuity, and curvatureFacilitate calculations of intersections, object properties, etc. Dr. Ahmet Zafer Şenalp ME 521
5
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide6
Curve DefinitionsExplicit form :
I
mplicit form :
Dr. Ahmet Zafer Şenalp ME 521
6
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide7
Explicit RepresentationThe explicit form of a curve
in two dimensions gives the value
of one variable, the dependent variable, in terms of the other, the independent variable.In x,y space, we might write
y=f(x).
A
surface represented by an equation of the form z=f(x,y)
Dr. Ahmet Zafer Şenalp ME 521
7
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide8
Implicit RepresentationsIn two dimensions,an
implicit curve can
be represented by the equation f(x,y)=0The
implicit
form
is
less coordinate system dependent
than is
the
explicit
form.
In
three
dimensions,
the
implicit
form
f(
x,y,z
)=
0
Curves
in
three
dimensions
are
not
as
easily
represented
in
implicit
form.We can
represent
a
curve as the intersection, if it exists, of the two surfaces: f(x,y,z)=0, g(x,y,z)=0.
Dr. Ahmet Zafer Şenalp ME 521
8
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide9
Drawbacks of Conventional RepresentationsConventional explicit and implicit
forms have several drawbacks.
They represent unbounded geometryThey may be multi-valuedDifficult to evaluate points along the curveDepends on coordinate system Dr. Ahmet Zafer Şenalp ME 521
9
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide10
Parametric RepresentationCurves can be defined as a function of a single parameter. The parametric form of a
curve expresses the value of each
spatial variable for points on the curve in terms of an independent variable ,u, the parameter. In three
dimensions,
we
have
three explicit functions:
Dr. Ahmet Zafer Şenalp ME 521
10
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide11
Curve, P=P(u)P(u)=[x(u),y(u),z(u)]T
Parametric Representation
Dr. Ahmet Zafer Şenalp ME 521
11
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide12
u
u
v
Curve
, P=P(u)
Surface
, P=P(
u,v
)
P(u)
=
[x(u)
,
y(u)
,
z(u)]
T
P(u, v)=[x(u, v), y(u, v), z(u, v)]
T
Parametric Representation
Dr. Ahmet Zafer Şenalp ME 521
12
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide13
Parametric Representation Dr. Ahmet Zafer Şenalp ME 521
13
Mechanical Engineering Department, GTU
7. Curves and Curve Modeling
DESIGN CRITERIA
There
are
many
considerations
that
determine
why
we
prefer
to
use
parametric
polynomials
of
low
degree,
including:
Local
control
of
shapeSmoothness
and continuity
Ability
to
evaluate
derivatives
StabilityEase of renderingSlide14
Parametric Representation Changing
curve equation into parametric form:
Let’s use “t” parameter ;
Dr. Ahmet Zafer Şenalp ME 521
14
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide15
Parametric Explicit Form-Implicit Form Conversion
Example
: Planar 2. degree curve: How to
obtain
implicit
form?
t is extracted as:Replacing t in y equation;
Rearranging the above equation;
Rearranging again;
We
obtain
i
mplicit
form.
Dr. Ahmet Zafer Şenalp ME 521
15
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide16
Parametric Explicit Form-Implicit Form Conversion
Example
: Planar 2. degree curve :
plot
Dr. Ahmet Zafer Şenalp ME 521
16
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide17
Curve ClassificationCurve Classification:Analytic Curves
Synthetic curves
Dr. Ahmet Zafer Şenalp ME 521
17
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide18
Analytic Curves
These curves have an analytic
equationpointlinearccirclefilletChamferConics (ellipse, parabola,and
hyperbola
))
Dr. Ahmet Zafer Şenalp ME 521
18
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide19
line
arc
circle
Forming
Geometry
with
Analytic
Curves
Dr. Ahmet Zafer Şenalp ME 521
19
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide20
Analytic CurvesLine
Line definition in cartesian coordinate system:
Here;m: slope of the line b:
point
that
intersects y axisx: independent varaible of y function.
Parametric
form;
Dr. Ahmet Zafer Şenalp ME 521
20
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide21
Analytic CurvesLine
Example:
implicit-explicit form changeLine equation:
Parametric
line
equation is obtained. To turn back
to implicit
or
explicit
nonparametric
form t is
replaced
in x
and
y
equalities
implicit
form
explicit
form
Changing
to
parametric
form.
In
this
case
Let
.
Replacing
this
value
into
y
equation
.
is
obtained
.
As a
result
;
From
here
the
form at
the
beginning
is
obtained
.
Dr. Ahmet Zafer Şenalp ME 521
21
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide22
Analytic Curves Circle
Circle definition in Cartesian coordinate system:
Here;a,b: x,y coordinates of center pointr: circle radiusParametric form
Dr. Ahmet Zafer Şenalp ME 521
22
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide23
Analytic Curves Ellipse
Ellipse definition in Cartesian coordinate system:
Here;h,k: x,y coordinates of center pointa: radius of major axisb: radius of minör
exis
Parametric
form
Dr. Ahmet Zafer Şenalp ME 521
23
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide24
Analytic Curves Parabola
Parabola definition in Cartesian coordinate system:
Usual form;y = ax2 + bx + c
Dr. Ahmet Zafer Şenalp ME 521
24
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide25
Analytic Curves Hyperbola
Hyperbola definition in Cartesian coordinate system:
Dr. Ahmet Zafer Şenalp ME 521
25
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide26
Synthetic CurvesAs the name implies these are artificial
curvesLagrange interpolation curves
Hermite interpolation curvesBezierB-Spline NURBSetc.Analytic curves are usually not sufficient to meet geometric design requirements of mechanical parts.Many products need free-form, or synthetic curved surfaces
These
curves
use
a series of control points either interploated or aproximatedIt is the
definition method
for
complex
curves
.
It
should
be
controllable
by
the
designer
.
Calculation
and
storage
should
be
easy
.
At
the
same
time called as free form curves.
Dr. Ahmet Zafer Şenalp ME 521
26
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide27
Synthetic Curves
open
curve
closed
curve
Dr. Ahmet Zafer Şenalp ME 521
27
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide28
interpolated
approximated
control
points
Synthetic Curves
Dr. Ahmet Zafer Şenalp ME 521
28
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide29
Degrees of ContinuityPosition continuitySlope
continuity 1st derivative
Curvature continuity 2nd derivative Higher derivatives as necessary Dr. Ahmet Zafer Şenalp ME 521
29
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide30
Position Continuity
1
2
3
Connected (C
0
continuity)
Mid
-
points
are
connected
Dr. Ahmet Zafer Şenalp ME 521
30
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide31
Slope Continuity
1
2
Continuous tangent
Tangent continuity (C
1
continuity)
Both curves have the same 1. derivative value at the connection point. At the same time position continuity is also attained.
Dr. Ahmet Zafer Şenalp ME 521
31
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide32
Continuous curvature
Curvature continuity (C
2
continuity)
1
2
C
urvature
Continuity
Both
curves
have
the
same
2.
derivative
value
at
the
connection
point
.
At the same time position
and
slope
continuity is also attained.
Dr. Ahmet Zafer Şenalp ME 521
32
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide33
Composite CurvesCurves can be represented by connected segments to form a composite curveThere must be continuity at the mid-points
1
2
3
4
Dr. Ahmet Zafer Şenalp ME 521
33
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide34
Composite CurvesA cubic spline has C2 continuity at intermediate pointsCubic splines do not allow local control
1
2
3
4
Cubic polynomials
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
34
Mechanical Engineering Department, GTUSlide35
Linear InterpolationGeneral Linear Interpolation:
One of the simplest method is linear interpolation.
Dr. Ahmet Zafer Şenalp ME 521
35
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide36
Parametric Cubic Polynomial CurvesOnce we have decided to use parametric polynomial curves, we must choose the degree of the curve.If we choose a high degree, we will have many parameters that we can set to form the desired shape, but evaluation of points on the curve will be costly.In
addition, as the degree of a polynomial curve becomes higher, there is more danger that the curve will become rougher.On the other hand, if we pick too low a degree, we may not have enough parameters with which to work.
Dr. Ahmet Zafer Şenalp ME 521
36
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide37
Parametric Cubic Polynomial CurvesHowever, if we design each curve segment over a short interval, we can achieve many of our purposes with low-degree curves.Although there may be only a few degrees of freedom these few may be sufficient to allow us to produce the desired shape in a small region. For this reason, most designers, at least initially, work with cubic polynomial curves.
Dr. Ahmet Zafer Şenalp ME 521
37
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide38
Parametric Cubic Polynomial CurvesCubic polynomials are the lowest-order polynomials that can represent a non-planar curve
The curve can be defined by 4 boundary conditions
Dr. Ahmet Zafer Şenalp ME 521
38
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide39
Cubic PolynomialsLagrange interpolation - 4 pointsHermite interpolation - 2 points, 2 slopes
p
0
p
3
p
2
p
1
Lagrange
p
0
p
1
P
1
’
P
0
’
Hermite
Dr. Ahmet Zafer Şenalp ME 521
39
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide40
Lagrange InterpolationLagrange interpolation form is not only in cubic form that
requires 4 points but there are several forms:
Dr. Ahmet Zafer Şenalp ME 521
40
Mechanical Engineering Department, GTU
7. Curves and Curve Modeling
1
st
order : 2 points
2
nd
order: 3 points
3
rd
order: 4 points
4
th
order: 5 pointsSlide41
Lagrange
Interpolation
2 xi terms should not be the same,For N+1 data points ; (x0,y0),...,(xN,yN) için Lagrange interpolation form is in the form of linear combination:
Below
polynomial
is
called
Lagrange
base
polynomial
;
Dr. Ahmet Zafer Şenalp ME 521
41
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide42
Lagrange InterpolationExample
:
2nd order Lagrange polynomial example with 3 points Dr. Ahmet Zafer Şenalp ME 521
42
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide43
Dr. Ahmet Zafer Şenalp ME 521
43
Mechanical Engineering Department, GTU7. Curves and Curve Modeling
2
nd
order Lagrange polynomial example with 3 points
In fact in order to model a 3
rd
degree curve we should have to use 4 points.
Lagrange Interpolation
Example:Slide44
Dr. Ahmet Zafer Şenalp ME 521
44
Mechanical Engineering Department, GTU
7. Curves and Curve Modeling
3
rd
order Lagrange polynomial example with
4
points
. Here is a set of data
points
:
Here is a
plot
of
4 points.
Lagrange
Interpolation
Example
: Slide45
Lagrange InterpolationExample
:
Dr. Ahmet Zafer Şenalp ME 521
45
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide46
Lagrange InterpolationExample
:
Dr. Ahmet Zafer Şenalp ME 521
46
Mechanical Engineering Department, GTU
7. Curves and Curve Modeling
3
rd
order Lagrange polynomial example with
4
points
. Here is a set of data
points
:Slide47
Lagrange InterpolationThis image shows, for four points ((−9, 5), (−4, 2), (−1, −2), (7, 9)), the (cubic) interpolation polynomial
L(x) (in black), which is the sum of the scaled
basis polynomials y0ℓ0(x), y1ℓ1(x), y2ℓ2(x) and
y
3
ℓ
3
(
x). The interpolation polynomial passes through all four control points, and each scaled basis polynomial passes through its respective control point and is 0 where x corresponds to the other three control points
Dr. Ahmet Zafer Şenalp ME 521
47
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide48
Lagrange Interpolation Example:
A 3. degree L(x) function has the following x and corresponding y values;
The polynomial corresponding to the above values can be determined by Lagrange interpolation method:
Dr. Ahmet Zafer Şenalp ME 521
48
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide49
Lagrange Interpolation Example:
obtained.
L(x)= -0,7083x
4
+7,4167x
3
-22,2917x
2
+13,5833x+8
Dr. Ahmet Zafer Şenalp ME 521
49
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide50
Cubic Hermite Interpolation
There are no algebraic coefficints but there are geometric coefficints
Position vector at the starting point
Position vector at the end point
Tangent vector at the starting point
Tangent vector at the end
point
General form of
Cubic
Hermite
interpolation
:
Also
known
as
cubic
splines
.
Enables
up
to
C
1
continuity
.
Dr. Ahmet Zafer Şenalp ME 521
50
Mechanical Engineering Department, GTU
7. Curves and Curve ModelingSlide51
Cubic Hermite InterpolationHermite base functions
7. Curves and Curve Modeling
Hermite form is obtained by the linear summation of this 4 function at each interval.
Dr. Ahmet Zafer Şenalp ME 521
51
Mechanical Engineering Department, GTUSlide52
Cubic Hermite InterpolationThe effect of tangent vector to the curve shape
7. Curves and Curve Modeling
Geometrik katsayı matrisi
Geometric
coefficient
matrix
controls the shape of the curve.
Dr. Ahmet Zafer Şenalp ME 521
52
Mechanical Engineering Department, GTUSlide53
Cubic Hermite Interpolation
Hermite curve set with
same end points (P0 ve P1), Tangent vectors P0’ and P1’ have the same directions but P
0
’
have
different
magnitude P1’ is constant7. Curves and Curve Modeling
P
0
P
0
’
P
2
T
2
Dr. Ahmet Zafer Şenalp ME 521
53
Mechanical Engineering Department, GTUSlide54
Cubic Hermite Interpolation
All tangent vector magnitudes are equal but the direction of left tangent vector changes.
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
54
Mechanical Engineering Department, GTUSlide55
Cubic Hermite InterpolationThere are no algebraic coefficints but there are geometric coefficints
Cubic Hermite interpolation form:Dr. Ahmet Zafer Şenalp ME 521
55
Mechanical Engineering Department, GTU
7. Curves and Curve Modeling
Can
also
be
written
as:Slide56
Approximated CurvesBezier
B-Spline NURBSetc.
7. Curves and Curve ModelingDr. Ahmet Zafer Şenalp ME 521
56
Mechanical Engineering Department, GTUSlide57
Bezier CurvesP. Bezier of the French automobile company of Renault first introduced the Bezier curve (1962). Bezier curves were developed to allow more convenient manipulation of curves
A system for designing sculptured surfaces of automobile bodies (based on the Bezier curve)
A Bezier curve is a polynomial curve approximating a control polygonQuadratic and cubic Bézier curves are most commonHigher degree curves are more expensive to evaluate.When more complex shapes are needed, low order Bézier curves are patched together.Bézier curves are easily programmable. Bezier curves are widely used in computer graphics.
Enables up to C
1
continuity.
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
57
Mechanical Engineering Department, GTUSlide58
Control polygon
Bezier
Curves
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
58
Mechanical Engineering Department, GTUSlide59
Bezier
Curves
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
59
Mechanical Engineering Department, GTUSlide60
Bezier Curves
where the
polynomialsare known as Bernstein basis polynomials of degree n, defining t0 = 1 and (1 - t)0 = 1.General Bezier curve form which is controlled by
n+1 P
i
control
points;: binomial coefficient.
7. Curves and Curve Modeling
Degree
of
polynomial
is
one
less
than
the
control
points
used
.
Dr. Ahmet Zafer Şenalp ME 521
60
Mechanical Engineering Department, GTUSlide61
The points Pi are called control points for the Bézier curve The polygon formed by connecting the Bézier points with lines, starting with
P0 and finishing with Pn, is called the Bézier polygon
(or control polygon). The convex hull of the Bézier polygon contains the Bézier curve.The curve begins at P0 and ends at Pn; this is the so-called endpoint interpolation property. The curve is a straight line if and only if all the control points are collinear
.
The start (end) of the curve is
tangent
to the first (last) section of the
Bézier
polygon. A curve can be split at any point into 2 subcurves, or into arbitrarily many subcurves, each of which is also a Bézier
curve.
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
61
Mechanical Engineering Department, GTUSlide62
Bezier CurvesLinear Curves
t= [0,1] form of a linear
Bézier curve turns out to be linear interpollation form. Curve passes through points P0 ve P1.
Animation of a linear
Bézier
curve,
t
in [0,1]. The t in the function for a linear Bézier curve can be thought of as describing how far B(t) is from P0 to
P1.
For example when
t=0.25
,
B
(
t
) is one quarter of the
way from point
P
0
to
P
1
. As
t
varies from 0 to 1,
B
(
t
) describes a
curved line from
P
0
to
P
1
.
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
62
Mechanical Engineering Department, GTUSlide63
Bezier CurvesQuadratic Curves
For quadratic Bézier curves one can construct intermediate points Q0
and Q1 such that as t varies from 0 to 1:Point Q0 varies from P0 to P1 and describes a linear Bézier curve. Point Q1 varies from P1 to P2 and describes a linear
Bézier
curve.
Point
B
(
t) varies from Q0 to Q1 and describes a quadratic Bézier curve.
7. Curves and Curve Modeling
Curve
passes
through
P
0
,
P
1
&
P
2
points
.
Dr. Ahmet Zafer Şenalp ME 521
63
Mechanical Engineering Department, GTUSlide64
Bezier CurvesHigher Order
Curves
For higher-order curves one needs correspondingly more intermediate points.Cubic Bezier CurveCurve passes
through
P
0
,
P1, P2 & P3 points.
For cubic curves one can construct intermediate points
Q
0
,
Q
1
&
Q
2
that describe linear
Bézier
curves, and points
R
0
&
R
1
that describe quadratic
Bézier
curves
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
64
Mechanical Engineering Department, GTUSlide65
Bezier CurvesBernstein Polynomials
7. Curves and Curve Modeling
Most of the graphics packages confine Bézier curve with only 4 control
points
.
Hence
n
= 3 .
Bernstein
pol
inomials
t
f(t)
1
1
B
B1
B
B4
B
B2
B
B3
Dr. Ahmet Zafer Şenalp ME 521
65
Mechanical Engineering Department, GTUSlide66
Bezier Curves Higher Order
Curves
Fourth Order Bezier CurveCurve passes
through
P
0
,
P1, P2, P3 & P4 points.
For fourth-order curves one can construct intermediate points Q0
,
Q
1
,
Q
2
&
Q
3
that describe linear
Bézier
curves, points
R
0
,
R
1
&
R
2
that describe quadratic
Bézier
curves, and points
S0
&
S
1
that describe cubic
Bézier
curves:
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
66
Mechanical Engineering Department, GTUSlide67
Bezier Curves Polinomial Form
Sometimes it is desirable to express the Bézier curve as a polynomial instead of a sum of less straightforward
Bernstein polynomials. Application of the binomial theorem to the definition of the curve followed by some rearrangement will yield:
and
This could be practical if
C
j
can be computed prior to many evaluations of
B(t); however one should use caution as high order curves may lack numeric stability (de
Casteljau's algorithm should be used if this occurs).
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
67
Mechanical Engineering Department, GTUSlide68
Bezier Curves Example:
Coordinatess of 4 control poits are given as:
7. Curves and Curve ModelingWhat is the equation of Bezier
curve
that
will be obtained by using above points?What are
the coordinate
values
on
the
curve
corresponding
to
t=0,1/4,2/4,3/4,1 ?
Solution
:
For
4
points
3.
order
Bezier
form is
used
:
Points
on B(t)
curve
:
Bezier
curve
equation
Dr. Ahmet Zafer Şenalp ME 521
68
Mechanical Engineering Department, GTUSlide69
Bezier Curves Example:
Equation of Bezier curve:
7. Curves and Curve Modeling
Control
points
Points
on B(t)
curve
Dr. Ahmet Zafer Şenalp ME 521
69
Mechanical Engineering Department, GTUSlide70
Bezier Curves DisadvantagesDifficult to interpolate points
Cannot locally modify a Bezier curve
7. Curves and Curve ModelingDr. Ahmet Zafer Şenalp ME 521
70
Mechanical Engineering Department, GTUSlide71
Bezier
Curves
Global
Change
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
71
Mechanical Engineering Department, GTUSlide72
Bezier
Curves
Local
Change
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
72
Mechanical Engineering Department, GTUSlide73
Bezier Curves Example
7. Curves and Curve Modeling
2 cubic composite Bézier curve - 6. order Bézier curvecomparisson
Dr. Ahmet Zafer Şenalp ME 521
73
Mechanical Engineering Department, GTUSlide74
Bezier Curves Modeling Example
7. Curves and Curve Modeling
Contains 32 curve
Polygon
representation
Dr. Ahmet Zafer Şenalp ME 521
74
Mechanical Engineering Department, GTUSlide75
B-Spline CurvesB-splines are generalizations of Bezier curves
A major advantage is that they allow local controlB-spline is a spline function that has minimal support with respect to a given
degree, smoothness, and domain partition. A fundamental theorem states that every spline function of a given degree, smoothness, and domain partition, can be represented as a linear combination of B-splines of that same degree and smoothness, and over that same partition. The term B-spline was coined by Isaac Jacob Schoenberg and is short for basis spline. B-splines can be evaluated in a numerically stable way by the de Boor algorithm.A B-spline is simply a generalisation of a
Bézier
curve
, and it can avoid the
Runge
phenomenon
without increasing the degree of the B-spline.The degree of curve obtained is independent of number of control points
.Enables
up
to
C
2
continuity
.
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
75
Mechanical Engineering Department, GTUSlide76
B-Spline CurvesP
i defines B-Spline curve with given
n+1 control points:7. Curves and Curve Modeling
Here
N
i,k
(u)
is B-
Spline functions are proposed by Cox and
de Boor in 1972
.
k
parameter
controls
B-
Spline
curve
degree
(k-1)
and
generally
independent
of
number
of
control
points
.
u
i
is
called
parametric
knots
or
(
knot
vales
)
for
an
open curve B-Spline:
aksi durumda
Dr. Ahmet Zafer Şenalp ME 521
76
Mechanical Engineering Department, GTUSlide77
This inequality shows that;for linear curve at least 2for 2. degree
curve at least 3for cubic
curve at least 4 control points are necessary.B-Spline Curves
7. Curves and Curve Modeling
if a curve with (
k-1) degree and
(
n+1) control points is to be developed, (n+k+1) knots
then
are
required
.
Dr. Ahmet Zafer Şenalp ME 521
77
Mechanical Engineering Department, GTUSlide78
Linear functionk=2B-Spline Curves
7. Curves and Curve Modeling
Below figures show B-Spline functions:
2.
degree
function
k=3
cubic
function
k=4
Dr. Ahmet Zafer Şenalp ME 521
78
Mechanical Engineering Department, GTUSlide79
Number of control points is independent than the degree of the polynomial.
B-Spline
CurvesProperties7. Curves and Curve Modeling
The higher the order of
the B-
Spline
, the less the
influence the closecontrol point
Linear
k=2
vertex
Quadratic
B-
Spline
; k=3
Cubic
B-
Spline
; k=4
Fourth
Order
B-
Spline
;
k=5
n=3
vertex
vertex
vertex
Dr. Ahmet Zafer Şenalp ME 521
79
Mechanical Engineering Department, GTUSlide80
B-spline allows better local control. Shape of the curvecan be adjusted by moving the control points. Local control: a control point only influences k segments.B-Spline
Curves
Properties7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
80
Mechanical Engineering Department, GTUSlide81
B-Spline Curves Example
:
Cubic Spline; k=4, n=38 knots are required.7. Curves and Curve Modeling
Limits
of u
parameter
:
Bezier
curve equality;reminder :
Equation
results
8
knots
reminder
:
To
define a (k-1)
degree
curve
with
(n+1)
control
points
(n+k+1)
knots
are
required
.
B-
S
pline
vector
can be
calculated
together
with
knot
vector
;
*
Dr. Ahmet Zafer Şenalp ME 521
81
Mechanical Engineering Department, GTUSlide82
B-Spline Curves Example
:
7. Curves and Curve Modelingaksi durumda
aksi durumda
aksi durumda
else
else
else
Dr. Ahmet Zafer Şenalp ME 521
82
Mechanical Engineering Department, GTUSlide83
B-Spline Curves Example
:
7. Curves and Curve ModelingDr. Ahmet Zafer Şenalp ME 521
83
Mechanical Engineering Department, GTUSlide84
B-Spline Curves Example
:
7. Curves and Curve ModelingDr. Ahmet Zafer Şenalp ME 521
84
Mechanical Engineering Department, GTUSlide85
B-Spline Curves Example
:
7. Curves and Curve ModelingReplacing into Ni,4 * equality;
By replacing N
i,3
into the above equality the B-
Spline
curve equation given below is obtained.
This equation is the same with Bezier curve with the same control points.
Hence cubic B-
Spline
curve with 4 control points is the same with cubic Bezier curve with the same control points.
Dr. Ahmet Zafer Şenalp ME 521
85
Mechanical Engineering Department, GTUSlide86
Bezier Blending Functions; Bi,nB-spline Blending Functions; N
i,k
Bezier /B-Spline Curves
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
86
Mechanical Engineering Department, GTUSlide87
Bezier /B-Spline
Curves
7. Curves and Curve ModelingPoint that is
moved
This
point
is
movingThis point is not moving
Dr. Ahmet Zafer Şenalp ME 521
87
Mechanical Engineering Department, GTUSlide88
When B-spline is uniform B-spline functions with n degrees are just shifted copies
of each other.Knots are
equally spaced along the curve.Uniform B-Spline
Curves
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
88
Mechanical Engineering Department, GTUSlide89
Rational Curves and NURBSRational polynomials can represent both analytic and polynomial curves in a uniform wayCurves can be modified by changing the weighting of the control points
A commonly used form is the Non-Uniform Rational B-spline (NURBS)
7. Curves and Curve ModelingDr. Ahmet Zafer Şenalp ME 521
89
Mechanical Engineering Department, GTUSlide90
Rational Bezier CurvesThe rational Bézier adds adjustable weights to provide closer approximations to arbitrary shapes. The numerator is a weighted Bernstein-form Bézier curve and the denominator is a weighted sum of Bernstein polynomials. Given n + 1 control points Pi, the rational Bézier curve can be described by:
7. Curves and Curve Modeling
or
simply
Dr. Ahmet Zafer Şenalp ME 521
90
Mechanical Engineering Department, GTUSlide91
Rational B-Spline CurvesOne rational curve is defined by ratios of 2 polynomials.
In rational curve control points are defined in homogenous coordinates.Then rational B-Spline curve can be obtained in the following form:
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
91
Mechanical Engineering Department, GTUSlide92
Rational B-Spline Curves
Ri,k(u) is
the rational B-Spline basis functions.The above equality show that; Ri,k
(u)
basis
functions
are the generelized form of Ni,k(u).When
h
i
=1
is
replaced
in
R
i
,k
(u)
equality
shows
the
same
properties
with
the
nonrational
form.
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
92
Mechanical Engineering Department, GTUSlide93
NURBSIt is non uniform rational B-Spline formulation. This mathematical model is generally used for constructing curves and surfaces in computer graphics.
NURBS curve is defined by its degree, control points with weights and knot vector.NURBS curves and surfaces are the generalized form of both B-spline and Bézier curves and surfaces.
Most important difference is the weights in the control points which makes NURBS rational curve.NURBS curves have only one parametric direction (generally named as s or u). NURBS surfaces have 2 parametric directions.NURBS curves enables the complete modeling of conic curves.7. Curves and Curve ModelingDr. Ahmet Zafer Şenalp ME 521
93
Mechanical Engineering Department, GTUSlide94
NURBSGeneral form of a NURBS curve;
k:
is the number of control points (Pi) wi: weigthsThe denominator is a normalizing factor that evaluates to one if all weights are one. This can be seen from the partition of unity property of the basis functions. It is customary to write this as
R
in
:
are known as the
rational basis functions
.
7. Curves and Curve Modeling
Dr. Ahmet Zafer Şenalp ME 521
94
Mechanical Engineering Department, GTUSlide95
NURBSExamplesUniform knot vector
7. Curves and Curve Modeling
Nonuniform
knot
vector
Dr. Ahmet Zafer Şenalp ME 521
95
Mechanical Engineering Department, GTUSlide96
NURBSDevelopment of NURBS
Boeing: Tiger System in 1979SDRC: Geomod in 1993University of Utah: Alpha-1 in 1981Industry Standard: IGES, PHIGS, PDES,Pro/E, etc.
7. Curves and Curve ModelingDr. Ahmet Zafer Şenalp ME 521
96
Mechanical Engineering Department, GTUSlide97
NURBSAdvantagesServe as a genuine generalizations of non-rational B-spline forms as well as rational and non-rational Bezier curves and surfaces
Offer a common mathematical form for representing both standard analytic shapes (conics, quadratics, surface of revolution, etc) and free-from curves and surfaces precisely. B-splines can only approximate conic curves.
By evaluating a NURBS curve at various values of the parameter, the curve can be represented in cartesian two- or three-dimensional space. Likewise, by evaluating a NURBS surface at various values of the two parameters, the surface can be represented in cartesian space.Provide the flexibility to design a large variety of shapes by using control points and weights. increasing the weights has the effect of drawing a curve toward the control point.7. Curves and Curve ModelingDr. Ahmet Zafer Şenalp ME 521
97
Mechanical Engineering Department, GTUSlide98
NURBSAdvantagesHave a powerful tool kit (knot insertion/refinement/removal, degree elevation, splitting, etc.)
They are invariant under affine as well as perspective transformations: operations like rotations and translations can be applied to NURBS curves and surfaces by applying them to their control points. Reasonably fast and computationally stable.
They reduce the memory consumption when storing shapes (compared to simpler methods). They can be evaluated reasonably quickly by numerically stable and accurate algorithms. Clear geometric interpretations7. Curves and Curve ModelingDr. Ahmet Zafer Şenalp ME 521
98
Mechanical Engineering Department, GTU