Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
27 views66 pages

University Institute of Engineering Department of Computer Science & Engineering

The document outlines the requirements and techniques for designing curves and surfaces in computer graphics, focusing on control points, continuity, and various types of curves such as Bezier and B-Splines. It discusses the importance of curve fitting techniques and the properties of Bezier curves, including their applications and limitations. Additionally, it highlights the transition from curves to surfaces using Bezier methods and the role of B-Splines in modeling.

Uploaded by

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

University Institute of Engineering Department of Computer Science & Engineering

The document outlines the requirements and techniques for designing curves and surfaces in computer graphics, focusing on control points, continuity, and various types of curves such as Bezier and B-Splines. It discusses the importance of curve fitting techniques and the properties of Bezier curves, including their applications and limitations. Additionally, it highlights the transition from curves to surfaces using Bezier methods and the role of B-Splines in modeling.

Uploaded by

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

Department of Computer Science and Engineering (CSE)

University Institute of Engineering


DEPARTMENT OF COMPUTER SCIENCE
& ENGINEERING
Bachelor of Engineering (Computer Science & Engineering)
Subject Name: Computer Graphics with lab
Subject Code: 22CSH-352/22ITH-352
Prepared by:
Er. Puneet Kaur(E6913)

DISCOVER . LEARN . EMPOWER


Curves And Surfaces

1
Department of Computer Science and Engineering (CSE)

Outline
• Requirements for Curves and Surface Design
• Curves and Surfaces
• Types of Curves
• Bezier Curve
• B-Spline curve and example

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Requirements for Curves and Surface Design


• Some of the important requirements for designing curves and
surfaces are:
1. Control Points: A common way to control the shape of a curve
interactively is that points through which the curve must pass or points
that control the curve shape in a predictable way. These points are
called as control points or knot points when they lie itself on the curve
itself. A curve is said to interpolate the control points if it passes
through them.

Control Points shown as Dots

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Requirements for Curves and Surface Design


• If you look closely at these curves, you can immediately notice:
• Points are not always on curve. That’s perfectly normal, later we’ll
see how the curve is built.
• The curve order equals the number of points minus one. For
two points we have a linear curve (that’s a straight line), for three
points – quadratic curve (parabolic), for four points – cubic curve.
• A curve is always inside the Convex hull of control points:

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Requirements for Curves and Surface Design


• Multiple Values: Curves are generally multivalued with respect to
any coordinate system. Any design of the curves or surfaces
should take into this account

• Coordinate System independence: The shape of the curve and


surface should not get affected when the control points
are measured with respect to another coordinate system. For
example: The control points are rotated by 90 degree,
the curve should change 90 degree but not change shape

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Requirements for Curves and Surface Design


• Global or Local Control: The control points control the shape
interactively and hence a designer tries to manipulate the
shape of the curve by moving the control points in a
neighborhood or or it may change shape throughout.
• If local point is not maintained by the control points , a small change
in the position of a control point brings in an abnormal change in
the shape of the curve which may leads to undesirable results.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Requirements for Curves and Surface Design


• Order of Continuity: A complex shape is usually not modeled by a single
curve but by several curves placed together end to end . Such joints are used
to introduce sharp corners which might be difficult to represent with in a
curve framework. When creating joints, the designer often wants to control
the order of continuity at the joint.
• Zero order continuity means simply that two curves meet, first order
continuity requires the curves to be tangent at the point of intersection,
second order continuity requires that curvatures be the same.
• Higher order continuity is achieved when higher order derivates (w.r.t the
parameter) are constant across the meeting point.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Requirements for Curves and Surface Design


• Variation diminishing effect: A curve is said to have a variation
diminishing effect if the curve smoothens small variation in the location of
control points.
• Versatility: The techniques for design should be flexible to
generate a potential large set of curves and surfaces i.e. addition or removal
of control points . Example: a curve specified by two control points might
be a straight line connecting the points, introducing a third control point
allows the curve to take on a large number of additional shapes,
depending on the location of the control point.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Requirements for Curves and Surface Design


• Curve Fitting Techniques: Whenever a curve is to be constructed ,
the control points are known to us. The only problem is how to
draw the curve using the given control points. This is done with
the help of curve fitting techniques. This can be categorized as
1. Interpolation
2. Approximation

If the curve passes through all the control points, then it is called
Interpolation. Interpolation techniques is used in generation of spline
curves.
And in approximation , it is not necessary for the curve to pass through
the control points i.e. curve can pass through a point which is closer to
the given control points.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Requirements for Curves and Surface Design

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Curves and Surfaces


• In computer graphics, we often need to draw different
types of objects onto the screen. Objects are not flat all
the time and we need to draw curves many times to draw
an object

Types of Curves
• A curve is an infinitely large set of points. Each point has
two neighbors except endpoints. Curves can be broadly
classified into three categories − explicit, implicit, and
parametric curves.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Modeling with Curves

interpolating data
data points point

approximating
curve

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

What Makes a Good Representation?


• There are many ways to represent curves and surfaces
• Want a representation that is
– Stable
– Smooth
– Easy to evaluate
– Must we interpolate or can we just come close to data?
– Do we need derivatives?

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Implicit Curves
• Implicit Curves
• The set of points on curve are defined by employing a
procedure that can be tested to see if a point is on
the curve. An implicit function is used to define the
implicit curve
f(x, y) = 0(f is a scalar function and it returns a
single real number) x
• The multivalued curves can be represented such as for an
single x value, many y values. The very common
example is circle, and is implicitly represented as:

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Explicit Representation

• The function y = f(x) can be plotted as a curve, which is


known as explicit representation of the curve. For each of
the value of x, a single value y is normally computed by
the function.Cannot represent all curves

• Extension to 3D y
– y=f(x), z=g(x)
y
– The form z = f(x,y) defines a x
surface

x
z

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Parametric Curves
A point on curve is represented as a
vector: p(u)=[x(u), y(u), z(u)]
For Surfaces, two parameters are required

For umax  u  umin


The parameters u and v take on values in a specified range usually 0
and 1. the parametric functions x,y and z trace out the location of the
curve or surface. Functions of this sort easily meet multivalued
requirements. The parametric functions can take many forms. A single
curve can be approximated in several different ways.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Bezier Methods
• Pierre bezier, a French engineer develops an approximation
method for use in the design of Renault Automobiles bodies.
It is useful and convenient for curve and surface design.
Bezier curves are widely used and available in many CAD
systems and in general graphic packages.
• A cubic bezier curve is used because they
provide reasonable design flexibility and also avoid large
number of calculations.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Bezier Curves
• A bezier curve section can be fitted to any number of
control points. The number of control points to
be approximated and their relative position
determine the degree of Bezier polynomial.
• As with interpolation splines, a bezier curves can be
specified with boundary conditions, with a
characterizing matrix or with blending functions.
• For general bezier curves , the blending function
specification is most convenient.
• Suppose we are given n+1 control point positions

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Bezier Curves
• These coordinates point can be blended to produce the
following position vector P(u), which describes the
path of an approximating bezier polynomial
function between P0 and Pn.

Where Bi,n(u) is a blending function. It represents


the Bernstein Polynomial.
n= degree of curve [Total number of control points -1]
Bi,n(u) = C(n,i) ui (1-u)n-i

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Properties of Bezier Curves


1. The basic functions are real.
2. The curve generally follows the shape of the defining polygon.
3. The first and last point on the curve are coincident with the first
and last
points of the defining polygon.
4. The tangent vector at the end of the curve have same direction as first and last
polygon spans respectively.
5. The curve is contained with in the convex hull of the defining polygon.
6. The curve exhibits the variation diminishing property i.e. The curve
doesn't oscillate about any straight line more often than the defining polygon.
7. The convex hull property for a Bezier curve ensures that the polynomial
smoothly follows the control points.
8. The degree of the polynomial defining the curve segment is equal to the total
number of control points minus 1.
9. The order of the polynomial defining the curve segment is equal to the total
number of control points i.e. For a cubic bezier curve , order=4,
degree=3. A curve having 5 control points is of degree=5-1=4 and order
=5
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)

Convex Hull limits the Bezier Curve


• A bezier curve is determined by a defining polygon is known as convex
hull. The Bezier-curve produced by the Bernstein basis function
has limited flexibility
• First, the number of specified polygon vertices fixes the order of the
resulting polynomial which defines the curve.
• The second limiting characteristic is that the value of the blending
function is nonzero for all parameter values over the entire curve.
• Convex Hull= minimal convex polygon enclosing a specified set of
points.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Applications: Bezier Curves


• Bezier curves are used in painting and packages
drawing and CAD systems.
• They are easy to implement reasonably powerful in
and curve design.

Drawbacks:
• Bezier curve do not provide localized control i.e.
Moving any control point changes the
shape of whole curve.
• At joints, complex geometric constructions are required
to
gurantee continuity.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example 2 : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example 2 : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example 2 : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example 2 : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example 3 : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example 3 : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example 3 : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example 3 : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example 3 : Bezier Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Bezier Surfaces
• The formulation of the Bezier curve extends easily to
describe three dimensional surfaces by generating
the Cartesian product of two curves. Two set of
orthogonal bezier curves can be used to design an
object surface by specifying an input mesh of control
points.

• Pi,j specify the location of (n+1) control points


*(m+1) arranged in a mesh.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Bezier Surfaces
• Adjacent points are connected with lines in order to show the mesh.
The surface itself is shown by drawing two set of curves. One set
holds the ‘u’ parameter constant and allows ‘v’ to range from 0 to 1.
other set holds ‘v’ constant and varies ‘u’.

• Bezier surfaces and bezier curves have the same properties and they
provide a convenient method for interactive design applications.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Spline
• A long flexible strips of metal used by
draftspersons to lay out the surfaces of
airplanes, cars and ships
• Ducks weights attached to the splines
were used to pull the spline in different
directions
• The metal splines had second order
continuity

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

B-Splines (for basis splines)


• B-Splines
– Another polynomial curve for modelling curves and surfaces
– Consists of curve segments whose polynomial coefficients only depend on
just a few control points
• Local control
– Segments joined at knots

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

B-splines
• The curve does not necessarily pass through the control
points
• The shape is constrained to the convex hull made by the
control points
• Uniform cubic b-splines has C2 continuity
– Higher than Hermite or Bezier curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

B-Spline Methods
• Splines was a drafting tool to create a smooth curve. In computer
graphics, a curve is built from sections each is generally described
by 3rd degree of polynomial . Some common applications of splines are

• Designing smooth curves
• Modeling smooth surfaces.
• Animation paths
A spline is specified by a set of control points

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

B-Spline Methods

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

B-Spline Methods

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

B-Spline
• B-spline also known as Basts splines or Basis function
B-spline
• Bezier representation has two main disdvantages
1. The number of control point is directly related to the
degree. Therefore, to increase the complexity of the
shape of the curve by adding more control points
requires increasing the degree of the curve or
satisfying the continuity conditions between
consecutive segments of a composite curve.
2. Bezier curve do not provide localized control i.e. Moving
any control point changes the shape of whole curve
or surface , making design of specific sections very
difficult.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

B-Spline
These disadvantages are remedied with the introduction of B-spline (Basis
–spline) representation. General expression for the calculation of
coordinate positions along a B-spline curve in a blending function
formulation as-

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

B-Spline

• Where each blending function is defined over ‘d’ subintervals of


total range of ‘u’.
• The selected set of subinterval endpoints ‘uj’ is refered to as knot
vector . We can choose any values for subinterval
endpoints,
satisfying the relation uj<= uj+1
• Values for umin and umax depends upon the number of
control
points in selection, the value we choose for parameter ‘d’,
how we setup the subinterval (knot Vector).
• Knot Vectors may be uniform, non-uniform and
open
uniform. Depending
Universityupon theof Engineering
Institute knot vectors
(UIE) B-spines
Department of Computer Science and Engineering (CSE)

B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

Order= k-1

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example: B-Spline

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

B-Spline

B-splines are described according to the selected knot-vector


class. Knot vector classify B-splines into various categories
like uniform periodic B-splines, uniform quadratic B-splines, ,
cubic periodic B-splines, open uniform B-splines, open
uniform Quadratic B-splines, Non-uniform B-splines etc.
there is variation in the values of knot vectors in each
category of B-splines

Limitations :
1. B-spline are more complex than Bezier curves.
2. B-splines have to be described according to the knot
vector class. Knot values are obtained using
Blending functions that use recursive functions.
It increases complexity in complex design curves.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Properties: B-Spline

1. The degree of B-spline polynomial is independent of the


number of vertices of the defining polygon.
2. The curve generally follows the shape of the defining polygon.
3. B-spline curve lies with in convex hull boundary formed by the
control points.
4. The curve exhibits the variation diminishing property i.e. The
curve does not oscillate about any straight line move often
than the defining polygon.
5. B-spline allows local control over the curve surface because
each vertex affects the shape of the curve only over a range of
parameter values where its associated basic function is non-
zero.
6. Each section of the spline curve (between two successive knot
values ) is influenced by ‘d’ control points.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

B-Spline Surfaces

1. Formulation of B-spline surface is similar to that for


Bezier splines. We can obtain a vector point function were
a B-spline surface using the Cartesian product of B-spline
blending functions in the form

2. B-spline surfaces exhibits the same properties as those of


their component B-spline curves. A surface can
be constructed from selected values for parameters d1
and d2 (which determine the polynomial degree to be
used) and from the specified knot vector.
3. Example: a prototype helicopter , designed and modelled
by B-spline surface patches.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

FAQ
• Difference between interpolation and extrapolation.
• Difference between Bezier and B-spline Curves

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

References
• Computer Graphics C Version, Donald Hearn and M.Pauline
Baker
Pearson Education.
• Computer Graphics Principles and Practice C.foley, VanDam, Feiner and
Hughes, Pearson Education

University Institute of Engineering (UIE)

You might also like