Vous êtes sur la page 1sur 25

UNIT I

FUNDAMENTALS OF COMPUTER GRAPHICS

INTRODUCTION OF CAD

In the mid of 1970s, as computer aided design starts to offer more potential

than just a skill to replicate manual drafting with electronic drafting, the cost gain for

companies to switch to CAD became obvious. The benefit of CAD methods over

manual drafting are the capabilities one often takes for established from computer

systems; automated creation of Bill of Material, interference checking, auto layout in

integrated circuits.

Finally CAD offers the designer with the skill to carry out engineering

calculations. During this change, calculations were still done either by manual or by

those individuals that could run computer programs. CAD was an innovative change in

the engineering industry, where draftsman and designer roles begin to combine. CAD

did not eliminate department, as much as it joined departments and make powerful

designer.

Today computer-aided design software packages range from 2D vector-


based drafting to
3D surface and solid models. Present CAD packages can also normally allow rotations

in 3D, allowing screening of a designed object from any preferred angle, even from the

inside looking out. Some CAD software is able of dynamic modeling.

CAD is mainly developed for meticulous engineering of 2D drawings and/or 3D

models of physical parts, but it is also used during the engineering development from

theoretical design and layout of products, through dynamic and strength analysis of

assemblies to definition of manufacturing process of parts. Still many CAD applications

provide advanced rendering and animation abilities so engineers can good visualize

their product designs.

CAD has become an important knowledge within the scope of computer-aided

technologies, with advantages such as lower product development costs and a greatly

reduced design cycle. CAD enables engineers to layout and develops work on monitor,

plot it out and save it for future editing.


PRODUCT CYCLE

Product cycle integrate processes, people, data, and business and gives a
product information for industries and their extended activity. Product cycle is the

process of managing the entire lifecycle of a product from starting, through design

and manufacture, to repair and removal of manufactured products.

Product cycle methods assist association in managing with the rising difficulty

and engineering challenges of developing new products for the worldwide competitive

markets.

Product lifecycle management (PLM) can be part of one of the following four

fundamentals of a manufacturing information technology structure.

(i)Customer Relationship Management (CRM)


(ii)Supply Chain Management (SCM)

(iii)Enterprise resource planning (ERP)


(iv)Product Planning and Development (PPD).
The core of PLM is in the formation and management of all product

information and the technology used to access this data and knowledge. PLM as a

discipline appeared from tools such as CAD, CAM and PDM, but can be viewed as the

combination of these tools with processes, methods and people through all stages of a

product’s life cycle. PLM is not just about software technology but is also a business

approach.

PRODUCT CYCLE MODEL


There are several Product cycle models in industry to be considered, one of the

possible product cycle is given below (Fig.1.1.):


Product Cycle Model
STEP 1: CONCEIVE
Imagine, Specify, Plan, Innovate
The first step is the definition of the product requirements based on company,

market and customer. From this requirement, the product's technical data can be

defined. In parallel, the early concept design work is performed defining the product
with its main functional features. Various media are utilized for these processes, from

paper and pencil to clay mock-up to 3D Computer Aided Industrial


Design.

STEP 2: DESIGN
Describe, Define, Develop, Test, Analyze and Validate
This is where the completed design and development of the product begins,

succeeding to prototype testing, through pilot release to final product. It can also

involve redesign and ramp for improvement to existing products as well as planned

obsolescence. The main tool used for design and development is CAD. This can be

simple 2D drawing / drafting or 3D parametric feature based solid/surface

modeling.

This step covers many engineering disciplines including: electronic, electrical,

mechanical, and civil. Besides the actual making of geometry there is the analysis of the
components and assemblies Optimization, Validation and Simulation activities are

carried out using Computer Aided Engineering (CAE) software. These are used to

perform various tasks such as: Computational Fluid Dynamics (CFD); Finite Element

Analysis (FEA); and Mechanical Event Simulation (MES). Computer Aided Quality

(CAQ) is used for activities such as Dimensional tolerance analysis. One more task
carried out at this step is the sourcing of bought out components with the aid of

procurement process.

STEP 3: REALIZE
Manufacture, Make, Build, Procure, Produce, Sell and Deliver
Once the design of the components is complete the method of manufacturing is

finalized. This includes CAD operations such as generation of CNC Machining

instructions for the product’s component as well as tools to manufacture those

components, using integrated Computer Aided Manufacturing (CAM) software.

It includes Production Planning tools for carrying out plant and factory layout

and production simulation. Once details components are manufactured their

geometrical form and dimensions can be verified against the original data with the

use of Computer Aided Inspection Equipment (CAIE). Parallel to the engineering

tasks, sales and marketing work take place. This could consist of transferring
engineering data to a web based sales configuration.

STEP 4:SERVICE
Use, Operate, Maintain, Support, Sustain, Phase-out, Retire, Recycle
and Disposal
The final step of the lifecycle includes managing of information related to service
for repair and maintenance, as well as recycling and waste management information.
This involves using tools like Maintenance, Repair and Operations Management
software.

DESIGN PROCESS
The design process includes series of steps that engineers apply in making

functional products and processes. The parts of the process often need to be repeated

many times before production of a product can start. The parts that get iterated and

the number of such design cycles in any given project can be highly changeable.
One method of the engineering design process focuses on the following common
aspects:

Fig.1.2. Design Process

RESEARCH
A considerable amount of time is used on research, or finding information.
Consideration should be given to the available applicable literature, issues and
successes linked with avaialbe
solutions, and need of marketplaces.

The basis of information should be significant, including existing

results. Reverse engineering can be a successful technique if other solutions are

available in the market. Added sources of information include the trade journals,

available government documents, local libraries, vendor


catalogs and personal organizations.

FEASIBILITY ASSESSMENT
The feasibility study is an analysis and assessment of the possible of a proposed

design which is based on detail investigation and research to maintain the process of

decision creation. The feasibility assessment helps to focus the scope of the project to

spot the best situation. The purpose of a feasibility assessment is to verify whether the

project can continue into the design phase.


CONCEPTUALIZATION

A Concept Study is the stage of project planning that includes developing ideas

and taking into account the all features of executing those ideas. This stage of a project

is done to reduce the likelihood of assess risks, error and evaluate the potential success

of the planned project.

ESTABLISHING THE DESIGN REQUIREMENTS


Establishing design requirements is one of the most essential elements in
the design practice, and this task is usually performed at the same time as the
feasibility analysis. The design requirements control the design of the project all over
the engineering design process. A few design requirements comprise maintainability,
hardware and software parameters, availability, and testability.

PRELIMINARY DESIGN
The preliminary design fills the gap between the design concept and the detailed

design phase. During this task, the system configuration is defined, and schematics,

diagrams, and layouts of the project will offer early project configuration. In detailed

design and optimization, the parameters of the part being produced will change, but the

preliminary design focuses on creating the common framework


to construct the project.

DETAILED DESIGN
The next phase of preliminary design is the Detailed Design which may

includes of procurement also. This phase builds on the already developed preliminary

design, aiming to further develop each phase of the project by total description
through drawings, modeling as well as specifications.

The advancement CAD programs have made the detailed design phase more

competent. This is because a CAD program can offer optimization, where it can shrink

volume without compromising the part's quality. It can also calculate displacement and

stress using the FEM to find stresses throughout the part. It is the responsibility of

designer to find whether these stresses and displacements are acceptable, so the part is

safe.
PRODUCTION PLANNING AND TOOL DESIGN
The production planning and tool design is more than planning how to mass-

produce the project and which tools should be used in the manufacturing of the

component. Tasks to complete in this stage include material selection, identification of

the production processes, finalization of the sequence of operations, and selection of

jigs, fixtures, and tooling. This stage also includes testing a working prototype to

confirm the created part meets qualification standards. With the finishing of

qualification testing and prototype testing, the design process is completed.

SEQUENTIAL AND CONCURRENT ENGINEERING

Sequential Vs Concurrent Engineering


SEQUENTIAL ENGINEERING

The traditional product development process at the prototype development


stage is sequential. It includes product design, development of manufacturing process and
supporting quality and testing activities, all carried out one after another. This situation
assumes that there is no interaction among the major departments involved in product
manufacturing during the initial development process.

CONCURRENT ENGINEERING
Concurrent engineering or Simultaneous Engineering is a methodology of
restructuring the product development activity in a manufacturing organization using a
cross functional team approach and is a technique adopted to improve the efficiency of
product design and reduce the product development cycle time. This is also sometimes
referred to as Parallel Engineering.
SEQUENTIAL VS CONCURRENT ENGINEERING
S.NO Sequential Engineering Concurrent Engineering

1 Sequential engineering is the term used to In concurrent engineering, various


explain the method of production in a tasks are handled at the same time,
linear system. The various steps are done and not essentially in the standard
one after another, with all attention and order. This means that info found out
resources focused on that single task. later in the course can be added to
earlier parts, improving them, and also
saving time.

2 Sequential engineering is a system by Concurrent engineering is a method by


which a group within an organization which several groups within an
works sequentially to create new products organization work simultaneously to
and services. create new products and
services.

3 The sequential engineering is a linear The concurrent engineering is a non-


product design process during which all linear product design process during
stages of manufacturing operate in serial. which all stages of manufacturing
operate at the same time.

4. Both process and product design run in Both product and process design
serial and take place in the different time. run in
parallel and take place in the same
time.

5 Process and Product are not matched to Process and Product are
attain optimal matching. coordinated to attain optimal
matching of requirements for
effective quality and delivery.

6 Decision making done by only group of Decision making involves full team
experts. involvement.

COMPUTER AIDED DESIGN


CAD is the intersection of Computer Graphics, Geometric modeling and Design

tools (below fig.). The concepts of computer graphics and geometric modeling and must

be used innovatively to serve the design process.

CAD is the function of computer systems to support in the creation,

modification, analysis, or optimization of a design. CAD software is used to raise the

productivity of the designer, progress the quality of design, progress communications


through documentation, and to generate a database for manufacturing.

CAD
CAD software for design uses either vector-based graphics to explain the objects

of traditional drafting, or may also develop raster graphics showing the overall look of

designed objects. During the manual drafting of engineering drawings, the output of CAD

must convey information, like dimensions, materials, processes, and tolerances.

CAD is a significant industrial art used in many purposes, including industrial and
architectural design, shipbuilding, automotive, and aerospace industries, and many

more. CAD is also extensively used to create computer animation for special effects

in movies, and technical manuals, frequently called as Digital Content Creation.

CAD software packages provide the designer with a multi window environment

with animation which is regularly used in Digital Content Creation. The animations

using wire frame modeling helps the designer to see into the interior of object and to
observe the behaviors of the inner components of the
assembly during the motion.

CAD TECHNOLOGY
Initially software for CAD systems was developed with computer

languages such as FORTRAN but with the development of object-oriented

programming methods this has completely changed. Classic modern parametric

attribute based modeler and freeform surface systems are developing around a

number of key ‘C’ modules.


A CAD system can be seen as develop from the interaction of a Graphical

User Interface (GUI) with NURBS geometry and Boundary representation data

through a kernel for geometric modeling. A geometry constraint engine may also
be employed to organize the associative relationships between components in an

assembly.

Unexpected facilities of these relationships have led to a new form of

prototyping called digital prototyping. In difference to physical prototypes, which

involve manufacturing time in the design. CAD models can be created by a

computer after the physical prototype has been scanned using an CT scanning

device. Based on the nature of the business, digital or physical prototypes can be

primarily selected according to specific requirements.

Currently, no special hardware is required for CAD software. However,

some special CAD systems can do graphically and computationally intensive

tasks, so a higher end graphics card, high speed CPUs may be suggested. CAD

systems exist for all the major platforms and some packages even perform multiple

platforms.

The human-machine interface is generally through a mouse but can

also be using a digitizing graphics tablet. Handling of the view of the part on the

screen is also sometimes done with the help of a Space mouse or Space Ball.

Special CAD systems also support stereoscopic glasses


for viewing the 3D objects.

CAD TOOLS
The CAD tools are mainly using for graphics applications and modeling.

Aids such a color, grids, geometric modifiers and group facilitate structural

geometric models. Visualization is achieved through shaded components and

animation which focus design conceptualization, communication and interference

detection. FEM packages provide optimization in shape and structure. Adding

tolerances, tolerance analysis and investigating the effect of manufacturing on the

design can perform by utilizing CAD tools (Table 1.2).


CAD TOOLS VS DESIGN PROCESS

S.NO CAD TOOLS DESIGN PROCESS

1 Geometric modeling, Graphics aids, Conceptualization


visualization and manipulation

2 Geometric modeling, Graphics aids, Modeling and Simulation


visualization and manipulation, animation,
assemblies

3 Analysis packages, customized programs Design Analysis

4. Structural optimization Design Optimization

5 Dimensioning, tolerance, bill of materials Design evaluation

6 Drafting and detailing, Shaded images Communication and Documentation

USES OF CAD
CAD is one of the tools used by designers and engineers and is used

in different ways depending on the profession of the customer and the type of

software.

CAD is one of the Digital Product Development activities within the


Product Lifecycle
Management practices with other tools, which are either integrated modules or
individual, such as:
 Computer Aided engineering (CAE) and Finite Element Analysis (FEA)

 Computer Aided Manufacturing (CAM)

 Realistic Rendering and Simulation.

 Product Data Management (PDM).

CAD is also used for the development of photo simulations that are

frequently necessary in the preparation of Environmental Impact Reports, in which

proposed CAD buildings are superimposed into photographs of existing situation to

represent what that conditions will be like, where the proposed services are

allowed to be built.

Parameters and constraints can be used to get the size, shape, and other
properties of the modeling elements. The features of the CAD system can be used

for the several tools for measurement such as yield strength, tensile strength and
electrical or electro-magnetic properties.

CAD SYSTEM ARCHITECTURE

Computer architecture is a pattern describing how a group of software and

hardware technology standards relate to form a computer system. In general,

computer architecture refers to how a computer is designed and what technologies

it is compatible with. Computer architecture is likened to the art of shaping the

needs of the technology, and developing a logical design and standards based on

needs.

In CAD, Computer architecture is a set of disciplines that explains the

functionality, the organization and the introduction of computer systems; that is, it
describes the capabilities of a computer and its programming method in a

summary way,and how the internal organization of the system is designed and

executed to meet the specified facilities. Computer architecture engages different

aspects, including instruction set architecture design, logic design, and

implementation. The implementation includes Integrated Circuit Design, Power, and

Cooling. Optimization of the design needs expertise with Compilers, Operating

Systems and Packaging.

COORDINATE SYSTEMS

AutoCAD provides different ways to specify coordinate points in your drawing. The
following features are covered in this section:

- Absolute coordinate entry


- Relative coordinate entry
- Polar coordinate entry
- Direct distance entry
- Tracking
ABSOLUTE COORDINATES
In the absolute coordinate system all points are measured from the origin
(0, 0). They are suited to situations where you know the exact X and Y
location of the point you want to place.
To enter an absolute coordinate use the format X, Y where:
- X is the distance and direction along the horizontal axis from the
origin (0, 0).
- Y is the distance and direction along the vertical axis from the
origin (0, 0).
RELATIVE COORDINATES
Relative coordinate entries are based on the last point entered. Use a
relative coordinate when you know the location of a point in relation to
the previous point. To specify a relative coordinate, precede the
coordinate with the 'at' @ sign using the format @X, Y:
- @ indicates a relative distance
- X is the positive or negative distance along the X axis from the previous position.
- Y is the positive or negative distance along the Y axis from the
previous position

POLAR COORDINATES

A combination of angle and distance input is called polar coordinate. You


use polar coordinate when you know the angle and the distance from one
point to another.
In AutoCAD angles are positive (+) when measured counter-clockwise and
negative (-) when measured clockwise.

90º

135º 45º

(+)
180º 0º

225º 315º (-)


270º

POLAR TRACKING

When you are drawing and editing objects, you can use polar tracking to

display temporary alignment defined by the polar angles you specified.

Setting the polar tracking:

1- Click Drafting Setting from the Tools menu command


2- In the drafting Setting dialog box, select Polar Tracking Tab then

select Polar Tracking ON.

3- From the angle Increment Angle list, select the polar tracking

angle.

4- Under Polar Angle Measurement, specify whether polar tracking

are absolute or relative to previous segment.

5- Click OK.

DIRECT DISTANCE ENTRY

Direct distance entry is useful when used with Ortho or Polar Tracking

option. It allows you to specify a point relative to the previous one you

entered.

Procedure:

- Move the crosshairs in the direction you want.

- Enter a numeric distance.

Use of the line command: A line can be a single segment or a multi-

segment connected together. A series of lines can be open, or they can be

closed.

TWO-DIMENSIONAL TRANSFORMATION

INTRODUCTION

As stated earlier, Computer Aided Design consists of three components, namely, Design

(Geometric Modeling), Analysis (FEA, etc), and Visualization (Computer Graphics).

Geometric Modeling provides a mathematical description of a geometric object - point, line,

conic section, surface, or a solid. Visualization deals with creation of visual effects, e.g.,

creation of pie charts, contour plots, shading, animation, etc. Computer graphics provides

visual displays and manipulations of objects, e.g., transformation, editing, printing, etc.

Fortran and visual C languages are used to effect these operations.

Transformation is the backbone of computer graphics, enabling us to manipulate the shape,

size, and location of the object. It can be used to effect the following changes in a geometric

object:
 Change the location

 Change the Shape

 Change the size

 Rotate

 Copy

 Generate a surface from a line

 Generate a solid from a surface

 Animate the object

TWO-DIMENSIONAL TRANSFORMATION

Geometric transformations have numerous applications in geometric modeling,

e.g., manipulation of size, shape, and location of an object. In CAD, transformation is also

used to generate surfaces and solids by sweeping curves and surfaces, respectively. The

term ‘sweephnf’ reeers to parametrhc transeormathons, wghcg are uthlhzed to fenerate

surfaces and solids. When we sweep a curve, it is transformed through several positions

along or around an axis, generating a surface. The appearance of the generated surface

depends on the number of instances of the transformation. A parameter t or s is varied

from 0 to 1, with the interval value equal to the fraction of the parameter. For example, to

generate 10 instances, the parameter will have a value t/10 or s/10. To develop an easier

understanding of transformations, we will first study the two-dimensional transformations

and then extend it to the study of three-dimensional transformations. Until we get to the

discussion of surfaces and solids, we will limit our discussion of transformation to only the

simple cases of scaling, translation, rotation, and the combinations of these.

Applications of transformations will become apparent when we discuss the surface

and solid modeling.

There are two types of transformations:

MODELING TRANSFORMATION: this transformation alters the coordinate values of the

object. Basic operations are scaling, translation, rotation and, combination of one or more

of these basic transformations. Examples of these transformations can be easily found in

any commercial CAD software. For instance, AutoCAD uses SCALE, MOVE, and ROTATE
commands for scaling, translation, and rotation transformations, respectively.

VISUAL TRANSFORMATION: In this transformation there is no change in either the

geometry or the coordinates of the object. A copy of the object is placed at the desired sight,

without changing the coordinate values of the object. In AutoCAD, the ZOOM and PAN

commands are good examples of visual transformation.

BASIC MODELING TRANSFORMATIONS

There are three basic modeling transformations: Scaling, Translation, and Rotation. Other

transformations, which are modification or combination of any of the basic transformations,

are Shearing, Mirroring, copy, etc.

Let us look at the procedure for carrying out basic transformations, which are based on

matrix operation. A transformation can be expressed as

[P*] = [P] [T]

where, [P*] is the new coordinates matrix

[P] is the original coordinates matrix, or points matrix [T] is the transformation matrix

With the z-terms set to zero, the P matrix can be written as,

x1 y1 0
x2 y2 0
[P] = x3 y3 0

xn yn 0

The size of this matrix depends on the geometry of the object, e.g., a point is defined by a

single set of coordinates (x1, y1, z1), a line is defined by two sets of coordinates (x1, y1, z1 )

and (x2, y2, z2), etc. Thus a point matrix will have the size 1x3, line will be 2x3, etc.

A transformation matrix is always written as a 4x4 matrix, with a basic shape shown below,
1 0 0 0
[T] = 0 1 0 0
0 0 1 0
0 0 0 1

Values of the elements in the matrix will change according to the type of transformation

being used, as we will see shortly. The transformation matrix changes the size, position, and

orientation of an object, by mathematically adding, or multiplying its coordinate values. We

will now discuss the mathematical procedure for scaling, translation, and rotation

transformations.

SCALING

In scaling transformation, the original coordinates of an object are multiplied by the given

scale factor. There are two types of scaling transformations: uniform and non-uniform. In

the uniform scaling, the coordinate values change uniformly along the x, y, and z

coordinates, where as, in non-uniform scaling, the change is not necessarily the same in all

the coordinate directions.

UNIFORM SCALING

For uniform scaling, the scaling transformation matrix is given as

s 0 0 0
0 s 0 0
[T] = 0 0 s 0
0 0 0 1

Here, s is the scale factor.

NON-UNIFORM SCALING

Matrix equation of a non-uniform scaling has the form:

where, sx, sy, sz are the scale factors for the x, y, and z coordinates of the object.

sx 0 0 0
0 sy 0 0
[T] = 0 0 sz 0
0 0 0 1
TRANSLATION TRANSFORMATION
In translation, every point on an object translates exactly the same distance. The
effect of a translation transformation is that the original coordinate values increase or
decrease by the amount of the translation along the x, y, and z-axes. For example, if line
A(2,4), B(5,6) is translated 2 units along the positive x axis and 3 units along the positive
y axis, then the new coordinates of the line would be

A’(2+2, 4+3), B’(5+2, 6+3) or

A’(4,7), B’(7,9).

The transformation matrix has the form:

1 0 0 0
0 1 0 0
[Tt] = 0 0 1 0
x y 0 1

where, x and y are the values of translation in the x and y direction, respectively. For
translation transformation, the matrix equation is

[P*] = [P] [Tt]

where, [Tt] is the translation transformation matrix.

Example : Translate the rectangle (2,2), (2,8), (10,8), (10,2) 2 units along x-axis and 3
units along y-axis.

Solution: Using the matrix equation for translation,

we have [P*] = [P] [Tt], substituting the numbers, we get

2 2 0 1 1 0 0 0 4 5 0 1
[P*] = 2 8 0 1 0 1 0 0 4 11 0 1
= 12 11 0 1
10 8 0 1 0 0 1 0
10 2 0 1 2 3 0 1 12 5 0 1
ROTATION

We will first consider rotation about the z-axis, which passes through the origin
(0,0,0), since it is the simplest transformation for understanding the rotation
transformation. Rotation about an arbitrary axis, other than an axis passing through the
origin, requires a combination of three or more transformations, as we will see later.
When an object is rotated about the z-axis, all the points on the object rotate in a circular
arc, and the center of the arc lies at the origin. Similarly, rotation of an object about an
arbitrary axis has the same relationship with the axis, i.e., all the points on the object
rotate in a circular arc, and the center of rotation lies at the given point through which
the axis is passing.

In matrix form we can write these equations as

cos sin
[x* y*] = [ x y] - sin cos

MIRRORING

In modeling operations, one frequently used operation is mirroring an object.


Mirroring is a convenient method used for copying an object while preserving its
features. The mirror transformation is a special case of a negative scaling, as will be
explained below.

Let us say, we want to mirror the point A(2,2) about the x-axis(i.e., xz-plane), as
shown in the figure.

The new location of the point, when reflected about the x-axis, will be at (2, -2).
The point matrix [P*] = [2 -2] can be obtained with the matrix transformation given
below.
THREE DIMENSIONAL TRANSFORMATION

INTRODUCTION

A three-dimensional object has a three-dimensional geometry, and therefore, it requires a


three-dimensional coordinate transformation. A right-handed coordinate system is used to
carry out a 3-D transformation.

The scaling and translation transformations are essentially the same as two- dimensional
transformations. However, the points matrix will have a non-zero 3rd column. Additionally,
the transformation matrices contain some non-zero values in the third row and third
column, as shown below.

A general scaling transformation matrix is given as:

sx 0 0 0
0 sy 0 0
[Ts] = 0 0 sz 0
0 0 0 1

Translation Transformation matrix: 1 0 0 0


0 1 0 0
[Tt] = 0 0 1 0 (3.2)
x y z 1
ROTATION TRANSFORMATION

The two-dimensional rotation transformation is in reality a special case of a three-


dimensional rotation about the z-axis. We will denote it by [Trz], where, the second
subscript z indicates rotation about the z-axis. Similarly, rotation about the x and y-axes are
denoted as [Trx], and [Try], respectively. The transformation matrices are given below.

cos sin 0 0
-sin cos 0 0
[Trz] = 0 0 1 0
0 0 0 1
HOMOGENEOUS COORDINATES

Before proceeding further, we should review the concept of homogeneous coordinate


system. Since the points matrix has three columns for the x, y, and z values, and a
transformation matrix is always 4x4 matrix, the two matrices are incompatible for
multiplication. A matrix multiplication is compatible only if the number of columns in the
first matrix equals the number of row in the second matrix. For this reason, a points matrix
is written as,

x1 y1 z1 1
x2 y2 z2 1
[P] = x3 y3 z3 1

xn yn zn 1

Here, we have converted the Cartesian coordinates into homogeneous coordinates by


adding a 4th column, with unit value in all rows. When a fourth column, with values of 1 in
each row, is added in the points matrix, the matrix multiplication between the [P] and [T ]
becomes compatible. The values (x1, y1, z1, 1) represent the coordinates of the point
(x1, y1, z1), and the coordinates are called as homogeneous coordinates. In homogeneous
coordinates, the points (2,3,1), (4,6,2), (6,9,3), (8,12,4), represent the same point (2,3,1),
along the plane z = 1, z = 2, z = 3, and z = 4, respectively. In our subsequent discussion on
transformation, we will use homogeneous coordinates.

Example: If the triangle A(1,1), B(2,1), C(1,3) is scaled by a factor 2, find the new
coordinates of the triangle.

Solution: Writing the points matrix in homogeneous coordinates, we have

1 1 0 1
[P] = 2 1 0 1
1 3 0 1

and the scaling transformation matrix is, 2 0 0 0


0 2 0 0
[Ts] = 0 0 2 0
0 0 0 1

The new points matrix can be evaluated by the equation


[P*] = [P] [T], and

by substitution of the P and T


1 1 0 1 2 0 0 0 2 2 0 1 values, we get
P* = 2 1 0 1 0 2 0 0 = 4 2 0 1
1 3 0 1 0 0 2 0 2 6 0 1
0 0 0 1

Transformed by scaling
y
Original

Note that the new coordinates represent the original value times the scale factor. The old
and the new positions of the triangle are shown in the figure.

LINE DRAWING

Straight line segments are used a great deal in computer generated pictures. The following

criteria have been stipulated for line drawing displays :

i. Lines should appear straight

ii. Lines should terminate accurately

iii. Lines should have constant density

iv. Line density should be independent of length and angle

v. Line should be drawn rapidly

The process of turning on the pixels for a line segment is called vector generation. If the

end points of the line segment are known, there are several schemes for selecting the pixels

between the end pixels. One method of generating a line segment is a symmetrical digital

differential analyzer (DDA).

DDA ALGORITHM

The digital differential analyzer generates lines from their differential equations. The DDA

works on the principle that X and Y are simultaneously incremented by small steps
proportional to the first derivatives of X and Y. In the case of a straight line the first

derivatives are constant and are proportional to DX and DY, where D is a small quantity.

In the real world of limited precision displays, addressable pixels only must be

generated. This can be done by rounding to the next integer after each incremental step.

After rounding, a pixel is displayed at the resultant X and Y locations. An alternative to

rounding is the use of arithmetic overflow. X and Y are kept in registers that have integer

and fractional parts. The incrementing values which are less than unity are repeatedly

added to the fractional part and whenever the result overflows the corresponding integer

part is incremented. The integer parts of X and Y are used to plot the line. This would

normally have the effect of truncating. The DDA is therefore initialized by adding 0.5 in

each of the fractional parts to achieve true rounding.

The symmetrical DDA generates reasonably accurate lines since a displayed


pixel is never away from a true line by half the pixel unit. A Pascal procedure for a simple
DDA is given below :

Procedure DDA (X1, Y1, X2, Y2 : integer) ;

length : var ;

i : integer;

X, Y, X-incr, Y-incr : real ;

begin

length : = abs (X2– X1) ;

if abs (Y2–Y1) < length then length: = abs (Y2–Y1);

X - incr : = (X2 – X1) /length ;

Y - incr : = (Y2 – Y1) /length ;

X : = X1 + 0.5 ; Y = Y1 + 0.5 ;

for i : = 1 to length do

begin

plot (trunc (X) ; trunc(Y) ;

X : = X + X - incr ;

Y : = Y + Y - incr ;
end;

end.

EXAMPLE

To draw a straight line from connecting two points (2, 7) and (15, 10)

X1 = 2, X2 = 15 abs(X2 – X1) = 13

Y1 = 7, Y2 = 10 abs(Y2 – Y1) = 3

Length = 13
X2–X1 13
X incr = =
Length 13

Y2–Y1 3
Y incr = =
Length 13
Initial values of X and Y are
X = 2.5 Y = 7.5
The X and Y are tabulated in Table 3.1 and Fig. 3.2 shows a
plot of the line.

10

9
8
7
6
5
4
3
2
1
0

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

It can be noted that lines drawn on a raster display may have a jagged or staircase

appearance unless the lines are vertical or horizontal. This is because the points that are

plotted must be pixel grid points and many of these may not lie on the actual line.

13 CLIPPING
Clipping is the process of determining the visible portions of a drawing lying within a
window. In clipping each graphic element of the display is examined to determine whether
or not it is completely inside the window, completely outside the window or crosses a
window boundary. Portions outside the boundary are not drawn. If the element of a
drawing crosses the boundary the point of inter-section is determined and only portions
which lie inside are drawn. Readers are advised to refer to books on computer graphics for
typical clipping algorithms like Cohen-Sutherland clipping algorithm. Figure shows an
example of clipping.
D R A W IN G

W IN D O W

Example of Clipping

VIEWING TRANSFORMATION

It may be sometimes desirable to display different portions or views of the drawing in

different regions of the screen. A portion of the screen where the contents of the window

are displayed is called a view port. Let the screen size be X = 0 to 200 and Y = 0 to 130. A

view port can be defined by the co-ordinates say X1 = 65, X2 = 130, Y1 = 50 and Y2 = 100.

If we use the same window , the definition of this view port will display the

image in the right hand top quarter of the screen choosing different view ports

multiple views can be placed on the screen. Figure shows four views of a component

displayed using view port commands.


View Port
2

View Port
3

Use of Multiple View Ports

Vous aimerez peut-être aussi