+ All Categories
Home > Engineering > Introduction to Computer Graphics

Introduction to Computer Graphics

Date post: 20-Jan-2017
Category:
Upload: yatin-singh
View: 40 times
Download: 0 times
Share this document with a friend
32
Introduction to CAD Application of computers in our daily life has become our way of life. The development of computers during 1947 has crossed a long way to our modern computers which are very simple and user friendly. They are used in all the fields. Though they were originally developed for performing numerical calculations, the computer graphics techniques lead the way to use them for design and drafting from 1960 onwards. The preparation of an engineering drawing with the aid of computer using soft wares is known as computer aided drafting or computer aided design and drafting and abbreviated as CAD. CAD is not a substitute for design or drawing concept. It is only a tool that can be used for making drawings. The underlying basic concepts as Orthographic projection, sectional view and Isometric views etc., remain the same regardless of the tool used for creating drawing. Benefits The CAD systems are user friendly. The work can be completed very quickly. This results in reduction of labour and time. The computers work very accurately, giving better quality drawing. The drawings can be stored and recollected when ever needed. The corrections and modifications can be done quickly and easily. Different design ideas can be tried having single basic drawing. Visual modelling of any object or component can be done. When the same component is needed in many places, the same drawing can be inserted in the required places, instead drawing it again. It helps to visualize how the final product will be by using colour graphics. Components of CAD In general, a Computer Aided Design (CAD) package has three components: a) Design, b) Analysis, and c) Visualization, as shown in the sketch. A brief description of these components follows. a) Design: Design refers to geometric modeling, i.e., 2-D and 3-D modeling, including, drafting, part creation, creation of drawings with various views of the part, assemblies of the parts, etc. b) Analysis: Analysis refers to finite element analysis, optimization, and other number crunching engineering analyses. In general, a geometric model is first created and then the model is analyzed for loads, stresses, moment of inertia, and volume, etc. c) Visualization: Visualization refers to computer graphics, which includes: rendering a model, creation of pie charts, contour plots, shading a model, sizing, animation, etc. Each of these three areas has been extensively developed in the last 30 years. Most commercial CAD packages (software) consist of only a single component: design or analysis or visualization. However, a few of the vendors have developed an integrated package that includes not only these three areas, but also includes the manufacturing software (CAM). Due to the large storage requirement, integrated packages use either an UNIX workstation or a mainframe platform, and not the popular PC platform.
Transcript
Page 1: Introduction to Computer Graphics

Introduction to CAD

Application of computers in our daily life has become our way of life. The development of computers during

1947 has crossed a long way to our modern computers which are very simple and user friendly. They are

used in all the fields. Though they were originally developed for performing numerical calculations, the

computer graphics techniques lead the way to use them for design and drafting from 1960 onwards. The

preparation of an engineering drawing with the aid of computer using soft wares is known as computer

aided drafting or computer aided design and drafting and abbreviated as CAD. CAD is not a substitute for

design or drawing concept. It is only a tool that can be used for making drawings. The underlying basic

concepts as Orthographic projection, sectional view and Isometric views etc., remain the same regardless of

the tool used for creating drawing.

Benefits

The CAD systems are user friendly. The work can be completed very quickly. This results in reduction of

labour and time.

The computers work very accurately, giving better quality drawing.

The drawings can be stored and recollected when ever needed.

The corrections and modifications can be done quickly and easily.

Different design ideas can be tried having single basic drawing.

Visual modelling of any object or component can be done.

When the same component is needed in many places, the same drawing can be inserted in the required

places, instead drawing it again.

It helps to visualize how the final product will be by using colour graphics.

Components of CAD

In general, a Computer Aided Design (CAD) package has three components: a) Design, b) Analysis, and c)

Visualization, as shown in the sketch. A brief description of these components follows.

a) Design: Design refers to geometric modeling, i.e., 2-D and 3-D modeling, including, drafting, part creation,

creation of drawings with various views of the part, assemblies of the parts, etc.

b) Analysis: Analysis refers to finite element analysis, optimization, and other number crunching engineering

analyses. In general, a geometric model is first created and then the model is analyzed for loads, stresses,

moment of inertia, and volume, etc.

c) Visualization: Visualization refers to computer graphics, which includes: rendering a model, creation of

pie charts, contour plots, shading a model, sizing, animation, etc.

Each of these three areas has been extensively developed in the last 30 years. Most commercial CAD packages

(software) consist of only a single component: design or analysis or visualization. However, a few of the

vendors have developed an integrated package that includes not only these three areas, but also includes the

manufacturing software (CAM). Due to the large storage requirement, integrated packages use either an UNIX

workstation or a mainframe platform, and not the popular PC platform.

Page 2: Introduction to Computer Graphics

Components of Computer Aided Design With the improvement in PC computing speed, it’s only a matter of time before we see an integrated package run on a PC. CAD has revolutionized the modern engineering practice; small and large companies use it alike,

spending several billion dollars for the initial purchase or lease alone.

Computer Aided Manufacturing (CAM)

CAM is the next stage of CAD. A part created in CAD can be downloaded and manufactured, without a human

hand touching the part. The process is called CAM, and involves CAD, Networking, and NC programming, as

shown below.

Components of Computer Aided Manufacturing

Concurrent Engineering

Concurrent Engineering is another powerful CAD concept that has evolved in the ’s. According to this concept, there is an instantaneous communication between the designer, analyst, and manufacturing.

Changes made at any of these work centers are immediately passed on to the others and the product is

modified without delay. Often, the customer, management, and the marketing people join in and become part

of the process. Concurrent engineering saves the valuable time and helps get the product out in the market

quicker. Products that use to take years from the date of its concept to the actual production now take only a

few weeks, and the final product is better and cost-effective.

Some large organizations have invested in Rapid Prototyping Process. In this process, the part is created by

a CAD package and downloaded into the rapid prototyping machine; the machine immediately manufactures

the part, using a plastic material. This is a good example of concurrent engineering, sometimes referred as

Art to Part concept.

Page 3: Introduction to Computer Graphics

CAD/CAM History

The concept of CAD and CAM is relatively new. The usage is linked with the development of computers. The

actual application of CAD/CAM in industry, academia and government is only approximately 30 years old.

Formal courses in CAD and Finite Element Analysis FEA were introduced in ’s. The major application thrust of CAD came in ’s, with the availability of PCs and workstations. )n its early stage of usage, very few engineering companies could afford the expense of mainframe computers; however, PCs and

workstations have evolved into affordable and adequate platform to support comprehensive CAD packages

that initially were designed to run on the mainframe platform. A brief history of the evolution of CAD/CAM,

according to the decade and the major CAD/CAM developments, is outlined below.

s • Development in )nteractive computer graphics research • Sketchpad system developed by )van Sutherland in • CAD term coined • First major commercial CAD/CAM software available: CADAM by Lockheed, in 1965 • Bell Telephone’s - Graphics 1 remote display system developed

s • Application of CAM in government, industry and academia • National organization formed • Beginning of usage of computer graphics • Turnkey system available for drafting • Wireframe and surface modeling software became available • Mass property calculation and FEA software became available • NC tape generating, verification, and integrated circuit software became available

s • CAD/CAM used for engineering research and development • New CAD/CAM theories and algorithms developed • )ntegration of CAD/CAM • Solid modeling software became available • Use of PCs and workstation began

s • Concept of concurrent engineering developed • )ncreased use of CAD/CAM on PCs and workstations • )mprovements in hardware and software

CAD systems have become more intelligent. Many potential customers are focusing less on geometry creation

and more on integration. The CAD software consists of the computer programs to implement computer

graphics on the system plus application program to facilitate the engineering functions of the user company.

Page 4: Introduction to Computer Graphics

The Process Design is characterized by an iterative procedure which consists of identifiable steps or phase

thus.

Recognition of Need: that a problem exists.

Definition of Problem: specification.

Synthesis: conceptualized the component.

Analysis and optimization.

Evaluation: measuring the design against specification

Presentation: documentation for example, drawing etc.

A CADD programs contains hundreds of functions that enable you to accomplish specific drawing tasks. A task

may involve drawing an object editing and existing drawing, displaying a view of the drawing, printing and

savings it, or controlling other operation of the computer. The CADD modules include:

Draw, edit, data output, system control, data storage and management and specific features

The software requirements for CADD depend on a matter of choice after careful study of the various options.

These are various software options available such as: Micro station, AutoCAD, Turbo-CAD, Archicad, Drafix

window Scad, Floor plan plus, 3D Home Architect, etc.

An Integrated CAD/CAM

CAD/CAM is a term which means Computer-Aided Design and Computer-Aided Manufacturing. It is the

technology that concerned with the use of digital computers to perform certain functions in design and

production process to improve productivity. This technology is moving in the direction of greater integration

of design and manufacturing, two activities which have traditionally been treated as distinct and separate

function in production form. Ultimately, CAD/CAM will provide the technology base for the computer-

integrated factory of the future. The scope of CAD/CAM in the operations of a manufacturing firm and the

product cycle is presented in Fig. except for engineering changes which typically follow the product in all of

the different activities in the product cycle.

Fig. Product Cycle (Design and Manufacturing)

System Components and Computer Hardware for CAD

The system requirements for installing CAD software comprises of common PC of minimum Pentium

configuration, Plotters, drafting pads and monitors of large display area. Large area facilitates easy viewing

and maximum details of large drawings. Drafting software is an application package that can be loaded in the

computer hardware and provide a platform to create high quality drawings. The first CAD soft ware was

Page 5: Introduction to Computer Graphics

developed by IBM in 1960s called DAC-1 for custom use by General Motors in car design. In 1882, a company

called Autodesk introduced the first CAD program for the PCs, called AutoCAD. With this CAD become

economically affordable. Then many packages become available like SolidWorks, ProEngineer, IDEAS etc.,

Digital Computer System

Computers are now in common use in both scientific and commercial fields. The digital computer is a major

and central component of CAD/CAM systems, so it is essential to be familiar with the technology of the digital

computer and the principle on which it works.

The modern digital computer is an electronic machine that can perform mathematical logical calculations and

data processing functions in accordance with a predetermined program of instructions. The computer system

consist of the hardware and software to perform the specialized design function required by the particular

user firm, the hardware typically includes the computer, one or more graphics display terminals, keyboard,

and other peripheral equipment.

The software consists of the computer programs and instructions to implement computer graphics on the

system plus application program to facilitate the engineering functions of the user company. Examples of

these application programs include stress-strain analysis of components, dynamic response of mechanism,

heat transfer calculations, and numerical control pant programming. There are three basic hardware

components of a general purpose digital computer as shown in figure:

Figure: Computer System.

1. Central Processing Unit (CPU): The central processing unit is often considered to consist of two

subsections that:

a. Control Unit: the control unit coordinates the operations of all the other components. It control the input

and output of information between the computer and the outside world through the input/output section,

synchronizes the transfer of signals between the various sections of the computer and commands the other

section in the performance of their function.

b. Arithmetic Logic Unit: the arithmetic logic unit carries out the arithmetic and logic manipulations of data.

It adds, subtracts, multiplies, divides and compares number according to programmed instructions.

Page 6: Introduction to Computer Graphics

2. Memory: The memory of the computer is the storage unit. The data stored in this section are arranged in

the form of words which can be transferred to the arithmetic logic unit or input/output section for

processing. In, general, the memory classified into main and auxiliary memory.

3. Input/Output Section: The input/output provides the means for the computer to communicate with the

external world. This communication is accomplished through peripheral equipment such as printers, monitors, keyboard, mouse…etc. Display

The display area is a monitor, the size of which is given by the distance across the corners. The displays can

be texts or graphics. The screen is divided in the horizontal and vertical directions in to a large number of

picture elements called pixels . The higher the pixels, the better will be the appearance of the picture. We

have colour monitors now a days.

Input Devices

The input devices are those devices used to feed the data or the requirement to the computer system. We

communicate with the system through the input devices. . Software drivers are required to enable the host

applications programs. i.e., the CAD/CAM software, to interpret the information received from input devices

as well as send information to output devices. There are many input devices. The input may be in the form of

text or graphics. The input in the form is given by the alphanumeric (character-oriented) keyboards. Graphics

devices, or locators, provide a position or location on the screen. These include light-pens, mice, digitizing

tablets and styluses, joysticks, trackballs, thumbwheels, touch screens, and touch-pads. Locating

devices typically operate by controlling the position of a cursor on the screen. Thus, they are also referred to

as Cursor-Control Devices. The joystick provides three-dimensional input. Another class of graphics

input devices, besides locating devices, is Digitizer Boards or Tablets, or simply Digitizers. Digitizers can be

divided into three kinds relative to the mode of operation of the cursor. They are Free-Cursor,

Constrained-Cursor, and Motor-Cursor Digitizers. In the first kind, the cursor is attached to the end of a

flexible chord, in the second it slides along a gantry that traverses the entire digitizing board area, and in

the third kind the cursor motion is accomplished by motors driven by an operator controlled joystick.

Image-input devices such as Video Frame Grabbers and Scanners comprise the third class of graphics-

input devices

1. Keyboards:

Conventional keyboards are text-only devices and form an essential and basic input device. They are typically

employed to create/edit programs or to perform word processing functions. These keyboards have been

modified to perform graphics tasks by adding special function keys or attaching graphics –input devices such

as mice to them. The Programmable Function Keyboard (PFK) is another type that typically has

pushbuttons that are programmed to eliminate extensive typing of commands or entering coordinate

information. The pushbuttons are controlled by the software and maybe assigned different functions at

different phases of the software. PFK maybe built as a separate unit, or button may just be integrated with a

conventional keyboard.

Page 7: Introduction to Computer Graphics

Fig.1. Keyboard Fig,2. Light pens Fig,3. Digitizing tablet

2. Light Pens:

The light pen is intrinsically a pointing or picking device that enables the user to select a displayed graphics

item on a screen by directly touching its surface in the vicinity of the item. The application program processes

the information generated from the touching to identify the selectable item to operate on. The light pen,

however, does not typically have hardware for tracking, positioning, or locating in comparison to digitizing

tablet and stylus. Instead, these functions are performed by utilizing the hardware capabilities of the graphics

display at hand. The light pen itself does not emit light but rather detects it from graphics items displayed on

the screen. Using the emitted light as an input, it sends an interrupt signal to the computer to determine

which item was seen by the pen.

3. Digitizing Tablet:

A digitizing tablet is considered to be a locating as well as a pointing device. It is a small, low-resolution

digitizing board often used in conjunction with a graphics display. The tablet is a flat surface over which a

stylus or a puck (a hand-hold cursor to differentiate it from a display screen cursor) can be moved by the

user. The close resemblance of the tablet and stylus to paper and pencil contributes to its popularity as an

input device in computer graphics. The stylus is shaped like a pen, and a puck is a little hand-held box. The puck contains a rectile and at least one pushbutton. The rectile’s engraved cross-hairs help locate a point for

digitizing. Pressing the pushbutton sends the coordinates at the cross-hairs to the computer. Additional

buttons may be available on the puck and may be programmed by the software for other functions than

digitizing locations such as selecting alphanumeric font sizes or electronic symbols. Sizes of digitizing tablets

range form 11 x 11 to 36 x 36 inches and perhaps larger.

4. Mouse Systems:

The mouse was invented in the late 1960s as a location device but has only recently become fairly popular

due to its convenient use with icons and pop-up and pull-down menus. Unlike the digitizing tablet, the mouse

measures its relative movement from its last position, rather than where it is in relation to some fixed

surface. There are two basic types of mice available: Mechanical and Optical. The mechanical mouse is a

box with two metal wheels or rollers on the bottom whose axes are orthogonal in order to record the mouse

motion in the x and y directions. The roll of the mouse on any flat surface causes the rotation of the wheel

which is encoded into digital values via potentiometers. These values may be stored, when a mouse

pushbutton is depressed, in the mouse registers accessible by the application program either immediately or

during the computer interrupts every refresh cycle. Using these values, the program can determine the

direction and magnitude of the mouse movement. Unlike the mechanical one, the optical mouse is used in

conjunction with a special surface (the mouse pad). Movements over this surface are measured by a Light

Beam Modulation and Optical Encoding Techniques. The light source is located at the bottom and the

Page 8: Introduction to Computer Graphics

mouse must be in contact with the surface for the screen cursor to follow its movements. Pushbuttons may be

mounted on top of the mouse and programmed to various functions.

Fig,4. Mouse system Fig,5. Joysticks, Trackballs

5. Joysticks, Trackballs, and Thumbwheels:

These are less popular locating devices than the tablet or the mouse. Their concept of operation is very

similar to that of the mechanical mouse. The joystick works by pushing its stick backward or forward or to

the left or to the right. The extreme positions of these directions correspond to the four corners of the screen.

A joystick may be equipped with a rotating knob on the top.

A trackball is similar in principle to a joystick but it allows more precise fingertip control. The ball rotates

freely within its mount. Both the joystick and the trackball have been used historically in radar and flight

control systems. Both are used to navigate the screen display cursor. The user of a trackball can learn

quickly how to adjust to any nonlinearity in its performance.

Two thumbwheels are usually required to control the screen cursor, one for its horizontal position and the

other for its vertical position. Each position is indicated on the screen by a cross-hair. Thumbwheels are

usually mounted on the keyboard.

Output Devices

Output devices form the other half of a CAD/CAM workstation, the first being the input devices. While

CAD/CAM applications require the conventional output devices such as alphanumeric (video) displays

(terminals) and hardcopy printers, they require output devices to display graphics to the user. Graphics

output devices can be divided into soft and hard devices. The former refer to the graphics displays or

terminals which only display information on a screen. Hard output devices refer to hardcopy printers and

plotters that can provide permanent copies of the displayed information.

1. Graphics Displays:

The graphics of a workstation is considered its most important component because the quality of the

displayed image influences the perception of generated designs on the CAD/CAM system. In addition to

viewing images, the graphics display enables the user to communicate with the displayed image by adding,

deleting, blanking, and moving graphics entities on the display screen. As a matter of fact, this communication

process is what gives interactive graphics its name to differentiate it form passive graphics, as in the case of a

home television set, that the user cannot change.

Page 9: Introduction to Computer Graphics

Fig.6.Cathode Ray Tube

Various display technologies are now available to the user to choose from. They are all based on the concept of converting the computer’s electrical signals, controlled by the corresponding digital information, into visible images at high speeds. Among the available technologies, the CRT (Cathode Ray Tube) is the most

dominating and has produced a wide range of extremely effective graphics displays. Other technologies

utilize laser, flat panel displays, or plasma panel displays. In the first, a laser beam, instead of an electron

beam, is used to trace an image in a film. In the second, a Liquid Crystal Display (LCD) and Light-Emitting

Diodes (LEDs) are used to generate images. The plasma display uses small neon bulbs arranged in a panel

which provides a medium resolution display. Thus far, none of these display technologies has been able to

displace the CRT as the dominant graphics display device.

By controlling the beam direction and intensity in a way related to the graphics information generated in the

computer, meaningful and desired graphics can be displayed on the screen. The deflection system of the CRT

controls the x and y, or the horizontal and vertical, positions of the beam which in turn are related to the

graphics information through the display controller, which typically sits between the computer and the CRT.

The controller receives the information from the computer and converts it into signals acceptable to the CRT.

Other names for the Display Controller are the Display Processor, the Display Logical Processor, or the

Display Processing Unit. The major tasks that the display processor performs are the voltage-level

convergence between the computer and the computer and the CRT, the compensation for the difference in

speed between the computer and the CRT (by acting as a buffer), and the generation of graphics and texts.

More often, display processors are furnished with additional hardware to implement standard graphics

software functions into hardware to improve the speed of response. Such functions include transformations

(scaling, rotation, and translation) and shading.

The graphics display can be divided into two types based on the scan technology used to control the electron

beam when generating graphics on the screen. These are Random and Raster scan. In random scan (also

referred to as Stroke Writing, Vector Writing, or Calligraphic Scan), graphics can be generated by drawing

vectors or line segments on the screen in a random order which is controlled by the user input and the

software. The word random indicates that the screen is not scanned in a particular order. On the other

hand, in the raster scan system, the screen is scanned from left to right, top to bottom, all the time to generate

graphics. This is similar to the home television scan system, thus suggesting the name Digital Scan . The

Page 10: Introduction to Computer Graphics

three existing CRT displays that are based on these techniques are the Refresh (Calligraphic) Display,

Direct View Storage Tube, and the Raster Display. The first two are vector displays based on the random

scan technique and the last is based on the raster scan technique.

Fig.7.CRT Screen Scan Technique

1.1 Refresh Display

In this system, the deflection system of the CRT is controlled and driven by the vector and character

generators and digital-to-analog converters. The refresh buffer stores the display file or program, which

contains points, lines, characters, and other attributes of the picture to be drawn these commands are

interpreted and processed by the display processor. The electron beam accordingly excites the phosphor,

which glows for a short period. To maintain a steady flicker-free image, the screen must be refreshed or

redrawn at least 30 to 60 times per second, that is, at a rate of 30 to 60 Hz.

Fig. 8. Refresh display

Page 11: Introduction to Computer Graphics

The display file is generated by the CAD/CAM software and is considered a data structure which must be

updated and constructed according to the needs of the application program, that is, the software. Changes

made to the display file by the software must be synchronized with the display refresh cycle to prevent the

display of an incomplete picture. If the software updates the file fast enough, then it is possible to use the

dynamic techniques such as animation to stimulate movements as well as developing responsive user

interfaces.

1.2 Direct View Storage Tube (DVST)

Refresh displays were very expensive and, at the end of the 1960s the DVST was introduced by Tektronix as

an alternative and inexpensive solution. It is believed that the emergence of the DVST in that time had a

significant impact on making CAD/CAM systems affordable for both users and programmers. The DVST

eliminates the refresh processors completely and, consequently, the refresh buffer used with the refresh

display. It also uses a special type of phosphor that has a long-lasting glowing effect. The phosphor is

embedded in a storage tube. In addition, the speed of the electron beam in the DVST is slower than in the

refresh display due to elimination of the refresh cycle. )n the DVST, the picture is stored as a charge in the phosphor mesh located behind the screen’s surface. But due to the lack of selective erasure, the DVST cannot provide colors, animation, and use of a light-pen as an

input device. Due to its main advantages of inexpensive price and high resolution, early turnkey CAD/CAM

systems used storage tubes for their displays.

Fig.9. Direct View Storage Tube

1.3 Raster Display

In raster displays, the display screen area is divided horizontally and vertically into a matrix of small

elements called picture elements or pixels or pixels, as shown in Fig. 10. A pixel is the smallest addressable

area on a screen. An N x M resolution defines a screen with N rows and M columns. Each row defines a scan

line. A rasterization process is needed in order to display either a shaded area or graphics entities. In this

Page 12: Introduction to Computer Graphics

process, the area or entities are converted into their Corresponding pixels whose intensity and color are

controlled by the image display system.

Fig.10.Pixel matrix of Raster Display

The creation of raster-format data from geometric information is known as Scan Conversion or

Rasterization. A rasterizer that forms the image-creation system is mainly a set of scan-conversion

algorithms. Due to the universal need for theses algorithms, the scan conversion or rasterization process is

now hardware implemented and is done locally in the workstation. As an example, there are standard algorithms such as the DDA digital differential analyzer and the Bresenham’s method which are used to draw a line by generating pixels to approximate the line. Similar algorithms exist to draw arcs, text, and

surfaces. This is why it is possible to create images with different colors and hollow areas on raster displays.

Fig.11.Colour Raster Display

The values of the pixels of a display screen that result from the scan-conversion process are stored in an area

or memory called frame buffer or bit map refresh buffer (bit map, for short).. Each pixel value determines its

Page 13: Introduction to Computer Graphics

brightness (gray level) or most often its color on the screen. There is a one-to-one correspondence between

every cell in the bit map memory and every pixel on the screen. The display processor maps every cell into its

corresponding screen pixel brightness or color. In order to maintain a flicker-free image on the screen, the

screen must be refreshed at the rate of 30 or 60 Hz, as in the case of refresh displays. The refresh process is

performed by passing the pixel values in the bit map to the display processor every refresh cycle regardless of

whether these values represent the image or the background. Therefore the refresh process is independent of

the complexity of the image and the number of its graphics items. Thus there is no chance of a flicker problem

with the increased complexity of the image as in the case of refresh displays.

Primitives

A primitive is a low level object or operation from which higher-level, more complex objects and operations

can be constructed. In graphics, primitives are basic elements, such as lines, curves, and polygons, which can

be combined to create more complex graphical images. In programming, primitives are the basic operations

supported by the programming language. To creative any drawing in the computer these primitives form a

part of the software and the type of display to store these in the form of data is important.

2. Graphics Primitives

Graphics Primitive is a basic object that is essential for the creation or construction of complex images.

Graphics is constructed from three basic elements, as opposed to the great variety of graphics applications.

The most basic of these elemental structures is the pixel, short for picture element.

2.1. Pixel:

A pixel is a point of light. It is just one tiny dot on the raster displays. Though it has no structure, it is

definitely a building block and hence it can be considered as the graphics primitive. The resolution of CRT is

related to the dot size, the diameter of a single dot. A resolution of 100 dots lines/inch implies a dot size of

0.01 inch. The ratio of the distance between the centres of two adjacent horizontal pixels to that of the

vertical ones is called the Pixel Ratio. Pixel ratio should be considered in line-generating algorithms.

2.2. Line:

Line, especially straight lines, constitute the basic building block of Line graphs, bar and pie charts, two and

three-dimensional graphs of mathematical functions, engineering drawings and architectural plans. In

computer graphics, straight line is so basic in creating images that we call it a graphics primitive. Straight

lines can be developed in two different ways. A structural method determines which pixels should be set

before drawing the line; a conditional method tests certain conditions to find which pixel should be set next.

2.3. Polygon

A polygon is a closed area of image bounded by straight or curved lines and filled with one solid color. Since

images are two dimensional, a polygon is a closed planar figure. A polygon is an important graphics

primitive. So often we want to handle polygon as a single entity, as images of objects from the real world

consist in large, part of polygons.

3. Display File

A display file is a set of uncorrelated data, such as a histogram array or bivariate array. The arrays are filled

event by event from a list data in order to create a display. The saved arrays usually take up far less disk

space, but can the data can no longer be gated.

Page 14: Introduction to Computer Graphics

4. Frame Buffer

The video output device which drives a video display from the memory buffer containing a complete set of

data is known as Frame Buffer. The image is stored in terms of pixel by pixel. The memory can be discs,

Integrated circuits etc.

5. Display Control

This controls the view of the image so that the user can view the mage from desired angle and desired

magnification.

6. Display Processor

The display processor read the data from the frame buffer and convert it into corresponding 1's and 0's

according to there pixels and then put it on to a monitor screen. The display processor does this work 30

times per second to maintain a steady picture on the screen, and if we want to change the picture on the

screen then we have to change the contents of frame buffer.

7. Line Generation

In mathematics and computer science an algorithm is a step by step procedure for making calculations.

Algorithms are made for calculation, data processing and automated reasoning. In order to draw lines on a

computer screen, the Bresenham Line Algorithm is used that determines which order to form a close

approximation to a straight line between two given points. It uses only integer addition, subtraction and

bit shifting where the digits are moved or shifted left or right, all of which are very cheap operations in

standard computer architectures. It is one of the earliest algorithms developed in the field of computer

graphics. A minor extension to the original algorithm also deals with drawing circles.

Another algorithm namely, Digital Differential Analyzer is a Scan Conversion Line Algorithm based on

calculating either dy or dx. We sample the line at unit intervals in one coordinate & determine

corresponding integer values nearest to the line path for the other coordinate. The algorithm accepts as input

the two endpoint pixel positions. Horizontal & vertical differences between the endpoint positions are

assigned to parameters dx & dy. The difference with the greater magnitude determines the increment of the

parameter steps. Starting with the pixel position (xa, ya), we determine the offset needed at each step to

generate the next pixel position along the line path.

8. Graphics Software

Graphics software is a program or set of programs that enables us to manipulate the visual images on

computer system. There two types of graphics namely, Raster graphics and Vector graphics. The Raster

graphics or bitmap, is a dot matrix data structure representing a generally rectangular grid of pixels, or points

of color, Vector Graphics is the use of geometrical primitives such as points, lines, curves, and shapes or

polygon(s), which are all based on mathematical expressions, to represent images in computer graphics. It is

easy to convert from vector graphics to raster graphics, but going the other way is harder. Some software

attempts to do this. In addition to static graphics, there are animation and video editing software. Computer

graphics also can be used by other editing software such as Adobe Photoshop, Pizap, Microsoft Publisher,

Picasa and etc. Other software that can be used is animation software, video editor software such as Windows

Movie Maker etc.

Page 15: Introduction to Computer Graphics

9. Points and Lines

Points are used throughout graphics as building blocks for more complicated shapes (e.g. triangles created

with three points). Another fundamental geometric object in 2D graphics is the line. A line is defined as

containing all 2D points (x , y) which satisfy the equation ax + by + d = 0

10. Polygons

Polygons are used in computer graphics to compose images that are three-dimensional in appearance.

Usually triangular, polygons arise when an object's surface is modeled, vertices are selected, and the object is

rendered in a wire frame model. This is quicker to display than a shaded model; thus the polygons are a stage

in computer animation. The polygon count refers to the number of polygons being rendered per frame.

11. Filling of Polygons

The polygon is filled to consider the entire area when it is rendered. If it is not filled, only the points on the

perimeter of the polygon will be drawn. When a polygon is filled, the interior of the polygon is considered. All

of the pixels within the boundaries of the polygon is set to the specified color or pattern. In order to

determine which pixels are inside the polygon, the odd-parity rule determining which pixel lies within the

polygon and which lies outside is used within the scan-line polygon fill algorithm.

12. Text Primitive

With the Text graphics primitive, we can insert text at any position in two- or three-dimensional

Mathematical graphics. The text will be given in the graphic's base style.

13. Windowing and Clipping

In computer graphics any object that is larger than the computer screen cannot be seen through the monitor

i.e., window. So we have to remove the unseen portions of the image or block out those portions. This process

is known as clipping and making the object to be seen through the window by using algorithms is known as

windowing.

14. View Port

A viewport is a rectangular viewing region in computer graphics, or a term used for optical components.

1. Homogenous Coordinates

The use of computers to create images involves many basic operations where the algorithms are to be

formulated by clearly understanding the concepts and techniques involved in it. The mage formation requires

not only the software and also the methodology how the required shape can be created using the computer.

The homogenous coordinates are used to create objects in the space.

These are a system of coordinates used in projective geometry like Cartesian coordinates are used in

Euclidean geometry. They have the advantage that the coordinates of points, including points at infinity, can

be represented using finite coordinates. Formulas involving homogeneous coordinates are often simpler and

more symmetric than their Cartesian counterparts. Homogeneous coordinates have a range of applications,

including computer graphics and 3D computer vision, where they allow affine transformations and, in

general, projective transformations to be easily represented by a matrix. Homogeneous coordinates are

everywhere in computer graphics because they allow common operations such as translation, rotation,

scaling and perspective projection to be implemented as matrix operations.

Page 16: Introduction to Computer Graphics

One of the many purposes of using homogeneous coordinates is to capture the concept of infinity. In the

Euclidean coordinate system, infinity is something that does not exist. Mathematicians have discovered that

many geometric concepts and computations can be greatly simplified if the concept of infinity is used. This

will become very clear when we move to curves and surfaces design. Without the use of homogeneous

coordinates system, it would be difficult to design certain classes of very useful curves and surfaces in

computer graphics and computer-aided design.

2. Transformations

Transformations are used to position objects, to shape objects to change viewing positions. There are

different types of transformations namely, Geometric Transformations which includes, Translation, Rotation

and scaling. Linear transformation which preserves parallel lines, including Non-uniform scales and shears or

skews, Projection which preserves lines which includes Perspective projection and Parallel projection and

finally Non-linear transformation where lines become curves including Twists, bends, warps and morphs.

The transformations are done by using matrices to change the homogenous coordinates.

3. Planners

It is planning for the application of computers for the design and manufacturing operations. The path of

movement of a particular component may also be planned by using algorithm. The motion of robot can be

formulated using planners.

4. Space Curve Design

Computer graphics depends on parametric forms to describe curves and surfaces. Normally a curve is

presented as a graph of a function y = f(x). As x is varied, y = f(x) is computed by the function f, and the pair of

coordinates (x, y) sweeps out the curve. This is called the explicit form of the curve. An explicit curve cannot

have infinite slope. The derivative f' (x) is not defined parallel to the y axis. Hence there are points on the

curve that cannot be defined. Any transformation, such as rotation or shear, may cause an explicit curve to

violate the coordinates. So a parametric form is used. A parametric curve that lies in a plane is defined by

two functions, x(t) and y(t), which use the independent parameter t. x(t) and y(t) are coordinate functions,

since their values represent the coordinates of points on the curve. As t varies, the coordinates (x(t), y(t))

sweep out the curve. If we consider the two functions: x(t) = sin(t), y(t) = cos(t). As t varies from zero to 2p,

a circle is swept out by (x(t), y(t)).

The curve design is done by using parametric equations. Non-Parametric Equations are used only to locate

a point of intersection on the curve, and not for generating them Curves play a very significant role in CAD

modeling, especially, for generating a wireframe model, which is the simplest form for representing a model.

There are surface models and solid models also.

5. Analytical and Synthetic Approaches

Curves are used to draw a wireframe model, which consists of points and curves; the curves are utilized to

generate surfaces by performing parametric transformations on them. A curve can be as simple as a line or as

complex as a B-spline. In general, curves can be classified as follows:

Analytical Curves: This type of curve can be represented by a simple mathematical equation, such as, a circle

or an ellipse. They have a fixed form and cannot be modified to achieve a shape that violates the mathematical

equations.

Page 17: Introduction to Computer Graphics

Interpolated Curves: An interpolated curve is drawn by interpolating the given data points and has a fixed

form, dictated by the given data points. These curves have some limited flexibility in shape creation, dictated

by the data points.

Approximated Curves: These curves provide the most flexibility in drawing curves of very complex shapes.

The model of a curved automobile fender can be easily created with the help of approximated curves and

surfaces. In general, sweeping a curve along or around an axis creates a surface, and the generated surface

will be of the same type as the generating curve, e.g., a fixed form curve will generate a fixed form surface.

6. Parametric and Implicit Equations

In mathematics, parametric equation is a method of defining a relation using parameters. The mathematical

representation of a curve can be classified as either parametric or nonparametric (natural). A non-parametric

equation has the form, = � + � + � + � � �� � � �� � �

This is an example of an explicit non-parametric curve form. In this equation, there is a unique single value of

the dependent variable for each value of the independent variable. The implicit non-parametric form of an

equation is, − � + − � = � � ��� � − �� � � �� � �

In this equation, no distinction is made between the dependent and the independent variables. This equation

gives the flexibility to generate any curve form depending on our requirement in computer graphics.

Parametric Equations:

Parametric equations describe the dependent and independent variables in terms of a parameter. The

equation can be converted to a non-parametric form, by eliminating the dependent and independent

variables from the equation. Parametric equations allow great versatility in constructing space curves that

are multi-valued and easily manipulated. Parametric curves can be defined in a constrained period ( ≤ t ≤

1); since curves are usually bounded in computer graphics, this characteristic is of considerable importance.

Therefore, parametric form is the most common form of curve representation in geometric modeling.

Examples of parametric and non-parametric equations follow. Let us study a straight line in a plane as a

simple first example.

The triangles P1,A,P and P1,B,P2 are similar and we can set up the following: −− = −−

and find for example y expressed by coordinates for the two known points and x.

Page 18: Introduction to Computer Graphics

= −− − +

As an alternative we could set up a parametric equation for the line. Parametric means that the expression

contains a parameter t, which changes when we run along the line. For a line in the plane we get two

parametric expressions, one for x and one for y. Since we have a line, both are linear. � = � + �. � − � � = + − . � ; � = + − . �

We see that = and = and = and = . Since the expressions are linear we

know that when t runs from 0 to 1, x and y runs from P1 to P2. A parametric form gives control over the length

of the line, not only the line direction. Even this simple example can be useful in some situations. If we are

going to carry out an animation that moves in a straight line, we can control the animation with small t-steps.

We control speed by varying the t-steps. More compound movements can be controlled by a sequence of

linear movements, if we don't come up with something cleverer.

An extension to include lines in space is simple. If we know the end points: � , , and � , ,

we get: � = � + �. � − � � = + − . � ; � = + − . � ; � = + − . � Consider the unit circle which is described by the ordinary (Cartesian) equation + = � ���

This equation can be parameterized as well, giving [� � , � � ] for ≤ ≤ �

Where, t is the parameter.

With the Cartesian equation it is easier to check whether a point lies on the circle or not. With the parametric

version it is easier to obtain points on a plot. CAD programs prefer a parametric equation for generating a

curve. Parametric equations are converted into matrix equations to facilitate a computer solution, and then

varying a parameter from 0 to 1 creates the points or curves.

Splines

In early days, the drawing of curves of done by using splines which is a long flexible piece of wood or plastic.

In the 1960s a mathematician and engineer named Pierre Bezier changed everything with his newly

developed CAGD tool called UNISURF. This new software allowed designers to draw smooth looking curves

on a computer screen, and used less physical storage space for design materials. Beziers contribution to

computer graphics has paved the road for CAD software. His developments serve as an entry gate into

learning about modern computer graphics, which spawned a relatively new mathematical object known as a spline, or a smooth curve specified in terms of a few points.

Page 19: Introduction to Computer Graphics

B-Spline and Bezier Curves

In the mathematical subfield of numerical analysis, a B-spline is a spline function that has minimal support

with respect to a given degree, smoothness, and domain partition. A fundamental theorem states that every

spline function of a given degree, smoothness, and domain partition can be uniquely represented as a linear

combination of B-splines of that same degree and smoothness, and over that same partition.

The term "B-spline" is short form for Basis Spline. B-splines can be evaluated in a numerically stable way by

the de Boor Algorithm. In the computer science subfields of computer-aided design and computer graphics,

a B-spline is simply a generalization of a Bezier.

Bezier Curves are widely used in computer graphics to model smooth curves. As the curve is completely

contained in the convex hull of its control points, the points can be graphically displayed and used to

manipulate the curve intuitively. Affine transformations such as translation, and rotation i.e., a

transformation which preserves straight lines (i.e., all points lying on a line initially still lie on a line after

transformation) and ratios of distances between points lying on a straight line (e.g., the midpoint of a line

segment remains the midpoint after transformation). It does not necessarily preserve angles or lengths, but

does have the property that sets of parallel lines will remain parallel to each other after an affine

transformation. Bezier curves are parametric functions, and are characterized by using the same kind of

function for all its dimensions. Unlike the above example, where the x and y values use different functions

(one uses a sine, the other a cosine), Bezier curves use "binomial polynomials" for both x and y.

Bezier curves are polynomials of t, rather than x, with the value for t fixed being between 0 and 1, with

coefficients a, b etc. taking the "binomial" form, pretty simple description for mixing values: Linear − � + − � �quare − � + . [� − � ] + − � Cubic − � + . [� − � ] + . [� − � ] + − �

Page 20: Introduction to Computer Graphics

1.1 Introduction

In general, a Computer Aided Design (CAD) package has three components: a) Design, b) Analysis, and c)

Visualization, as shown in the sketch. A brief description of these components follows.

a) Design: Design refers to geometric modeling, i.e., 2-D and 3-D modeling, including, drafting, part creation,

creation of drawings with various views of the part, assemblies of the parts, etc.

b) Analysis: Analysis refers to finite element analysis, optimization, and other number crunching engineering

analyses. In general, a geometric model is first created and then the model is analyzed for loads, stresses, moment

of inertia, and volume, etc.

c) Visualization: Visualization refers to computer graphics, which includes: rendering a model, creation of pie

charts, contour plots, shading a model, sizing, animation, etc.

Components of Computer Aided Design

Each of these three areas has been extensively developed in the last 30 years. Most commercial CAD packages

(software) consist of only a single component: design or analysis or visualization. However, a few of the vendors

have developed an integrated package that includes not only these three areas, but also includes the manufacturing

software (CAM). Due to the large storage requirement, integrated packages use either an UNIX workstation or a mainframe platform, and not the popular PC platform. With the improvement in PC computing speed, it’s only a matter of time before we see an integrated package run on a PC. CAD has revolutionized the modern engineering

practice; small and large companies use it alike, spending several billion dollars for the initial purchase or lease

alone.

1.2 Computer Aided Manufacturing (CAM)

CAM is the next stage of CAD. A part created in CAD can be downloaded and manufactured, without a human hand

touching the part. The process is called CAM, and involves CAD, Networking, and NC programming, as shown

below.

Components of Computer Aided Manufacturing

Page 21: Introduction to Computer Graphics

1.4 Concurrent Engineering

Concurrent Engineering is another powerful CAD concept that has evolved in the ’s. According to this concept, there is an instantaneous communication between the designer, analyst, and manufacturing. Changes made at any

of these work centers are immediately passed on to the others and the product is modified without delay. Often,

the customer, management, and the marketing people join in and become part of the process. Concurrent

engineering saves the valuable time and helps get the product out in the market quicker. Products that use to take

years from the date of its concept to the actual production now take only a few weeks, and the final product is

better and cost-effective.

Some large organizations have invested in Rapid Prototyping process. In this process, the part is created by a CAD

package and downloaded into the rapid prototyping machine; the machine immediately manufactures the part,

using a plastic material. This is a good example of concurrent engineering, sometimes referred as Art to Part

concept.

1.5 CAD/CAM History

The concept of CAD and CAM is relatively new. The usage is linked with the development of computers. The actual

application of CAD/CAM in industry, academia and government is only approximately 30 years old. Formal courses

in CAD and Finite Element Analysis FEA were introduced in ’s. The major application thrust of CAD came in ’s, with the availability of PCs and workstations. )n its early stage of usage, very few engineering companies could afford the expense of mainframe computers; however, PCs and workstations have evolved into affordable

and adequate platform to support comprehensive CAD packages that initially were designed to run on the

mainframe platform. A brief history of the evolution of CAD/CAM, according to the decade and the major CAD/CAM

developments, is outlined below.

’s • Development in )nteractive computer graphics research • Sketchpad system developed by )van Sutherland in • CAD term coined • First major commercial CAD/CAM software available: CADAM by Lockheed, in 1965 • Bell Telephone’s - Graphics 1 remote display system developed

’s • Application of CAM in government, industry and academia • National organization formed • Beginning of usage of computer graphics • Turnkey system available for drafting • Wireframe and surface modeling software became available • Mass property calculation and FEA software became available • NC tape generating, verification, and integrated circuit software became available

’s • CAD/CAM used for engineering research and development • New CAD/CAM theories and algorithms developed • )ntegration of CAD/CAM

Page 22: Introduction to Computer Graphics

• Solid modeling software became available • Use of PCs and workstation began

’s • Concept of concurrent engineering developed • )ncreased use of CAD/CAM on PCs and workstations • )mprovements in hardware and software

1.6 CAD Hardware

There are basically two types of devices that constitute CAD hardware: a) Input devices, and b) Output devices. A

brief description follows.

1.6.1 Input Devices

These are the devices that we use for communicating with computer, and providing our input in the form of text

and graphics. The text input is mainly provided through keyboard. For graphic input, there are several devices

available and used according to the work environment. A brief description of these devices is given here.

Mouse: This is a potentiometric device, which contains several variable resistors that send signals to the

computer. The functions of a mouse include locating a point on the screen, sketching, dragging an object, entering

values, accepting a software command, etc. Joystick and trackballs are analogous to a mouse device, and operate on

the same principle.

Digitizers: Digitizers are used to trace a sketch or other 2-D entities by moving a cursor over a flat surface (which

contains the sketch). The position of the cursor provides a feedback to the computer connected with the device.

There are electrical wires embedded in orthogonal directions that receive and pass signals between the device and

the computer. The device is basically a free moving puck or pen shaped stylus, connected to a tablet.

Light Pens: Lockheed’s CADAM software utilized this device to carry out the graphic input. A light pen looks like a pen and contains a photocell, which emits an electronic signal. When the pen is pointed at the monitor screen, it

senses light, which is converted to a signal. The signal is sent to the computer, for determination of the exact

location of the pen on the monitor screen.

Touch Sensitive Screens: This device is embedded in the monitor screens, usually, in the form of an overlay. The

screen senses the physical contact of the user. The new generation of the Laptop computers is a good example of

this device.

Other Graphic Input Devices: In addition to the devices described above, some CAD software will accept input via

Image Scanners, which can copy a drawing or schematic with a camera and light beam assembly and convert it into

a pictorial database.

The devices just described are, in general, independent of the CAD package being used. All commercial CAD

software packages contain the device drivers for the most commonly used input devices. The device drivers

facilitate a smooth interaction between our input, the software, and the computer. An input device is evaluated on

the basis of the following factors: • Resolution • Accuracy

Page 23: Introduction to Computer Graphics

• Repeatability • Linearity

1.6.2 Output Devices

After creating a CAD model, we often need a hard copy, using an output device. Plotters and printers are used for

this purpose. A plotter is often used to produce large size drawings and assemblies, where as, a laser jet printer is

adequate to provide a 3-D view of a model. Most CAD software require a plotter for producing a shaded or a

rendered view.

1.7 CAD Software

CAD software are written in FORTRAN and C languages. FORTRAN provides the number crunching, where as, C

language provides the visual images. Early CAD packages were turnkey systems, i.e., the CAD packages were sold as

an integrated software and hardware package, with no flexibility for using second vendor hardware (1970s and

80s). These systems were based on 16-bit word, and were incapable of networking. The modern CAD software

utilizes the open architecture system, i.e., software vendors do not design and manufacture their own hardware.

Third party software can be used to augment the basic CAD package. Most popular CAD package will facilitate

integration of the Finite Element Analysis and other CAD software from more than one vendor. For example, IDEAS

preprocessor can work with almost all the FEA packages for pre and post analyses.

Networking is an important consideration in applications of CAD software. A model created by one engineer must

be readily accessible to others in an organization, which is linked by a LAN or other means. The designer, analyst,

management, marketing, vendor, and others generally share a model. This is the concurrent engineering in action,

mentioned earlier.

1.8 CAD Platform

In general, we can run CAD software on three different CAD platforms:

(i) Mainframe

(ii) Workstation, and

(iii) PC

When the CAD programs first became available, they could only be run on a mainframe computer. However, as the

PCs have become faster and cheaper, almost all the CAD vendors have introduced a version of their CAD software

Page 24: Introduction to Computer Graphics

that will effectively run on a Pentium or higher computer. Currently, the most popular platforms are PCs and

Workstations. Popularity of Workstations stems from their ability to network easily with other computers, and

also, due to their large memory storage capability. However, PC platform is still the most preferred medium for

most engineers. Increasing popularity of the PC platform can be attributed to several factors, including, total user

control, the speed, capability of storing large memory, ease of hardware upgrading and maintenance, and the

overall reasonable cost.

1.9 CAD Evaluation Criteria

In the current CAD market, ProE and AutoCAD are arguably the most dominating CAD software. AutoCAD is

basically a 2-D program, with some capability to create 3-D models, where as, ProE is a truly 3-D CAD package. No

one CAD package is suitable for all the CAD users in the world. The product we are designing dictates the type of

CAD package we need. A good CAD package includes good software, as well as, a compatible hardware. Following is

a brief description of the general criteria for evaluating a CAD package.

Hardware: Most desirable features in a good hardware are: • Open architecture • (igh speed, large storage • Compact size • )nexpensive components • )nexpensive upgrading

Software: In general, the most comprehensive software are written to satisfy almost all the modeling needs of a

modeler, consequently, the software tend to be very complex and hard to learn. To create a simple model, we go

through several unnecessary steps, and lack the intuitiveness of a simple, straightforward program. ProE is a good

example, where we have to go through several layers of menus to create a simple solid. On the other hand, if we

were to use a simpler CAD program, the same solid can be created by only a few simple commands. There are

several other factors that we should consider when evaluating software. Following is a brief description of these

factors. • Operating System: UNIX or Windows/NT. PCs in general use Microsoft Windows, where as, operating system for

Workstations is Unix. For a large organization, Workstations are preferable. • User Interface: Most popular CAD software have menu driven commands, which is preferable to the old system

of non-menu driven, where user interface was completely by responding to software commands. The most popular

CAD programs work with menu driven interface, with some input/action required through command prompts. • Documentation and Support: Learning software can be very difficult if the software lacks good documentation. Documentation usually comes in the form of a user’s manual, a tutorial book, and commands manual and on-line

help. The recent trend is to provide access to the above-mentioned documentation through the Internet, or provide

the manuals on a CD ROM. Some CAD vendors provide additional technical support help through phone – ProE is a

very good example of this type of support. • Maintenance: Cost of the hardware and software upgrades can significantly impact the small and medium size companies’ decision to choose one software over the others. Most CAD vendors go through an upgrade, on the

average, every two years. Usually, hardware upgrade is not as frequent.

Page 25: Introduction to Computer Graphics

• Modeling Capabilities: In, general, a CAD software can be classified as either a 2-D or a 3-D program. If we were

basically involved in 2-D drawings, any well established 2-D software, similar to AutoCAD would suffice our needs.

On the other hand, if we need to create 3-D models and assemblies, we will be better off with a 3-D molder – ProE,

SOLIDWORKS, etc.

• Ease of Modeling: As a rule-of-thumb, a general, all-purpose type CAD software is much more complex and

difficult to learn than a special purpose CAD package. • Interface with other CAD Packages and Data Transferability: A CAD package is used to create models that

will be used for analysis, manufacturing, or some other applications. Therefore, a CAD software should be capable

of transferring and accepting files from other CAD or CAM programs, without this provision, the CAD program has

only a very limited use. • Design Documentation: Besides creating a model, the software should be capable of creating drawings,

assemblies, dimensioning, various views (isometric, orthogonal, etc.), labels and attributes, etc.

1.10 Mechanical Engineering Applications of CAD

Following is a brief description of the applications of CAD in mechanical engineering. • Two Dimensional Drafting: This is the most common use of a CAD package. 2-D drawings are used for

manufacturing a product. • Report Generating: To generate reports and bill of materials. Spreadsheets and word-processors can be linked

to provide a report writing facility.

• -D Modeling: To create wireframe, surface and solid models. The 3-D models are for concept verification,

manufacturing, FEA, etc. • Finite Element Analysis: FEA package is used for pre-processing, analysis, and post-analysis of structures. For

this application, a CAD package contains both the modeling and analysis modules. • Manufacturing: manufacturing software is usually called CAM, and contains CAD software as one of the

components. CAM software provides capabilities of carrying out 2 and 3-axes machining.

Graphics System

There are different formats used for storing a picture in a computer; but, unlike text and data files, which are

primarily made up of alphanumeric characters, graphics formats are more complex.

Two major categories of graphics formats are Vector Graphics (objects made up of lines) and Bitmapped

Graphics (TV-like dots).

Images stored in vector format can be moved to another vector system typically without loss of resolution.

There are 2D vector formats as well as 3D vector formats.

During transfer of raster images among different devices, resolution is a major concern. Such transfers can occur

without loss of resolution as long as the new format supports the same or is of higher resolution to the old one.

Standard graphics formats allow images to be moved from machine to machine, while standard graphics languages

let graphics programs be moved from machine to machine.

Page 26: Introduction to Computer Graphics

For example, GKS, PHIGS and OpenGL are major graphics languages that have been adopted by high-performance

workstation and CAD vendors. GDI and DirectX are the graphics languages in Windows.

High-resolution graphics is typically expensive to implement due to its large storage and fast processing

requirements. However, as desktop computers become more powerful, graphics have become widely used in every

application.

Raster Scan Displays

In a raster-scan system, the electron beam is swept across the screen, one row at a time from top to bottom.

As the electron beam moves across each row, the beam intensity is turned on and off to create a pattern of

illuminated spots.

Picture definition is stored in a memory area called the Refresh Buffer or Frame Buffer used for redrawn.

Each screen point is referred to as a pixel or pel (picture element).

Intensity range for pixel positions depends on the capability of the raster system.

In a B&W system, each screen point is either on or off. So only one bit is needed.

The frame buffer in B&W system is called as bitmap. For multi-color systems the frame buffer is called as pix map.

Refreshing on raster-scan displays is carried out at the rate of 60 to 80 frames per second. The unit for refreshing

rate is Hertz (Hz).

Random-Scan Displays

The CRT has the electron beam directed only to the parts of the screen where a picture is to be drawn.

Random-scan monitors draw a picture one line at a time, called as Vector Display.

Refresh rates on a ransom-scan system depends on the number of lines to be displayed.

Picture definition is stored as a set of line-drawing commands in the refresh display file or refresh buffer.

To display a specified picture, the system cycles through the set of commands in the display file, drawing each

component line.

These systems are designed for the line-drawing applications and can’t display realistic shaded scenes.

Page 27: Introduction to Computer Graphics

(a) Raster Scan Display (b) Random Scan Display

Base of difference Raster Scan Display Random Scan Display

Electron Beam The electron beam is swept across the

screen, one row at a time, from top to

bottom.

The electron beam is directed only to the

parts of screen where a picture is to be

drawn.

Resolution Its resolution is poor because raster system

in contrast produces zig-zag lines that are

plotted as discrete point sets.

Its resolution is good because this system

produces smooth lines drawings because

CRT beam directly follows the line path.

Picture Definition Picture definition is stored as a set of

intensity values for all screen points, called

pixels in a refresh buffer area.

Picture definition is stored as a set of line

drawing instructions in a display file.

Realistic Display The capability of this system to store

intensity values for pixel makes it well

suited for the realistic display of scenes

contain shadow and color pattern.

These systems are designed for line-drawing

and can’t display realistic shaded scenes. Draw an Image Screen points/pixels are used to draw an

image.

Mathematical functions are used to draw an

image.

Vector Scan Display Raster Scan Display

The beam is moved between the end

points of the graphics primitives.

The electron beam is moved all over the screen one scan line at a time,

from top to bottom and then back to top.

Vector display flickers when the number

of primitives in the buffer becomes too

large.

In raster display, the refresh process is independent of the complexity

of the image.

Scan conversion is not required. Graphics primitives are specified in terms of their endpoints and must

be scan converted into their corresponding pixels in the frame buffer.

Scan conversion hardware is not Because each primitive must be scan converted, real time dynamics is

Page 28: Introduction to Computer Graphics

required. far more computational and requires separate scan conversion

software.

Vector display draws continuous and

smooth lines.

Raster display can display mathematically smooth lines, polygons and

boundaries of curved primitives only by approximating them with

pixels on the raster grid.

Cost is more. Cost is low.

Vector display only draws lines and

characters.

Raster display has ability to display areas filled with solid colours or

patterns.

Graphics Output Primitive

Point:

Pixel is a unit square area identified by the coordinate of its lower left corner.

Each pixel on the display surface has a finite size depending on the screen resolution & hence a pixel can’t represent a single mathematical number.

Origin of the reference coordinate system being located of the lower left corner of the display surface.

The each pixel is accused by non-negative integer coordinate pair(x, y).

The x values start at the origin &increase from left to right along a scan line & y values start at the bottom &

increase upwards.

In the above diagram the coordinate of pixel A:0,0 ,B:1,4 , C:4,7.C:4,7.

A coding position (4. 2, 7. 2) is represented by C.

Whereas (1.5, 4.2) is represented by B.

In order to half a pixel on the screen we need to round off the coordinate to a nearest integer.

Line Drawing

Line drawing is accomplished by calculating intermediate point coordinates along the line path between two given

end points.

Screen pixel are referred with integer values, plotted positions may only approximate the calculate coordinates,

what is pixel which are intensified are those which lie very close to the line path.

In a high resolution system the adjacent pixels are so closely spread that the approximated line pixels lievery close

to actual line path and hence the plotted lines appear to be much smooth-almost like straight line drawn on paper.

In low resolution system the same approximation technique causes to display with stair step appearance that is

not smooth.

Line Drawing Algorithm

The equation of a straight line is

Y= mX + b Where m representing slope of the line and b as the y intercept

Given two end points of a line segment are ( 1,y1)&( 2 , 2 )

��e e�ua���n �� ��ra���� l�ne can be wr���en a� 1 = ( −− ) +

Page 29: Introduction to Computer Graphics

1 = + �� �, = ( −− )

For any given x interval Δ along a line, we can compute the corresponding y interval Δ

= (∆∆ ) → ∆ = ∆ Similarly we can obtained the x interval Δ corresponding to a specified Δ as

∆ = ∆

For a line with slope magnitude |m|<1, Δ can be set proportional to a small horizontal deflection voltage & the

corresponding vertical deflection is then set proportional to Δ as calculate from the equation Δ =� Δ .

For a line whose slopes have magnitudes |m|>1, Δ can be set proportional to a small vertical deflection voltage

with the corresponding horizontal deflection voltage set proportional to Δ calculate from the equation Δ =Δ /�

For a line with m=1, then Δ = Δ and vertical & horizontal deflection voltages are equal.

In each case a smooth line with slope m is generated between specified end point.

The Bresenham Line Algorithm

The Bresenham algorithm is another incremental scan conversion algorithm. The big advantage of this algorithm is

that it uses only integer calculations. Move across the x axis in unit intervals and at each step choose between two

different y coordinates.

For example, from position (2, 3) we have to choose between (3, 3) and (3, 4). We would like the point that is

closer to the original line.

At sample position + the vertical separations from the mathematical line are labeled � and � . The y

coordinate on the mathematical line at + is: = + +

� = − = + + − ; � = + − = + − + − We can use these to make a simple decision about which pixel is closer to the mathematical line. This simple

decision is based on the difference between the two pixel positions:

Page 30: Introduction to Computer Graphics

� − � = + − + − Let’s substitute m with ∆ ∆⁄ where ∆ and ∆ are the differences between the end-points:

∆ ( � − �) = ∆ ( ∆∆ + − + − )

After solving we get, ∆ ( � − �) = ∆ . − ∆ . +

So, a decision parameter for the � step along a line is given by: = ∆ ( � − �) = ∆ . − ∆ . +

The sign of the decision parameter is the same as that of � − � . If is negative, then we choose the

lower pixel, otherwise we choose the upper pixel. Remember coordinate changes occur along the x axis in unit

steps so we can do everything with integer calculations.

At step + the decision parameter is given as:

+ = ∆ . + − ∆ . + +

Subtracting from this we get:

+ − = ∆ + − − ∆ + − Bu� + �� �ame a� + �� + = + ∆ − ∆ + −

where + − is either 0 or 1 depending on the sign of

The first decision parameter is evaluated at , is given as: = ∆ − ∆

Bresenham’s Line Drawing Algorithm (for |m| < 1.0)

1. Input the two line end-points, storing the left end-point in (x0, y0)

2. Plot the point (x0, y0)

3. Calculate the constants Δx, Δy, Δy, and Δy - Δx and get the first value for the decision parameter as: = ∆ − ∆

4. At each xk along the line, starting at k = 0, perform the following test. If pk< 0, the next point to plot is (xk+1, yk)

and:

+ = + ∆

Otherwise, the next point to plot is (xk+1, yk+1) and:

+ = + ∆ − ∆

5. Repeat step Δx –1) times.

Page 31: Introduction to Computer Graphics

Let’s plot the line from , to ,

First off calculate all of the constants: ∆ = ; ∆ = �; ∆ = ; ∆ − ∆ = − Calculate the initial decision parameter p0: = ∆ − ∆ =

Go through the steps of the Bresenham line drawing algorithm for a line going from (21,12) to (29,16)

The Bresenham line algorithm has the following advantages: –An fast incremental algorithm –Uses only integer calculations

Comparing this to the DDA algorithm, DDA has the following problems: –Accumulation of round-off errors can make the pixelated line drift away from what was intended –The rounding operations and floating point arithmetic involved are time consuming.

The equation for a circle is: + = �

where r is the radius of the circle

So, we can write a simple circle drawing algorithm by solving the equation for y at unit x intervals using: = ± √� −

Page 32: Introduction to Computer Graphics

However, unsurprisingly this is not a brilliant solution!

Firstly, the resulting circle has large gaps where the slope approaches the vertical.

Secondly, the calculations are not very efficient –The square (multiply) operations are lengthy.

The first thing we can notice to make our circle drawing algorithm more efficient is that circles centred at (0, 0)

have eight-way symmetry. Similarly to the case with lines, there is an incremental algorithm for drawing circles –the mid-point circle algorithm.

Mid-Point Circle Algorithm

1. Input radius and circle centre , then set the coordinates for the first point on the circumference of a circle

centered on the origin as: , = , �

2. Calculate the initial value of the decision parameter as:

= − �

3. Starting with = at each position perform the following test. If < 0, the next point along the circle

centered on 0,0 �� + , and:

+ = + + +

Otherwise the next point along the circle is + , − and:

+ = + + + − +

4. Determine symmetry points in the other seven octants

5. Move each calculated pixel position , onto the circular path centered at , to plot the coordinate values: = + ; = +

6. Repeat steps 3 to 5 until >=

The key insights in the mid-point circle algorithm are:

Eight-way symmetry can hugely reduce the work in drawing a circle. Moving in unit steps along the x axis at each point along the circle’s edge we need to choose between two possible y coordinates.


Recommended