0% found this document useful (0 votes)
9 views35 pages

Curves I

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views35 pages

Curves I

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Curves and Surfaces

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D.

Universidad EAFIT
[email protected]

2024

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 1 / 35
Contents

1 Curves and Surfaces


Curves and Surfaces: The problem

2 End

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 2 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: The Problem

Given a finite set of points sampled on a curve or surface, how to find a


mathematical expression of such a set.

When the order of the point set is not meaningful, there are two
techniques widely used: (a) polynomial interpolation and (b) statistical
equation fitting. When the order of the point sample must be respected,
parametric forms are applied.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 3 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Polynomial interpolation

Interpolation is a method of finding new data points based on the range of


a discrete set of known data points.

In engineering , one often has a number of data points, obtained by


experimentation or numerical simulation. It is often required to estimate
the value of that function for an intermediate value of the independent
variable.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 4 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Polynomial interpolation

the amplitude of oscillation of a beam is given by:

Time (s) Amp (mm)


0 0
1 0.8415
2 0.9093
3 0.1411
4 0.7568
5 0.9589
6 0.2794
for example we want to estimate the amplitude of oscillation when the
time is 0.5 s

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 5 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Polynomial interpolation

Linear interpolation

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 6 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Polynomial interpolation

Cubic interpolation

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 7 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Polynomial interpolation


In mathematical terms, we have n (xi , yi ) data points, and we want to find
a polynomial of degree at most n − 1 going through all the data points.
For example, if we have the points
(x1 , y1 ), (x2 , y2 ), (x3 , y3 ), (x4 , y4 ), (x5 , y5 ). The equation to fit would have
the form:

y1 = a0 + a1 x1 + a2 x12 + a3 x13 + a4 x14


y2 = a0 + a1 x2 + a2 x22 + a3 x23 + a4 x24
y3 = a0 + a1 x3 + a2 x32 + a3 x33 + a4 x34
y4 = a0 + a1 x4 + a2 x42 + a3 x43 + a4 x44
y5 = a0 + a1 x5 + a2 x52 + a3 x53 + a4 x54

With unknowns a0 , a1 , a2 , a3 , a4
Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 8 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Polynomial interpolation

The matrix equation to solve for a0 , a1 , a2 , a3 , a4 takes the form:

1 x1 x12 x13 x14


    
a0 y1
1 x2 x22 x23 x24  a1  y2 
    
1 x3 x 2 x 3 x 4  a2  = y3 
 3 3 3   
1 x4 x 2 x 3 x 4  a3  y4 
4 4 4
1 x5 x52 x53 x54 a4 y5

which can be abbreviated as: Xa = y

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 9 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Polynomial interpolation


As the number of points n increases (polynomials of high degree over a set
of equispaced interpolation points) oscillation at the edges of an interval
that occurs.

the 5th-order interpolating polynomial with equally spaced interpolating


points (blue); and the 9th-order interpolating polynomial with equally
spaced interpolating points (green)
Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 10 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Statistical fitting

In statistical fitting, the designer estimates that the data set adheres to a
particular equation form (linear, quadratic, etc). Therefore the data set is
used to give the best estimation (in statistical sense) of the equation
parameters.
In contrast with polynomial interpolation, the number of samples is not
limited by the number of parameters to estimate (In a linear regression it
is necessary to estimate 2 parameters).
Statistical fitting is widely used in machine learning techniques

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 11 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Statistical fitting

you have used linear regression in your physics courses.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 12 / 35
Curves and Surfaces Curves and Surfaces: The problem

Interpolation vs. Statistical fitting

a) interpolation b) fitting.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 13 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Parametric equation

In contrast with polynomial and statistical fits, a parametric curve C (u)


when fit to a sequence of points S = {p0, p1, ...pn} (S is called control
polygon) changes with the order (sense) of the points in S.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 14 / 35
Curves and Surfaces Curves and Surfaces: The problem

Bézier curves

A Bézier curve is defined by a set of control points P0 through Pn (n + 1


points), where n is called the order of the curve (n = 1 for linear, 2 for
quadratic, etc.). The first and last control points are always the endpoints
of the curve; however, the intermediate control points (if any) generally do
not lie on the curve.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 15 / 35
Curves and Surfaces Curves and Surfaces: The problem

Bézier curves: Linear Bézier curves


Given distinct points P0 and P1, a linear Bézier curve is simply a straight
line between those two points. The curve is given by

C (u) = P0 + u(P1 − P0 ) = (1 − u)P0 + uP1 , 0 ≤ u ≤ 1

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 16 / 35
Curves and Surfaces Curves and Surfaces: The problem

Bézier curves: quadratic Bézier


A quadratic Bézier curve is the path traced by the function C (t), given
points P0 , P1 , and P2

C (u) = (1 − u)2 P0 + 2(1 − u)uP1 + u 2 P2 , 0 ≤ u ≤ 1

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 17 / 35
Curves and Surfaces Curves and Surfaces: The problem

Bézier curves: quadratic Bézier


A quadratic Bézier curve is the path traced by the function C (t), given
points P0 , P1 , and P2

C (u) = (1 − u) [(1 − u)P0 + uP1 ] + u [(1 − u)P1 + uP2 ] , 0 ≤ u ≤ 1

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 18 / 35
Curves and Surfaces Curves and Surfaces: The problem

Bézier curves: cubic Bézier


Four points P0 , P1 , P2 and P3 in the plane or in higher-dimensional space
define a cubic Bézier curve. The curve starts at P0 going toward P1 and
arrives at P3 coming from the direction of P2 . Usually, it will not pass
through P1 or P2 ; these points are only there to provide directional
information
C (u) = (1 − u)3 P0 + 3(1 − u)2 uP1 + 3(1 − u)u 2 P2 + u 3 P3 , 0 ≤ u ≤ 1

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 19 / 35
Curves and Surfaces Curves and Surfaces: The problem

Bézier curves

Bézier curves are widely used in computer graphics to model smooth


curves.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 20 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curve, properties


The curve begins at P0 and ends at Pn ; this is the so-called endpoint
interpolation property

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 21 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curve, properties


The curve begins at P0 and ends at Pn ; this is the so-called endpoint
interpolation property

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 22 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curve, properties


The curve begins at P0 and ends at Pn ; this is the so-called endpoint
interpolation property

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 23 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curve, properties


The curve begins at P0 and ends at Pn ; this is the so-called endpoint
interpolation property

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 24 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curve, properties


The start and end of the curve is tangent to the first and last section of
the Bézier polygon, respectively.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 25 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curve, properties


The start and end of the curve is tangent to the first and last section of
the Bézier polygon, respectively.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 26 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curve, properties

There is no local control in degree n Bézier curves—meaning that any


change to a control point requires recalculation of and thus affects the
aspect of the entire curve, although the farther that one is from the
control point that was changed, the smaller is the change in the curve.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 27 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curve, properties


A Bézier curve of order higher than two may intersect itself or have a cusp
for certain choices of the control points.

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 28 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curve, properties


the curve is contained in the smallest convex polygon generated by
{P0 , · · · , Pn }

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 29 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curve, properties

Invariance of a parametric form under inversion of the originating set


{Pn , · · · , P0 } generates the same curve as {P0 , · · · , Pn }

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 30 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bernstein polynomial

 
n i
Bi,n = u (1 − u)n−i , for i = 0..n.
i
where Bi,n are known
  as Bernstein basis polynomials of degree n. In the
n
previous equation, is the number of combinations of n items taken i
i
 
n
at a time. n and i must be nonnegative integers. Mathematically,
i
can be expressed as:  
n n!
=
i i!(n − i)!
Bernstein polynomial are defined over the interval

[0, 1]

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 31 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bernstein polynomial

These polynomials have these important properties, which hold for any
value of u, in the interval [0, 1]:
n
Bi,n = (t + (1 − t))n = 1
P
1 partition of unity:
i=0
2 Positivity: Bi,n (u) ≥ 0 ∀i ∈ 0 · · · n
3 Symmetry: Bi,n (u) = Bn−i,n (1 − u)

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 32 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bézier curves in terms of Bernstein


polynomial

n   n
X n X
C (u) = (1 − u)n−i u i Pi = Bi,n Pi
i
i=0 i=0

For example, when n = 5:

           
C (u) = 5
0
(1 − u)5 u 0 P0 +
5
1
(1 − u)4 u 1 P1 +
5
2
(1 − u)3 u 2 P2 +
5
3
(1 − u)2 u 3 P3 +
5
4
(1 − u)1 u 4 P4 +
5
0
(1 − u)0 u 5 P5

= (1 − u)5 P0 + 5(1 − u)4 u1 P1 + 10(1 − u)3 u2 P2 + 10(1 − u)2 u3 P3 + 5(1 − u)1 u4 P4 + 5u5 P5
= B0,5 P0 + B1,5 P1 + B2,5 P2 + B3,5 P3 + B4,5 P4 + B5,5 P5

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 33 / 35
Curves and Surfaces Curves and Surfaces: The problem

Curves and Surfaces: Bernstein basis polynomials of degree


5

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 34 / 35
End

Thank You

Juan M. Rodrı́guez P. Eng., M.Sc., and Ph.D. (EAFIT) Cad Cam 2024 35 / 35

You might also like