B.Tech. VII-Sem: Cad/Cam
B.Tech. VII-Sem: Cad/Cam
VII-Sem
CAD/CAM
• Textbooks:
• 1. CAD/CAM Principles and Applications by P N Rao
• 2. CAD/CAM by M. P. Groover and E. W. Zimmers
• 3. CAD/CAM/CIM by P Radhakrishnan, S. Subramanyan and V. Raju
• 4. Mastering CAD/CAM by Ibrahim Zeid
Unit-I
INTRODUCTION
2. Bresenham’s Algorithm
DDA ALGORITHM
BRESENHAM’S LINE DRAWING ALGORITHM
ANTI-ALIASING LINES
L= ⎡x1 y1 ⎤
⎣ x2 y 2 ⎦
Types of transformation
1. Translational transformation
2. Scaling transformation
3. Rotational transformation
4. Shear transformation
5. Reflection or Mirror transformation
1. Translational transformation
Translation involves moving the element from one location to another.
• EXAMPLE
• As an illustration of these transformations in two dimensions,
consider the line defined by two end points (1,1) and (2,4).
• Let us suppose that it is desired to translate the line in space by 2
units in the x direction and 3 units in the y direction. This would
involve adding 2 to the current x value and 3 to the current y value of
the end points defining the line.
• That is, The new line would have end points at (3, 4) and (4, 7). The
effect of the transformation is illustrated in Figure
2. Scaling transformation
• Scaling of an element is used to enlarge it or reduce its size.
• The scaling need not necessarily be done equally in the x and y
directions.
• For example, a circle could be transformed into an ellipse by using
unequal x and y scaling factors.
Concatenation of Transformations
• Many a times it becomes necessary to combine the individual
transformations to achieve the required results.
• In such case, the combined transformation matrix can be obtained by
multiplying the respective transformation matrices.
Homogeneous Representation
• In order to concatenate the transformations, all the transformation
matrices should be of multiplicative type. The following form can be
used to convert the translation transformation into multiplication
form.
3. Rotational Transformation
• where k controls the degree (k-1) of the resulting polynomial in u and also
the continuity of the curve. The ui are the knot values, which relate the
parametric variable u to the pi control points.
B-spline properties
• The plotting of B-spline curve is done by varying the parameter u over
the range of knot values (uk-1, un+1).
• The knot vector adds flexibility to the curve and provides better
control of its shape.
• Partition of Unity: For any knot span, [ui, ui+1],
This property can be deduced from the observation that Ni, k (u) is a
linear combination of Ni, k-1 (u) and Ni + 1, k-1 (u).
B-spline properties
• The curve follows the shape of the control points and lie in the convex hull of the
control points.
• B-splines exhibit local control, i.e., when a control point is moved only that
segment is influenced.
Surface Representation
Surface Representation
•The parametric equation of a surface (Fig. 4.62) is defined by
a set of three functions, one for each coordinate, as follows:
•p (u, v) = [x(u, v), y(u, v), z(u, v)]
•umin ≤ u ≤ umax, and vmin ≤ v ≤ vmax
•where u and v are the parameters for defining the surface in
the u-v plane.
Surface Representation
• where are the unit vectors along the x, y and z directions in the
cartesian space.
• Twist vector
26 September 2020 146
Types of surface
Spherical surface
• The Cartesian representation of a spherical surface with radius r, can be defined
as a set of points (x, y, z) that satisfy the following equation:
• x 2 + y 2 + z2 = r 2
• The same surface in parametric form can be defined in terms of the angular
parameters φ and θ as
• x = r cos φ cos θ, where -π/2 ≤ φ ≤ π/2 and
• y = r cos φ sin θ, -π ≤ θ ≤ π
• z = r sin φ
Surface of revolution
• Surface of revolution is generated by revolving a 2D closed curve
around an axis.
• Closed or open profile can also be used to generate surfaces of
revolution.
Surface of revolution
• As shown earlier, the parametric equation of the entity to be rotated
is
P (u) = [x(u) y(u) z(u)]
• The parametric equation of the revolved surface will be a function of
the rotation angle φ in addition to u as shown in Fig 4.68. Hence any
point on the revolved surface is
Q (u, φ) = [x(u) y(u) cos φ y(u) sin φ]
Ruled Surface
• It is possible to choose any two curves which do not have to be of the
same degree with the same number of control points and the same
number of knots. To develop the parametric equation of the ruled
surface, consider the ruling ui, joining two points on the rails C1(u)
and C2(u). The equation of the ruling is
• P(ui, v) = C2 + v(C1i – C2i)
Generalizing the above equation, we get
• P(u, v) = C2(u) + v[C1(u) – C2(u)] = (1 – v) C2(u) + v C1(u)]
Parametric equation of ruled surface
P(u, v) = C2(u) + v[C1(u) – C2(u)] = (1 – v) C2(u) + v C1(u)]
Synthetic Surfaces
• The analytical surfaces discussed so far are simple, but do not have
sufficient flexibility for designers to work with.
• Synthetic surfaces offer designers with various tools that will help in
developing the desired surface shape.
Hermite Bicubic surface
• Four data points when connected by means of a bicubic equation is
called a Hermite bicubic surface.
: 0 ≤ u ≤ 1, and 0 ≤ v ≤ 1
• Bi,m(u) and Bj,n(u) are the ith and jth Bézier basis functions in the u-
and v- directions, respectively which are defined as follows: