You are on page 1of 81

CAD

CAD is often defined in a variety of ways and includes a large range of


activities. Very broadly it can be said to be the integration of computer
science (or software) techniques in engineering design.
It encompasses the following:
Use of computers (hardware & software) for designing products
Numerical method, optimizations etc.
2D/3D drafting
3D modeling for visualization
Modeling curves, surfaces, solids, mechanism, assemblies, etc.

2D Transformations

World Coordinates
Translate
Rotate
Scale
Viewport Transforms
Putting it all together

Transformations
Rigid Body Transformations - transformations
that do not change the object.
Translate
If you translate a rectangle, it is still a
rectangle
Scale
If you scale a rectangle, it is still a rectangle
Rotate
If you rotate a rectangle, it is still a rectangle

Vertices
We have always represented vertices
as (x,y)
An alternate method is:

Example:

x
( x, y )
y
2.1
(2.1,4.8)

4
.
8

Matrix * Vector
x' a b x
y ' c d y


x' ax by
y ' cx dy
1 0
I

0
1

x' a b c
y ' d e f

z ' g h i
x' ax by cz
y ' dx ey fz
z ' gx hy iz
1 0 0
I 0 1 0
0 0 1

x
y

z

2D geometric transformation
TRANSLATION
A translation is applied to an object by repositioning it along a straight line
path from one coordinate location to another. We translate a twodimensional point by adding translation distances, x and y, to the
original

coordinate

position(x,y) to

move

the

point

to

new

position (x',y').The translation distance (x,y) is called translation


vectors.

Translation
Translation - repositioning an object
along a straight-line path (the
translation distances) from one
coordinate location to another.
(x,y)

(tx,ty)

(x,y)

TRANSLATION

TRANSLATION

Translation of an object
Fig illustrate a translation of triangle about orgin.When the
object is to be moved, all points of it are to be translated.The
translation of key points and connection of these points by other
geometric entities like lines,arcs.etc.

Fig illustrates original position and new positions of the triangle ABC after translation

Translation
Given:

We want:

P ( x, y )
T (t x , t y )
x' x t x
y' y t y

Matrix form: x' x t x


y ' y
ty
P' P T

P (3.7,4.1)
T (7.1,8.2)
x' 3.7 7.1
y ' 4.1 8.2
x' 3.7 7.1
y ' 4.1 8.2

x' 3.4
y ' 4.1

SCALING
Scaling is a kind of transformation in which the size of an object is
changed. Remember the change is size does no mean any change in shape.
This kind of transformation can be carried out for polygons by multiplying
each coordinate of the polygon by the scaling factor. Sx and Sywhich in
turn produces new coordinate of (x,y) as (x',y'). The equation would look
like

Or

S represents the scaling matrix.

SCALING

If the values of scaling factor are greater than 1 then the object is enlarged
and if it is less that 1 it reduces the size of the object. Keeping value as 1
does not changes the object.

Uniform Scaling: To achieve uniform scaling the values of scaling factor


must be kept equal.
Differential Scaling: Unequal or Differential scaling is produce incases
when values for scaling factor are not equal.
As per usual phenomenon of scaling an object moves closer to origin when
the values of scaling factor are less than 1. To prevent object from moving
or changing its position while is scaling we can use a point that is would be
fixed to its position while scaling which is commonly referred as fixed
point (xfyf).

SCALING

SCALING

Scaling of a Point: Mathematically after scaling, the new coordinates


of point P(x , y) are given below:

ROTATION
A two-dimensional rotation is applied to an object by
repositioning it along a circular path in the x-y plane. When we
generate a rotation we get a rotation angle ()and the position
about which the object is rotated (xr, yr) this is known
as rotation point or pivot point. The transformation can also be
described as a rotation about rotation axis that is perpendicular
to x-yplane and passes through the pivot point. Positive values
for the rotation angle define counter-clockwise rotations about
the pivot point and the negative values rotate objects in the
clockwise direction.

2D Rotation

2D Rotation: Rotate the points a specified rotation angle about


the rotation axis.
Axis is perpendicular to xy plane; specify only rotation point
(pivot point , ( xr , yr )

yr

xr

2D Rotation

x 0, y 0
r

x r cos( ) r cos cos r sin sin


y r sin( ) r cos sin r sin cos

x r cos ,

x x cos y sin
y x sin y cos

( x' , y ' )
r

y r sin

( x, y )

cos sin
R

sin cos

P R P
Simplify: rotate around origin:

2D Rotation
x x r ( x x r ) cos ( y y r ) sin
y y r ( x x r ) sin ( y y r ) cos

The matrix expression could be modified to include


pivot coordinates by matrix addition of a column
vector whose elements contain the additive
(translational) term.

Rotation of a point about an arbitrary pivot position:

2D Rotation

Rigid-body translation: Rotates objects without deformation


(every point of the object is rotated through the same angle.

4
3
2

1
0
1

10

Fig illustrates a rotation of a Polygon by 45 in


counterclockwise

Rotation of a point about the origin: Consider the rotation of a point from its initial
position P(x,y) by an angle about the origin, as shown in fig. the counterclockwise
rotation is considered as positive and clockwise rotation as negative .

x= rcos( + ) = rcos cos rsin sin


y = rsin( + ) = rcos sin+ rsin cos
Substituting x= rcos and y= rsin into
equation gives,
x = xcos - y sin
y = xsin + ycos
In matrix form,

P = R . P

Rotation matrix for rotation about z axis is given by


Rz

COS

-SIN

SIN

COS

Rotation matrix for rotation about y axis is given by


Ry

COS

SIN

-SIN COS

Rotation matrix for rotation about x axis is given by


Ry

COS
-SIN
SIN
COS

Reflection

Reflection

Homogeneous Representation

Scaling and Rotation matrices are in the form of matrix multiplication and the
translation takes the form of vector addition.
To concatenate the transformations, all the transformation matrices should be
multiplied.
If a point has Cartesian coordinates (x,y,z), the homogenous coordinates are
(x,y,z,1) where h is the scale factor. The relation between Cartesian and
homogeneous coordinates:
x = x/h, y = y/h, z = z/h
For the geometric transformations, the scale factor h is taken as unity to
avoid unnecessary division.
If a point has Cartesian coordinates (x,y), the homogeneous coordinates are
(x,y,h)

Homogeneous Representation
The Homogeneous Representation of basic transformation is given below:

Three Dimensional Modeling


Transformations

Methods for object modeling


transformation in three dimensions
are extended from two dimensional
methods by including consideration
for the z coordinate.

Three Dimensional Modeling


Transformations

Generalize from 2D by including z coordinate

Straightforward for translation and scale, rotation more


difficult

Homogeneous coordinates: 4 components

Transformation matrices: 44 elements

Three Dimensional Geometric Transformation


To manipulate, to view and/or to modify the 3D objects, it
require the use of 3D geometric and coordinate transformation.
The 2D transformations by adding the z-axis parameter i.e.,
homogeneous coordinate system with 4 x 4 matrix.
The system of x-,y- and z-axis i.e., Cartesian coordinate
system is used to represent an object in 3D.

Three Dimensional Geometric Transformation

The generalized 4 x 4 transformation matrix for 3D homogeneous


coordinates with partitions into separate sections below.

Three Dimensional Geometric Transformation

The 3 x 3 sub matrix produces a linear transformation in the for of scaling,


rotation, reflection , and shearing.
The 3x1 right sub matrix produces translation (j= x, k=y, l=z)
The 1 x 3 sub matrix produces perspective transformation.
The 1 x 1 sub matrix produces overall uniform scaling.

3D Translation
3D Translation of
an object

Homogeneous
coordinates is given by

Translation Matrix is
given by

3D Scaling
If the scaling factor parameter are Sx,Sy,Sz
along x-,y-,z-directions respy,then the new
coordinates of a point on the scaled object is
given by

The Scaling transformation matrix in


homogeneous coordinates is given by

3D Scaling

The Scaling Matrix is given by

The 3D Scaling of an object

3D Point

We will consider points as column vectors.


Thus, a typical point with coordinates (x, y, z)
is represented as:

x
y

z

3D Point Homogenous Coordinate


A 3D point P is represented in
homogeneous coordinates by a 4-dim. Vect:

x
y
P
z

1

3D Point Homogenous Coordinate


We don't lose anything
The main advantage: it is easier to
compose translation and rotation
Everything is matrix multiplication

x
y
z

1

3D Coordinate Systems

Right Hand coordinate


system:

Left Hand coordinate


system:

3D Transformation
In homogeneous coordinates, 3D
transformations are represented by 44
matrixes:

a
d

e
h
0

f
i
0

1
x

HOMOGENEOUS COORDINATES

Basic transformations can be expressed in matrix form. But many graphic


application involve sequences of geometric transformations. Hence we need a
general form of matrix to represent such transformations. This can be expressed as:

Where Pand P' - represent the row vectors.


T1 - is a 2 by 2 array containing multiplicative factors.
T2 - is a 2 element row matrix containing translation terms.

multiplicative and translational terms for 2D geometric transformations


into a single matrix representation by expanding the 2 by 2 matrix
representations to 3 by 3 matrices. This allows to express all transformation
equations as matrix multiplications, providing that also expand the matrix
representations for coordinate positions. To express any 2D
transformations as a matrix multiplication, we represent each Cartesian
coordinate position (x,y)with the homogeneous coordinate triple (xh,yh,h),
such that

general homogeneous coordinate representation can also be


written as (h.x,h.y,h). For 2D geometric transformations, we can
choose the homogeneous parameter h to any non-zero value.
Thus, there is an infinite number of equivalent homogeneous
representations for each coordinate point (x,y). A convenient
choice is simply to h=1. Each 2D position is then represented
with homogeneous coordinates (x,y,1). Other values for parameter
h are needed, for eg, in matrix formulations of 3D viewing
transformations.

Translation
transformation

Rotationtransformation

Scalingtransformation

3D Translation

3D Translation

P is translated to P' by:


x

1
0

0
1

0
0

0
0

0
0

1
0

tx
t y
tz

P T P

x
y

z

1

3D Translation

An object is translated in 3D dimensional by


transforming each of the defining points of the
objects .

3D Translation

An Object represented as a set of polygon surfaces, is


translated by translate each vertex of each surface and
redraw the polygon facets in the new position.

x, y , z

T t x , t y , t z

x ' , y ' , z '

Inverse Translation:

T (t , t , t ) T ( t ,t ,t )
1

3D Rotation

3D Rotation

In general, rotations are


specified by a rotation
axis and an angle. In twodimensions there is only one
choice of a rotation axis that
leaves points in the plane.

3D Rotation

The easiest rotation axes are those


that parallel to the coordinate axis.

Positive rotation angles produce


counterclockwise rotations about a
coordinate axix, if we are looking along the
positive half of the axis toward the
coordinate origin.

GEOMETRIC MODELING
The geometric modeling is the computer compatible mathematical
description of
the geometry of the object.
The mathematical description allows the image of the object to be
displayed and
manipulated on the computer screen and also it can be stored in the
memory and
retrieved back and displayed on the computer screen whenever required.
The geometric modeling can be classified into
1. Wire frame modeling.
2. Surface modeling
3. Solid modeling

Wireframe Models

Modeling of objects & pictures mean description of the objects &


pictures to the computer so as to produce a visual display that
simulates the real thing.
One way to do is to use set of primitives or geometric form that are
simple enough to be easily implemented on the computer & flexible to
represent model.

Simple geometric form are;


(i)
Points and Lines: We specify a line by giving its coordinates in 3-D
such as endpoints of a line P1(x1,y1,z1) & P2.
(ii) Polylines: is a chain of connected line segments. It is specified by
giving the vertices P0,P1.Pn defining the line segment.
(iii) Polygons: Closed polylines

(iv) Polyhedron : is a closed


polygonal net (i.e one which
encloses a definite volume) in
which each polygonal is planar.The
polygons are called the faces of
the polyhedron.
Wireframe Model : consists of
edges, vertices & polygons.Here
vertices are connected by edges &
polygons are sequences of vertices
or edges. The edges may be
curved or straight line segment.
Wireframe Model is called a

Sample rendering of a wireframe cube,


icosahedrons, and approximate sphere

A wireframe model consist of points and curves only, and looks as if its
made up with a bunch of wires. This is the simplest CAD model of an
object. Advantages of this type of model include ease of creation and low
level hardware and software requirements. Additionally, the data storage
requirement is low. The main disadvantage of a wireframe model is that it
can be very confusing to visualize. For example, a blind hole in a box may
look like a solid cylinder, as shown in the figure. In spite of its ambiguity, a
wireframe model is still the most preferred form, because it can be created
quickly and easily to verify a concept of an object. The wireframe model
creation is somewhat similar to drawing a sketch by hand to communicate or
conceptualize an object. As stated earlier, a wireframe model is created
using points and curves only.

WIRE FRAME MODELING

Simple model of 2D projection

Simple 3D wire frame model is shown in fig


(a). Without hidden line removal
line removal

(b). With hidden

WIRE FRAME MODELING


Wire frame modeling is the simplest method of modeling the object.
Wire frame models can be considered as networks of inter connected
lines to represent the edges of the physical objects being modeled.
A typical wire frame may consist of points, lines, arcs, circles,
conies and curves.
There are two types of wire frame modeling 21/2 and 3D
modeling.
Projecting the 2D plane profile along its normal or rotating the 2D
plane profile
about an axes is known as 21/2 D projection. A simplest 2 /2 D
model is shown in fig

Advantages
1. Wire frame models are simple and easy to create, with little
computer time and memory.
2. Wire frame model form the basis for surface model.
3. CPU time required to retrieve, edit or update a wire frame model is
usually small compared with surface or solid models.
Wire frame modeling can be considered as extension of
computer aided drafting.
Wire frame models provide accurate information about the
location of surface discontinuity on the part.
It can be used as a basis for automatic generation of cutter paths
to drive NC machine tool to manufacture component.

Disadvantages

1. There is always some ambiguity in visualizing the 3D model.


Fig Shows Interpretation of 3D wireframe model
The wire frame model shown in fig (a) may be interpreted as a model
shown in fig (b) or (c) i.e. 3D wire frame model can be interpreted
in more number of ways.

Disadvantages
2. Without hidden line removal object become clumsy and difficult to
understand the object.
3. Calculation of section properties and mass properties are impossible.
4. It has limited use in manufacturing and analysis.
5. Presentation of circular holes and curved surfaces are poor.
6. Interference checking will be difficult.

SURFACE MODELING

The ambiguities of wire frame modeling are overcome with surface


models.
The surface modeling takes the modeling of an object one step beyond
wire frame model by providing information on surfaces connecting the
object edges. i.e., A surface model can be built by defining the surface on
the wire frame. This is analogous to stretching a thin sheet of material over
a frame work.
The surfaces generated by the surface modeling are classified into
(a) Flat surface - most basic feature of surface model.
(b) Sculptured surfaces - based on flat face mostly used in FE
analysis.
(c) Sculptured surfaces based on patches.
(d) Analytical surfaces (very rarely used).

(e) Combination of the above types.


Simple and basic form of surface is flat surface.
The most general and complex surface representations are
generally known as sculptured surface.
Sculptured surface means the surface produced from
combining two families of curves that intersects one
another in a cross-cross manner, creating network of inter
connected patches.

Sculptured surface

Common entities used in a surface modeling software s are

Plane surface.
Ruled (lofted) surface.
Surface of revolution.
Tabulated surface.
Bezier surface
B-spline surface
coons patch
Fillet surface.
Offset surface.

SURFACE MODELING

Plane surface:

This is the simplest surface. It


requires 3 non-coincident points
on an infinite plane.

Ruled (lofted) surface:

This is a linear surface. It


interpolates linearly between two
boundary curves as shown in
fig.

SURFACE MODELING

Surface of revolution:

This is an axis symmetric surface that


can model axisymmetric objects. It is
generated by rotating a planer curve in a
space about the axis of symmetry for
certain angle of rotation.

Tabulated surface:

This is a surface generated by


translating a planner curve along a
specified direction as shown in fig

SURFACE MODELING
Offset surface:

Existing surfaces can be offset to create


new ones identical in shape but have
different dimension.
The new surface will be created at a
faster rate. For example, to create a
holding cylinder, first inner or outer
cylinder can be created using a
cylinder command.
Based on this surface, other cylindrical
surface can be created by using offset
command is shown in fig

B-spline surface:

The B-spline surface is generated


from the basis of B-spline curve.
The simple form of the B spline is
shown in fig

SOLID MODELING

Solid modeling is the most powerful 3D modeling technique.

There are more number of methods available to generate solid models.

Out of which two basic approaches are important from our subject point of
view.

They are
(1) Constructive solid geometry (CSG).
(2) Boundary representation (B-rep.)

Constructive solid geometry

Fig 3.17 Types of Boolean operation

A solid modeler has a library of set of basic element shapes known as


primitives like, cuboid, cylinder, sphere, cone, wedge, torus etc as shown
in fig 3.16).
Fig 3.17 Types of Boolean operation
In this approach, the physical objects are modeled by combining these
primitives by a set of Boolean operations.
The type of Boolean operations is used in CSG are Union (U),
difference
and intersection (n).
These Boolean operations are explained in fig 3.17.

Here, directed graph (Binary tree) scheme is used to store the model
in the data structure. The general form of the tree-type data structure
used in CSG approach is shown in fig 3.18.
Fig 3.18 General tree type data structure
Any node may have one parent node and two-child node. The root
node (R) has no parent and leaf node (L) has no children.

For example to create a model as shown in fig 3.19, four primitives


two rectangular blocks and two cylinders are required.
To create the final object following Boolean operation has to be carried out.

Advantages:
1. Since, the data to be stored are less, memory required will be less.
2. Create fully valid geometrical solid model.
3. Complex shapes may be developed relatively quicker with the
available set of primitives.
4. Less skill is enough.
Disadvantages:
1. More computational effort and time are required whenever the
model is to be displayed in the screen.
2. Getting fillet, chamfer and taperness in the model is very
difficult.

Boundary representation (B - rep.)

Fig shows Illustration of B-rep data structure of tetrahedron

This approach is widely used in most of solid modelers. The solid model
created by using B- rep technique may be stored in graph based on data
structure system. This is illustrated with an simple example of tetrahedron
shown in fig

The tetrahedron is composed of four vertices namely A, B, C and D.


The co-ordinate of these vertices is stored in the database.
The fig. (b) shows how the vertices are connected to form edges (a, b, c, d, e
and f) and how these edges are connected together to form the face (ABC,
BCD,ACD, ABD) which makes the complete solid of tetrahedron. These
connectivities to
form the solid are popularly known as topology.
In B-rep modeler, in addition to store the topology of solid, topological
consistency of the models is also carried out in order to create geometrically
valid solid models.
For topological consistency, certain rules have to be followed.
They are
(a) Faces should be bound by a simple loop of edges and should be not
intersected by itself
(b) Each edge should exactly adjoin two faces and each edge should have a
vertex at each end.
(c) At least three edges should meet at each vertex.

Elements of topology

For bodies without holes should satisfy Euler s rule.

Even if the topological consistency is achieved, in some cases like solids


having concave faces will not give geometrically valid solid.
The B-rep scheme is more widely used because
In CSG the number of basic primitives available are limited.
The performance of B-rep scheme is very much superior to that of CSG
scheme for complex engineering models.
Conversion of CSG to B-rep is possible, but conversion from B-rep to
CSG is not possible.
Combining the wire frame and surface model is possible only through
B-rep solid representation.

Advantages:
1. Computational effort and time required to display the model are
less compared with CSG.
2. Combining wire frame and surface model are possible.
3. Complex engineering objects can be modeled very easily compared
with CSG.
4. Since the topology and geometry are treated separately,
incorporating new geometries in the existing model is easy.
5. It is particularly suitable for modeling part having internal
symmetry.
Disadvantages:
1. The data to be stored is more and hence it requires more memory.
2. Some times geometrically valid solids are not possible.

You might also like