Sei sulla pagina 1di 5

Open Ended Problem

Computer Aided Design(CAD):

Computer-aided design (CAD) is the use of computers (or workstations) to aid in the creation,
modification, analysis, or optimization of a design. CAD software is used to increase the
productivity of the designer, improve the quality of design, improve communications through
documentation, and to create a database for manufacturing. CAD output is often in the form of
electronic files for print, machining, or other manufacturing operations. The term CADD (for
Computer Aided Design and Drafting) is also used.
Its use in designing electronic systems is known as electronic design automation (EDA). In
mechanical design it is known as mechanical design automation (MDA) or computer-aided drafting
(CAD), which includes the process of creating a technical drawing with the use of computer
software.
CAD software for mechanical design uses either vector-based graphics to depict the objects of
traditional drafting, or may also produce raster graphics showing the overall appearance of designed
objects. However, it involves more than just shapes. As in the manual drafting of technical and
engineering drawings, the output of CAD must convey information, such as materials, processes,
dimensions, and tolerances, according to application-specific conventions.
CAD may be used to design curves and figures in two-dimensional (2D) space; or curves, surfaces,
and solids in three-dimensional (3D) space.

Example of a CAD model:

Logical Drawing 3D CAD Model

CAD software enables engineers and architects to design, inspect and manage engineering projects
within an integrated graphical user interface (GUI) on a personal computer system. Most
applications support solid modeling with boundary representation (B-Rep) and NURBS geometry,
and enable the same to be published in a variety of formats. A geometric modeling kernel is a
software component that provides solid modeling and surface modeling features to CAD
applications.
A CAD model Software developed in C Language:

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
union REGS i,o;
void show_mouse(){
i.x.ax=1;
int86(0x33,&i,&o);
}
void get_mouse_pos(int *x,int *y,int *button){
i.x.ax=3;
int86(0x33,&i,&o);
*x=o.x.cx;
*y=o.x.dx;
*button=o.x.bx&1;
}
void main(){
int gd=DETECT,gm,x,y,b,x1[3],y1[3],i,ch,j[4],r;
initgraph(&gd,&gm,"../bgi");
settextstyle(0,0,0);
cleardevice();
show_mouse();
bar(0,0,600,25);
setcolor(BLUE);
outtextxy(25,10,"Simple Line");
outtextxy(175,10,"Quadrilateral");
outtextxy(350,10,"Circle");
outtextxy(500,10,"Ellipse");
bar(125,27,600,350);
bar(0,355,600,400);
printf("\n\nScripts;\n");
setcolor(BLACK);
rectangle(90,360,190,390);
rectangle(290,360,390,390);
rectangle(490,360,590,390);
outtextxy(100,375,"Save");
outtextxy(300,375,"Exit");
outtextxy(500,375,"3D figure");
rectangle(0,0,150,25);
rectangle(150,0,300,25);
rectangle(300,0,450,25);
rectangle(450,0,600,25);
setfillstyle(SOLID_FILL,RED);
bar(0,355,10,390);
setfillstyle(SOLID_FILL,BLUE);
bar(10,355,20,390);
setfillstyle(SOLID_FILL,YELLOW);
bar(20,355,30,390);
setfillstyle(SOLID_FILL,GREEN);
bar(30,355,40,390);
rectangle(40,355,50,390);
while(!kbhit()){
get_mouse_pos(&x,&y,&b);
if(x>0&&x<10&&y>355&&b==1){
setcolor(RED);
setfillstyle(SOLID_FILL,RED);
}
if(x>10&&x<20&&y>355&&b==1){
setcolor(BLUE);
setfillstyle(SOLID_FILL,BLUE);
}
if(x>20&&x<30&&y>355&&b==1){
setcolor(YELLOW);
setfillstyle(SOLID_FILL,YELLOW);
}
if(x>30&&x<40&&y>355&&b==1){
setcolor(GREEN);
setfillstyle(SOLID_FILL,GREEN);
}
if(x>40&&x<50&&y>355&&b==1)
if(x>225&&x<325&&y>360&&b==1){
fprintf(fp,"getch();\n}");
fclose(fp);
stop();
exit(0);
}
if(x>=0&&x<=150&&y<=25&&b==1){
delay(200);
ch=1;
}
if(x>150&&x<=300&&y<=25&&b==1){
delay(200);
ch=2;
}
if(x>300&&x<450&&y<=25&&b==1){
delay(100);
ch=3;
}
if(x>450&&x<600&&y<=25&&b==1){
delay(100);
ch=4;
}
if(x>490&&x<590&&y>360&&b==1){
delay(100);
ch=5;
}
switch(ch){
case 1:{
get_mouse_pos(&x,&y,&b);
if(b==1){
for(i=0;i<2;i++){
up:
get_mouse_pos(&x,&y,&b);
if(b==1){
x1[i]=x;
y1[i]=y;
delay(500);
}else{
goto up;
}}
line(x1[0],y1[0],x1[1],y1[1]);
}}
break;
case 2:{
get_mouse_pos(&x,&y,&b);
if(b==1){
for(i=0;i<2;i++){
upR:
get_mouse_pos(&x,&y,&b);
if(b==1){
x1[i]=x;
y1[i]=y;
delay(500);
}else{
goto upR;
}}
rectangle(x1[0],y1[0],x1[1],y1[1]);
}}
break;
case 3:
printf("Enter Radius: ");
scanf("%d",&r);
upC:
get_mouse_pos(&x,&y,&b);
{if(b==1){
x1[0]=x;
y1[0]=y;
}else{
goto upC;} }
delay(500);
circle(x1[0],y1[0],r);
ch=0;
break;
case 4:
printf("Angle[o,p]:\n");
scanf("%d%d",&j[0],&j[1]);
printf("Arc[maj|min]\n");
scanf("%d%d",&j[2],&j[3]);
upE:
get_mouse_pos(&x,&y,&b);
{if(b==1){
x1[0]=x;
y1[0]=y;}
else{
goto upE;} }
delay(500);
ellipse(x1[0],y1[0],j[0],j[1],j[2],j[3]);
ch=0;
break;
case 5:{
get_mouse_pos(&x,&y,&b);
if(b==1){
for(i=0;i<2;i++){
upB:
get_mouse_pos(&x,&y,&b);
if(b==1){
x1[i]=x;
y1[i]=y;
delay(500);
}else{
goto upB;
}}
printf("Enter depth: ");
scanf("%d",&r);
bar3d(x1[0],y1[0],x1[1],y1[1],r,1);
}}
break;
default:
break;
}}
getch();
}

Screenshot of the CAD software