18MEC207T - Unit 2 - Rev-01
18MEC207T - Unit 2 - Rev-01
1
Mathematical representation of
lines
• Parametric vector equations of straight lines for
various line definition.
• A line with two end points.
• p1 and p2 as the end points ,define a parameter u
such that it has the value 0 and 1 at p1 and p2.
2
Mathematical representation of
lines
From figure triangle opp1
Equation can be written :
U=0
P P2
P1
U=1
P = P1 + P – P1
But the vector p-p1 is proportional
to vector p2-p1 such that O
P - P1 = u P2 - P1
The equation of the line becomes
P= P1+ U P2 –P1 0< U< 1
3
Mathematical representation of
lines
• In scalar form , this equation can be written as
x = x1 + u x2 –x1
y = y1 + u y2 –y2
z= z1 + u z2 –z1
4
Mathematical representation
of circle
• The basic parametric equation of a circle can be written as
x = xc + R cos u 0 < u 2∏
y = yc + R sin u
The parameter u is the angle ,measured
from the x axis to any point on the circle
5
Mathematical representation of circle
Xn+1= xc + Rcos (u+∆u)
Yn+1 = yc +R sin (u+∆u)
• Expanding the xn+1 and yn+1 equations gives
• Xn+1= xc +xn –xc cos ∆u-yn-yc sin ∆u
• Yn+1 = yc +yn - yc cos ∆u –xn-xc sin ∆u
• Circle can start from an arbitrary point and successive points with equal
spacing Can be calculated recursively.
6
Mathematical representation of ellipse
• The ellipse is a curve generated by a point moving in space that at any
position the sum of its distances from points is constant and equal to the
major diameter.
x= xc +A cos u
y = yc + B sin u 0< u<2∏
8
Mathematical representation of parabola
Parabola is defined mathematically as a curve generated by a point which moves such that
its distance from a fixed point is always equal to its distance to a fixed line .
The local coordinates system of the parabola and parametric equation can be written as
x = x+Au2
y = y + 2AU
9
Mathematical representation of parabola
10
Need for synthetic curves
• When a curve is represented by collection of data
points and when an existing curve must meet new
design requirements .
• Here the data points are called control points
• Mathematically , synthetic curves represent a curve
fitting problem to construct smooth curve .
11
Types of synthetic curves
• Hermite cubic spline
• Bezier curve
• B-spline curves
12
Cubie spline
• The cubic spline passes through the data points and
therefore it is an interpolation .
• Bezier and b-spline curves in general approximate
the data points.
• Both the cubic spline and bezier curves have a first
order continuity and b-spline curve has a second
order continuity
13
Hermite cubic splines
• Parametric cubic spline curve connects two data
points and utilizes a cubic equation.
• The parametric equations of cubic spline segment is
given by
14
Hermite cubic splines
🗐Where u is the parameter and ci are the polynomial .
🗐In an expanded vector equation can be written as
P(u) = c3u3+c2u2+c1u +c0
🗐This equation can be written in a matrix form as
p(u) = uT C
15
Hermite cubic splines
• In order to find the coefficients ci consider the cubic
spline curve with the two endpoints po and p1 .
• Applying the boundary conditions at u=0 and u= 1
at both points
P0 =c0
P’0= c1
pl = c3 +c2+c1+c0
p’1 = 3c3 +2c2 +c1+c0
16
Hermite cubic splines
In order to find the coefficients ci consider the cubic spline curve with
the two endpoints po and p1 .
Applying the boundary conditions at u=0 and u= 1 at both points
P0 =c0 so
P’0 = c1
pl = c3 +c2+c1+c0
P’1 = 3c3 +2c2 +c1+c0
Solving these four equations simultaneously for coefficients gives
C0 = P0
c1 = P’0
c2 = 3(pl - P0 ) – 2(P’0 - P’1 )
c3 = 2(P0- pl) + P’0 + P’1
17
Hermite cubic splines
• Hermit cubic spline in terms of its two end points and their
tangent vectors
• The equation shows that passes through the end points .
• It also shows that the curve shape can be controlled by
changing its end points or its tangent vectors .
18
Bezier curves
• Shape of bezier curve is controlled by its defining
points only
• First derivatives are not used in curve development
in the case of cubic spline.
• This allows the designer a much better feel for the
relationship between input points and output
curves
19
Bezier curves
• The Bezier curve is defined in terms of the locations
of n+1 points .
• These points are called data or controlled points
20
Bezier Curve Properties
• The curve interpolates the first and last control points i.e it
passes through po and Pn if we substitute u=0 .
• The curve is tangent to the first and last segments of the
characteristic polygon the rth points for starting and ending .
• The curve is symmetric with respect to u and (1-U).
• This means that the sequence of control points defining the
curve can be reversed without changing the curve shape .
• The interpolation polynomial has a maximum value of
occurring at u =i|\n
21
• A closed bezier curve can simply be generated by
closing po and pn to be coincident
• For any valid value of u , the sum of the functions
associated with the control points
Is always one for any degree bezier curve .
• Convex hull Convex polygon formed by connecting the
control points of the curve.
22
Applications of Bezier Curves
Computer Graphics
• Bezier curves are widely used in computer graphics to model smooth curves.
• The curve is completely contained in the convex hull of its control points.
• So, the points can be graphically displayed & used to manipulate the curve intuitively.
Animation
• Users outline the wanted path in bezier curves.
• The application creates the needed frames for the object to move along the path.
• For 3D animation, bezier curves are often used to define 3D paths as well as 2D curves.
Fonts
• True type fonts use composite bezier curves composed of quadratic bezier curves.
• Modern imaging systems like postscript, asymptote etc use composite bezier curves composed of
cubic bezier curves for drawing curved shapes.
23
B-Spline curve
n
• P(u) = ∑ Ni,k(u)pi (u0 < u < um).. (1.0)
i=0
Where basis function = Ni,k(u)
Degree of curve 🡪 k-1
Control points, pi 🡪 0 < i < n
Knot, u 🡪 u0 < u < um
m=n+k
24
B-Spline : definition
• P(u) = ∑ Ni,k(u)pi (u0 < u < um)
• ui 🡪 knot
• [ui, ui+1) 🡪 knot span
• (u0, u1, u2, …. um )🡪 knot vector
• The point on the curve that corresponds to a knot ui, 🡪
knot point ,P(ui)
• If knots are equally space 🡪 uniform (e.g, 0, 0.2, 0.4,
0.6…)
• Otherwise 🡪 non uniform (e.g: 0, 0.1, 0.3, 0.4, 0.8 …)
25
B-Spline
• Uniform knot vector
• Individual knot value is evenly spaced
• (0, 1, 2, 3, 4)
• Then, normalized to the range [0, 1]
• (0, 0.25, 0.5, 0.75, 1.0)
26
Characteristics of B-Spline
• The local control can be achieved by changing
the position of a control points using multiple control points
• A no periodic b -spline curve passes through the first and
last control points and is tangent to the first and last
segments of the control polygon .
• Increasing the degree of the curve tightens it. In general the
less the degree the closer the curve gets to the control points
• A second degree curve is always tangent to the midpoints of
all the internal polygon segments .
27
Characteristics of B-Spline
• If k equals the number of control points n+1 , then
the resulting b-spline curve becomes a bezier
curve .
• Multiple control points induce regions of curvature
in a b-spline ,the curve is pulled more towards a
control points by increasing its multiplicity .
28
Characteristics of B-Spline
• The Curve may be represented as collection of points
provided the points are properly spaced, connection of
points short straight line , segments of line yield as an
adequate visual representation of curve.
29
Curve Fitting Techniques
• Curve fitting is the process of constructing a curve, or
mathematical function, that has the best fit to a series of
data points, possibly subject to constraints.
30
Curve fitting ( manipulations) Techniques
1. Displaying – Displaying of curve entities with different colour using
better visualization techniques
2. Evaluating points on the curve : To calculate all the coordinate points
on the curve by substituting successive value of parameter (u) in the
equation efficiently.
3. Blending : the construction of composite curve from the various types
of parametric curves forms the core blending.
4. Segmentation : Segmentation or curve splitting is replacing one
existing curve by one or more curve segment of the same type of
original curve such that shape of the composite curve identical to
that od original curve.
5. Trimming : truncate a curve
6. Transformations : Translation, rotation, mirror and scale
31
Bezier curve blending functions
• The shape of the curve is determined by a collection of
control points and blending functions that combine them.
32
Bezier curve blending functions
33
Segmentation
• Segmentation or curve splitting is defined as replacing one existing curve by
one or more curve segments of the same curve type such that the shape of
the composite curve is identical to that of the original curve.
34
Segmentation of a curve
35
Segmentation of a curve
• Ex: Closed curve has to be split for modeling purposes.
• To split a line connecting two points P0 and P1 at a point P2, all that is needed is to define
two new lines connecting the point pairs (P0, P2 ) and (P2, P1 ).
• For circles and conics, the angle corresponding to the splitting point together with the
starting and ending angles of the original curve defines the proper range of the
parameter u (in this case the angle) for the resulting segments.
• Polynomial curves such as cubic splines, Bezier curves and B-spline curves require a
different parameter transformation.
36
Trimming
• Trimming curves or entities is a very useful function provided by all
CAD/CAM systems.
• Only difference is that the result of trimming a curve is only one segment of
the curve bounded by the trimming boundaries.
37
Trimmed curve
38
Parametric representation of plane
surface and ruled surface
39
Surface Modeling
• Surface modeling is a widely used modeling technique in
which objects are defined by their bounding faces.
• Surface modeling systems contain definitions of surfaces,
edges, and vertices
Mesh Generation
• Whenever the user requests the display of the surface with a mesh size m x n
🗐 The u range is divided equally into (m-1) divisions and m values of u are
obtained.
🗐 The v range is divided equally into (n-1) divisions and n values of v are obtained.
41
Parametric representation Surface Modeling
42
Surface Representation
Surfaces can be described by
nonparametric or parametric
equations. Figure 3. 3 shows
parametric representation of a
surface. The parametric equation
of three-dimensional curved
surface is
43
• The parametric variable u and v are constrained to intervals bounded by
minimum and maximum values [ 0,1].
• A surface can also be divided into a number of topological patches.
• A Patch is considered the basic mathematical element to create composite
surface.
• Figure 3.4 shows a two-patch surface where u and v values are between [0, 1].
• Topology patch may be rectangular or triangular
44
45
Curves on the surfaces can be generated by fixing one parametric variable, say u,
to obtain a curve in terms of variable v.
The mesh size determines the number of curves displayed.
There are two tangent vectors at any point P(u, v) on the surface. These vectors
are given by and
46
The two equations can be written as
The twist vector is the rate of change of the tangent vector Pu with respect to
v or Pv with respect to u, or it is the cross (mixed) derivative vector at the
point. The twist vector can be written in terms of its Cartesian components as
47
• The twist vector depends on both the surface
geometry and its parameterization.
• Each rectangular surface has sixteen vectors and four
boundary curves.
• These vectors are
🗐 four position vectors (four corners),
🗐 eight tangent vectors (two at each corner) and
🗐 four twist vectors at corners.
48
The surface normal at a point is a vector that is
perpendicular to both tangent vectors at the point,
that is:
N(u, v) =
49
Parametric Representation of Analytical Surfaces
Plane Surface -1
The parametric equation of a plane defined by three points, P 0, P1, and P2
50
2- Ruled Surface
A ruled surface is generated by joining corresponding points on two space curves
(rails) G(u) and Q(u) by straight lines
52
Bezier Surface
⚫ A tensor product Bezier surface is an
extension of the Bezier curve in two
parametric dimensions u and v.
⚫ An orderly set of data or control points is
used to build a topologically rectangular
surface as shown in Fig.
⚫ The surface equation can be written as,
P(u, v) = 0<=u<=1,
0<=v<=1
53
Bezier Surface
⚫ In addition, the Bezier surface possesses the convex hull property.
⚫ The convex hull in this case is the polyhedron formed by connecting the furthest control
points on the control polyhedron.
⚫ The convex hull includes the control polyhedron of the surface as it includes the control
polygon in the case of the Bezier curve.
⚫ The shape of the Bezier surface can be modified by either changing some vertices of its
polyhedron or by keeping the polyhedron fixed and specifying multiple coincident
points of some vertices.
⚫ Moreover, a closed Bezier surface can be generated by closing its polyhedron or
choosing coincident corner points as illustrated in Fig.
54
Bezier Surface
• In the design environment, the Bezier surface is superior to a
bicubic surface in that it does not require tangent or twist
vectors to define the surface.
• However, its main disadvantage is the lack of local control.
• Changing one or more control point affects the shape of the
whole surface.
• Therefore, the user cannot selectively change the shape of part
of the surface.
55
Bezier Surface
• A composite Bezier curve can have C0 (positional) and/or C1 (tangent)
continuity.
• A positional continuity between two patches requires that the common
boundary curve between the two patches must have a common boundary
polygon between the two characteristic polyhedrons, see Fig a.
• For tangent continuity across the boundary, the segments, attached to the
common boundary polygon, of one patch polyhedron must be collinear with
the corresponding segments of the other patch polyhedron, as shown in Fig b.
• This implies that the tangent planes of the patches at the common boundary
curve are coincident.
56
Bezier surface
• The surface takes the general shape of the control points. set of
control points is usually referred to as the Bezier net or control
net.
• The Basis functions of a Bezier surface are the coefficients of
control points.
• The corner of the surface and the corner control points are
coincident. Affine transformation can be applied to Bezier
surfaces.
• Affine transformation is a linear mapping method that preserves
points, straight lines, and planes. Sets of parallel lines remain
parallel after an affine transformation. The affine
transformation technique is typically used to correct for
geometric distortions or deformations that occur with non-ideal
camera angles.
57
Bezier surface
• This will help reduce the degree of the Bezier surface patch to a
manageable value.
58
General Equation of the Bezier surface is given
as,
• 0 ≤ u ≤1, 0≤ v ≤1
• P(u,v) is any point on the surface
• Pi,j defines the rectangular array of(m+1)*(n+1) control points
• Bi,m (u) and Bj,n (v) are the i and j Bezier basis functions in the
u and v directions.
• B i, m(u)= ui (1-u)m-i
60
B-Spline Surface
• This is a synthetic surface that can approximate or
interpolate the given input data. The surface is capable of
giving very smooth contours, and can be reshaped with
local controls.
61
B-Spline Surface
• The tensor product method used
with Bezier curves can extend
B-splines to describe B-spline
surfaces.
• A rectangular set of data (control)
points creates the surface.
• This set forms the vertices of the
characteristic polyhedron that
approximates and controls the
shape of the resulting surface.
• A B-spline surface can approximate
or interpolate the vertices of the
polyhedron as shown in Fig.
62
Bicubic B-Spline Patch
63
B-Spline Surface
• The degree of the surface is independent of the number of control
points and continuity is automatically maintained throughout the
surface by virtue of the form of blending functions. As a result,
surface intersection can easily be managed.
• B-spline surfaces have the same characteristics as B-spline curves.
• Their major advantage over Bezier surface is the local control.
• Composite B-spline surfaces can be generated with C0 and/or C1
continuity in the same way as composite Bezier surfaces.
• A rectangular set of data points creates the surface.
• This set forms the vertices of the characteristic polyhedron that
approximates and controls the shape of the resulting surface.
64
B-Spline Surface
• Non negativity the product of Ni,k (u) and Nj,l (v) is non negative for all k,l,i,jand u,v the
range of 0 and 1.
• Convex hull property A B-spline defined by its control points pij
• Affine transformation can be applied to B-spline surface.
• The weakness of B-spline surface is that primitive surfaces such as cylinders, spheres and
cones cannot be represented precisely. Since it approximates these surfaces ,dimensional
error occur when machining the surfaces.
• A B-spline surface patch defined by an (n+1) *(m+1)array of control points is given by
extending eqn into dimensions
• 0 ≤ u ≤ Umax , 0≤ v ≤ Vmax
65
Coons Surface
⚫ The above surfaces are used with either open boundaries
or given data points. The Coons patch is used to create a
surface using curves that form closed boundaries.
66
Interpolated Surfaces – Coons Patch
• A linear interpolation between four bounded curves is used
to generate a Coons surface, also called as Coons patch. The
method is credited to S. Coons who developed this concept
for generating a surface.
• Linear interpolation between the boundary curves P(0,v),
P(u,0), P(1,v) , and P(u,1) gives the equation
67
Interpolated Surfaces – Coons Patch
• It is a form of “transfinite interpolation” which indicates that the
Coons scheme interpolates to an infinite number of data points, that
is, to all points of a curve segment, to generate the surface.
• The Coons patch is particularly useful in blending four prescribed
intersecting curves which form a closed boundary as shown in Fig.
• The figure shows the given four boundary curves P(u, 0), P(u, 0),
P(u, 0) and P(u, 0).
• It is assumed that u and v range from 0 to 1 along these boundaries
and that each pair of opposite boundary curves are identically
parameterized.
68
Application
• One of the important application of the coon surface is the auto body styling.
• The first step in auto body styling is the production of clay or wooden model of external shape
of the car.
• This profile as envisaged by the artist is to be communicated to the cad database for further
refining.
• The car body style is digitalized using a Coordinate Measuring Machine (CMM) where a probe
of the appropriate tip touches the model surface to record a number of points.
• The probe is moved over the model along certain predefined lines, called feature lines.
• CMM digitizes these feature lines into a sequence of points and feeds into the cad data base.
• The cad system fits these points into a network of curves from which a surface description of the
model is generated.
• For generating the surface from network of curves, Coons surface methods are used.
69
Parametric representation of surface
of revolution and tabulated cylinder
70
Tabulated Cylinder
71
Tabulated Cylinder
A tabulated cylinder has been defined as a surface that results from translating a
space planar curve along a given direction.
• The parametric equation of a tabulated cylinder is given as
Where
G(u) can be any wireframe
entities to form the cylinder
73
• The planar curve G(u) can be any wireframe entities.
• The position vector of any point P(u , v) on the surface can be
written as
Where:
• G(u) can be any wireframe entities to form the cylinder
• v is the cylinder length
• is the cylinder axis
74
Fig . Tabulated Cylinder
75
Surface of Revolution
Surface of revolution is generated by rotating a planar curve in space about an axis at
a certain angle.
76
Sculptured Surface
• Sculptured surfaces are used in geometric modelling to
describe all sorts of bendy things like aeroplane wings, car
bodies, gas-turbine blades, ship's hulls and so on that can't be
described by simple curved surfaces such as cylinders and
cones.
• A Sculptured surface is defined as a collection or sum of
interconnected and bounded parametric patches together with
blending and interpolation formulas . OR
• A Sculptured surface can be defined as a complex surface
formed as a sum of different types of parametric surfaces and
blending surfaces to get the smooth transition across the
surfaces.
77
• These are often called sculptured surfaces or free–form
surfaces.
• The Analytic and Synthetic patches can be used to create a
sculptured surface.
• The surface must be susceptible to APT (Automatically
Programming Tool), or other machining languages, processing
for NC machine tools.
78
Surface Manipulation
• Manipulating the surface during the design phase is
important to achieve the desired result.
• Surface manipulation provides the designer with the
capabilities to use surfaces effectively in design
applications.
Some useful features of surface manipulations are:
🗐 Displaying
🗐 Segmentation
79
Surface Displaying
• A surface is normally displayed in a CAD system as a
mesh of curves on the surface.
• For a parametric surface p(u, v) if u is fixed to a value,
say 0.05, and v is varied from 0 to 1. This generates a
curve on the surface whose u coordinate is a constant.
• This gives the isoparametric curve in the v direction
with u=0.05.
• This is a very inefficient type of display, as depending
upon the parameter increments used for u and v.
• This is sometimes called wireframe display.
80
• Another good method to use to display surfaces is shading.
Various surfaces can be shaded with various colors. Surface
curvatures and other related properties can also be displayed via
shading.
81
Segmentation
• Segmentation is a process of splitting a curve or a surface into a
number of parts such that the composite curve or surface of all
the segments is identical to the parent curve or surface.
• Segmentation is essentially a reparamterising transformation of
a surface while keeping the degree of the surface in u and v
parameter space remains unchanged.
• For example, let a surface patch be defined in the range of
u0<u<um and v0<v<vm
• Let this surface patch be divided at a point (u1 , v1) into four
segments , with two divisions along the u direction and two
along the v direction.
82
Model before and after clean up
83
• The determination of hidden edges and surfaces is
most challenging problems in computer graphics.
• This can be removed by computing ,mainly sorting
and geometric modeling mainly projection and
intersection .
• Algorithms that are applied to set of objects to
remove hidden parts to create a more realistic
images are usually classified in to hidden line and
hidden line algorithms .
84
curved surfaces
85
Hidden line removal and visibility
techniques
86
Classification of hidden line
algorithems
Object space methods
Image space methods
Combination of both hybrid methods
87
Object space method
• An object space algorithm utilizes the spatial and
geometrical relationships among the objects and
scene to determine hidden and visible parts .
• image space methods
• Raster and vector algorithms
• Object space algorithms are more accurate than
image space algorithms
88
Visibility of object views
• Visibility of objects can be depends on the location
of the viewing eye.
• The depth and the distance from various faces of
objects in the scene to the viewing eye .
• Depth comparison is the central criterion utilized by
hidden line algorithms to determine visibility .
• This can be done after the proper view
transformation given.
89
Depth comparision
90
A generic hidden line algorithm
Three dimensional object data
Sorting of image
91
VISIBILITY
TECHNIQUES
• VISIBILITY of the parts of objects depends
on the following factors
• Location of the viewing eye
• The viewing direction
• Type of projection
• Depth or distance from various faces of objects
to the viewing eye
92
TYPES OF VISIBILITY
TECHNIQUES
• Minimax Test
• Containment Test
• Surface Test
• Computing Silhouettes
• Edge Intersections
• Segment Comparisons
• Homogeneity Test
93
Minimax test
• This test provides a quick method to determine if
two polygons overlap .
• It surrounds each polygon with a box by finding its
extends and then checks for the intersections .
•
94
MINIMAX TEST
95
Containment
Test
96
Surface Test
• The depth of two faces can be computed at given points to
decide which one is closer to the viewing eye.
• ax+by+cZ+d = 0
• It can also be achieved by using normal vector to the plane
97
Edge Intersections
This is used to determine the visibility of the
edges
🗐Depth comparison with a line and a face
98
Computing Silhouettes
Set of edges that separates visible faces from
invisible with respect to a given viewing
direction is called silhouette edges.
99
Segment Comparisons
• Scan line are arranged in order from top to
bottom or left to right
• The plane of scan line define segments that
intersects faces in the image
100
Homogeneity
Test
101
SORTING
• An operation that orders a given set of records according to the
selected criterion.
• Records contain the following information about the polygons &
faces that make a scene
• Geometrical Information
• Topological Information
• Viewing Information
• Time of the sort depends on
• No. of records to be processed
• Algorithms
• Initial Ordering of records. (Random Or semi-ordered)
102
COHERANCE
• The interrelationship between a element of scene or its image
is Measure of how rapidly a scene or its image changes.
• TYPES: (Object Space & Image Space Method)
• Edge coherance
• Face Coherance
• Geometric Coherance
• Frame Coherance
• Scan Line Coherance
• Area Coherance
• Depth Coherance
103
• Efficiency of algorithm depends on
• Edge oriented Approach (E x E)
• Silhouette oriented Approach (E x S)
• Area oriented Approach (S x S)
104
PRIORITY ALGORITHM
• It is also known as depth or Z algorithm.
• It is based on sorting all the faces in the scene according to the
largest Z Coordinates.
• If a face intersects more than one face then should go with
other visibility tests.
105
106
AREA ORIENTED ALGORITHM
107
108
Z- BUFFER ALGORITHM
• In z-buffer algorithm requires a z-buffer In which z values
can be sorted for each pixel.
• The z-buffer is initialized to the smallest z-value ,while the
frame buffer is initialized to the background pixel value ,
• Both the frame –and z - buffer are indexed by pixel
coordinates (x,y)
109
Z- BUFFER ALGORITHM
• For each polygon in the scene ,find all the pixels (x,y) that
lies inside or on the boundaries of the polyon when
projected onto the screen.
• For each of these pixels , calculate the depth z of the polygon
At (x,y) .
• If z > depth (x,y) , the polygon is closer to the viewing eye
than others already stored in the pixel .
• After all the polygons have been processed , the frame buffer
contains the solution .
110
Color models
Different meanings of color:
• painting
• wavelength of visible light
• human eye perception
111
Material properties
The color of an object depends on the so called
spectral curves for transparency and reflection of
the material
The spectral curves describe how light of different
wavelengths are refracted and reflected (cp. the
material coefficients introduced in the illumination
models)
112
Properties of reflected light
Incident white light upon an object is for some
wavelengths absorbed, for others reflected
E.g. if all light is absorbed => black
If all wavelengths but one are absorbed => the one
color is observed as the color of the object by the
reflection
113
Color definitions
Complementary colors - two colors combine to
produce white light
Primary colors - (two or) three colors used for
describing other colors
Two main principles for mixing colors:
• additive mixing
• subtractive mixing
114
Additive mixing
• pure colors are put close to each other => a mix on the
retina of the human eye (cp. RGB)
• overlapping gives yellow, cyan, magenta and white
• the typical technique on color displays
115
Subtractive mixing
• color pigments are mixed directly in some liquid,
e.g. ink
• each color in the mixture absorbs its specific part of
the incident light
• the color of the mixture is determined by
subtraction of colored light, e.g. yellow absorbs
blue => only red and green, i.e. yellow, will reach
the eye (yellow because of addition)
116
Subtractive mixing,cont’d
• primary colors: cyan, magenta and yellow, i.e. CMY
• the typical technique in printers/plotters
• connection between additive and subtractive
primary colors (cp. the color models RGB and CMY)
117
Additive/subtractive mixing
118
Overview of color models
The human eye can perceive about 382000(!)
different colors
Necessary with some kind of classification sys-tem;
all using three coordinates as a basis:
1) CIE standard
2) RGB color model
3) CMY color model (also, CMYK)
4) HSV color model
5) HLS color model
119
CIE standard
Commission
Internationale de
L’Eclairage (1931)
• not a computer model
• each color = a
weighted sum of three
imaginary primary
colors
120
RGB model
• all colors are generated
from the three
primaries
• various colors are
obtained by changing
the amount of each
primary
• additive mixing (r,g,b),
0≤r,g,b≤1
121
RGB model,cont’d
• the RGB cube
• 1 bit/primary => 8 colors, 8 bits/primary => 16M colors
122
CMY model
• cyan, magenta and
yellow are
comple-mentary colors
of red,green and blue,
respectively
• subtractive mixing
• the typical printer
technique
123
CMY model,cont’d
• almost the same cube
as with RGB; only
black<-> white
• the various colors are
obtained by reducing
light, e.g. if red is
absorbed => green and
blue are added, i.e
cyan
124
RGB vs CMY
If the intensities are represented as 0≤r,g,b≤1 and
0≤c,m,y≤1 (also coordinates 0-255 can be used),
then the relation between RGB and CMY can be
described as:
125
CMYK model
For printing and graphics art industry, CMY is not
enough; a fourth primary, K which stands for black,
is added.
Conversions between RGB and CMYK are possible,
although they require some extra processing.
126
HSV model
• HSV stands for Hue-Saturation-Value
• described by a hexcone derived from the RGB cube
127
HSV model,cont’d
• Hue (0-360°); ”the
color”, cp. the
dominant wave-length
(128)
• Saturation (0-1); ”the
amount of white” (130)
• Value (0-1); ”the
amount of black” (23)
128
HSV model,cont’d
The numbers given after each ”primary” are
estimates of how many levels a human being is
capable to distinguish between, which (in theory)
gives the total number of color nuances:
128*130*23 = 382720
In Computer Graphics, usually enough with:
128*8*15 = 16384
129
HLS model
Another model similar to
HSV
L stands for Lightness
130
LEARNING RESOURCES
Sl. No. TEXT BOOKS
1. Ibrahim Zeid, “Mastering CAD /CAM (Sie )”, Tata Mcgraw-Hill, New Delhi, 2010
REFERENCE BOOKS/OTHER READING MATERIAL
2 P.N. Rao, “CAD/CAM Principles and Application”,3rd Edition, Tata Mcgraw-Hill,
New Delhi, 2012
3 Chris Mcmahon and Jimmie Browne, “CAD/CAM”, Adision Wesly, NewYork, 2000
3 Chandupatla and Belagundu, “Introduction to Finite Element Methods in
Engineering”, Prentice Hal of India Private Limited, New Delhi, 2011
4 Radhakrishnan.P, Subramanyan.S and Raju.V, “CAD/CAM/CIM”, New Age
International Publishers, 2000.
5 Ibrahim Zeid, “CAD/CAM Theory and Practice”, Tata McGraw-Hill Publishing Co.
Ltd., New Delhi, 2010.
6 Newman and Sproul R.F, “Principles of interactive computer graphics”, Tata
Mcgraw-Hill, New Delhi, 2007.
7 K.Lalit Narayan,K.Mallikarjuna Rao and M.M.M.Sarcar, “ Computer Aided Design
and Manufacturing”, Prentice Hal of India Private Limited, New Delhi, 2013.
8 Mikell P. Groover, Emory W. Zimmers Jr., “CAD/CAM:Computer Aided Design and
Manufacturing”, Prentice Hall of India Private Ltd., New Delhi, 2008.
9 131
Donald Hearn and Pauline Baker M, “Computer Graphics C version ”, 2nd Edition,