!iLITARY TECHNICAL COLLEGE
CA-1 473
fA S AzyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCB
T
CAIRO - EGYPT
ADDI NG I NTELLI GENT FEATURES
TO AUTOCAD
BY
**
Lt. Col. Dr.
Mostafa Saleh Mostafa
Prof. Dr.
Mikhail Naguib Mikhail
*** Capt. Eng.
KEYWORDS
Hussein Saad Taha
: AutoCAD, Drawing, Sketch, Exact Drawing, Relationship
Element and Geometrical Support.
ABSTRACT
The generation of exact drawing from a given sketch is an
important step in the manufacturing process. This feature does not
exist in any computerized system,so the objective of this work
is to add it to a computer-aided design (CAD) package.
The reconstruction of the exact drawing from the sketch will
be dependet on the values of the different types of dimensions
allocated on the drawing.
The suggested system will be added to AutoCAD which will be
able to read the sketch drawing file drawn by AutoCAD. The
sketch contains both the geometrical
elements and dimensions
then, by one or more Commands of AutoCAD, the Exact Drawing can
be reconstructed.
* Military Technical College, Cairo, Egypt.
** American University in Cairo, Egypt.
*** Egyptian Aif Force Research, Cairo, Egypt
CA-1 474
FIFTH ASAT CONFERENCE
4 - 6 May 1993, CAIRO
1. I NTRODUCTI ON
In this work we look forward to add an intelligent feature
to AUTOCAD system. This feature concerns the process of automatic
generation of exact drawings from the corresponding sketch.
In the design process of any engineering object, the
designer at first, produces some sketches for this object. A
sketch is represented by a drawing or more. A drawing consists of
two sets :E
zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
set of elements (points,segments, arcs,..) and D set
of dimensions (distance, angle,..). Usually the sketch is drawn
by hand, so two important problems must be
stated :
1. The elements are incorrectly drawn. A segment of straight line
may not be linear for example.
2- The drawing is not to scale. In other words the values of
dimensions are not consistent with the realsize of the object
In next step the draftsman starts to produce the exact
drawing manually. In case of changing any dimensions values on
the sketch , the draftsman must regenerate the exact drawing
from the beginning again. The process of generating the exact
drawing from sketch is called reconstruction of the drawing.
In this work we will add an intelligent feature that
automates the manual process of the reconstruction to AutoCAD
package. This work handles only the second problem, while it is
supposed that the manipulation and solution of the first problem
is out of the scope of this work. In other words a sketch will be
generated by AutoCAD. The values of dimensions allocated on
the drawing will be chosen by the user. The
reconstruction of
the exact drawing depending on these values will be
generated automatically within AutoCAD through the added feature.
The idea of automatic reconstruction of a drawing began with
a search of PH.D thesis [10] that reconstructs a drawing
depending on new values of the dimensions. The system was
implemented on a UNIX station in 1986.
Another effort in this field is a master thesis
[11] which deals with a sketch drawing by
AutoCAD (version 2.53j) and stored in DXF format. The
reconstruction process was not fully implemented by this thesis.
In this work, the whole system tasks are completed and
implemented. Fig.1 gives the architecture of the whole system.
This paper consists of the ABSTRACT, SIX sections.
Section 1 : contains an introduction to the paper.
Section 2 : discusses the CAD system and the AutoCAD package.
Section 3 : gives the description of the drawing.
Section 4 : introduces the reconstruction process phases and how
their phases are implemented.
Section 5 : presents how to add and use the new system within
AUTOCAD.
Section 6 : gives the conclusion of the work.
FIFTH ASAT CONFERENCE
CA-1 475
4 - 6 May 1993, CAIRO
2. CAD SYSTEMS
The meaning of computer aided design (CAD) refers to any
application of a computer to the solution of design problems. One
famous CAD system is called AutoCAD package which has different
releases start from release 1 to release 12. It is a DOS based
package.
The objective of this work is to add an intelligent feature
to AutoCAD package, so CAD and AutoCAD package in particular will
be introduced in this section.
A typical CAD system consists of the following components
•Data Base
• Program Library
•Data I/O Query
•Application Program
•Dialogue
•Graphics
2.1 Drawing interchange files
A drawing interchange file is the file which has the
different information of the engineering drawing. A CAD drawing
database (*.dwg files) is written in a very compact format.
All implementation of a CAD accept this format and able to
convert it to and from their internal CAD format. In order to use
generated by
the drawing file it must be in some format which
a common drafting package.
Some common used drawing interchange files are :•The ASCII Drawing Interchange (DXF) files .
•The Binary Drawing Interchange (DXB) files .
•The Initial Graphics Exchange Standard (IGES) files .
2.2 The history of autoCAD package
Release 1 of AutoCAD is designed in December 1982 with a
specific features then every some time some features are added to
the old release to generate a new release. The modern versions of
AutoCAD have more features.
The recent version which is designed at 1992 is called Release 12.
AutoCAD has the following features [4] :
- It follows your instruction to produce the drawing quickly.
- It could correct errors easily and make large revisions without
redoing an entire drawing.
It
produces clean, precise final drawing.
- It can improve accuracy over hand drawing.
- It has several color plates and It is easy to use.
AutoCAD provides a set of entities for use in constructing
your drawing. An entity is a drawing element such as a point,
line, arc, circle, text string, etc. It is required to enter
commands to tell AutoCAD which entity to draw [4].
CA-1 476
FIFTH ASAT CONFERENCE
4 - 6 May 1993, CAIRO
3. ENGI NEERI NG DRAWI NGS DESCRI PTI ON
3.1 Difference between sketch and exact drawing
The sketch is in general a drawing produced by a designer to
describe an object without taking into consideration the values
of exact dimensions of the drawing.In other words the sketch has
exact shape but it does not have exact size. The exact drawing
can be defined as that drawing describing an object,taking into
consideration the exact dimensions of the drawing. In other words
the exact drawing has both exact shape and size.
3.2 Drawing description
As previously defined, the drawing consists of two sets,
geometrical elements and dimensional elements.There is another
set of relationships relating the elements.The relationships are
not explicitly existed in the DXF file.They will be recognized
by the proposed system. The description of each component
:(elements, dimensions, and relationships) will be introduced.
- Geometrical elements :These elements describe the shape of the object.
The most common geometrical elements used in engineering drawing
are :
- Point
- Straight line
- Circle
- Arc of circle
- ellipse
- Arc of ellipse
- Arc of parabola
- Arc of hyperbole
In our context we will be limited to
point
- segment (actually any line will be represented as a segment
since there is no real infinite lines in engineering drawings).
- Arc of circle (a circle can be considered as a special
case
of an arc).
The points,segments, and arcs are represented as follows :
* POINT
A point is represented by its cartesian coordinates (x,y)
* SEGMENT
A segment of a straight line is represented by its two end
point (xy ) and (x y )
1
2' 2
* ARC.
An arc of a circle is represented by its center (x ,y ), its
c c
start point (xs,ys), and its angle "a" measured in counter
clockwise
- Dimensional elements:The dimensions describe the size of the object. The number
of dimensions located on a drawing may be one or more of the
following types :* Linear Dimension
It is defined as the linear distance between two geometrical
elements, and it is represented by two extension lines as follow
((x1 ,y1 ),(x2,y2)), and ((x ,y ),(x ,y ), a dimension line
3 3
4 4
(x ,y ).(x ,y ), and a angular dimension value zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPO
"v"
1 1
3 3
FIFTH ASAT CONFERENCE
CA-114771
I
4 - 6 May 1993, CAIRO
* Angular Dimension
It is defined as the angle between two segments, and is
represented by : the value of dimension "v", an arc defined by
its center (x c ,y c ), its origin (x o'y o ), and the angle value "a"
* Circular Dimension
It is defined as the radius of a circle, and is represented
by : the value of dimension "v" and a segment ((x,y),(xc ,Yc))
where (x,y) is a point on the dimensioned arc, and (x c,yc ) is
the center point of that arc.
- Geometrical Relationships
These are the set of relationships that can be found
between the elements of the drawing.
These relationships are of the following types :
1- Two coincident points.
2- A point lies on a segment or on an arc.
3- A point is the center of an arc.
4- A segment is parallel to another segment.
5- A segment is perpendicular to another segment.
6- Two segments are co-linear.
7- A segment intersects with another segment.
8- A segment intersects with an arc.
9- A segment is tangent to an arc.
10- An arc is tangent to another arc.
11- Two arcs are concentric.
12- Two Arcs belonging to the same circle.
13- An arc intersects with another arc.
14- Circular dimension (radius of an arc).
15- Angle between two segments.
16- Linear distance between two points.
17- Linear distance between two parallel segments.
18- Linear distance between a point and a segment.
Actually a set of 6 relationships are unified, which express all
other types of relationships. They are :1- Incidence
It shows that a point lies on a certain line (supporting a
segment) or circle (supporting an arc).
2- Tangency
It indicates that a circle is tangent to another circle or a
line.
3- Center
Where a point is a center of a circle.
4- Radius
Where a scalar value represents the radius of a circle.
5- Distance
It represents the distance between two parallel lines.
6- Angle
It defines the angle between two lines. A special case is
the zero angle which indicates two parallel lines.
CA-1 478
FIFTH ASAT CONFERENCE
4 - 6 May 1993, CAIRO
3.3 Geometrical support concept
Every segment has a supporting line. Also every arc has a
supporting circle. It was found that the support concept is
heavily used in both manual drafting and automated drafting
packages.
4. RECONSTRUCTI ON PROCESS
4.1 Manual drafting approach
In this section the behavior of a draftsman during the
process of reconstruction for a given exact drawing will be
studied. The geometrical elements are assumed to be limited to
segments of lines and arcs of circles. The draftsman can not plot
an arc directly on the drawing sheet without tracing a support
circle passing through the arc and its two end points. Similarly
the draftsman plots a segment by determining its support line and
the two end points of that segment lying on the line. So to draw
a geometrical element, the draftsman have to determine its
geometrical support, together with the two end points lying on
that support.
Taking into consideration that the points are supports for
themselves, one can say that a geometrical element is totally
defined by three supports: geometrical support and two end
points.
The draftsman also have to visually interpret the sketch to
recognize the different relationships between different supports
of the drawing. the draftsman then starts to draw any support
which has enough relationships with previously known supports.
These relationships can be of geometrical nature
(parallelism, tangency, ... etc) and / or of dimensional nature
(angle, radius, distance, .. etc ). The process of relating
supports to each other and drawing them is iteratively done until
all supports of the drawing are drawn, which means that the
drawing process is finished.
Note that the draftsman must suppose at least two initial
supports. They will be used as reference supports and relative to
them, the rest supports of the sketch are to be drawn. Analyzing
the relationships between these two known supports and unknown
ones, may lead to more than one sequence of plotting.
This depends on which one of the completely related
unknown supports will be drawn first.
4.2 System phases
As shown in Fig.l, the automatic reconstruction system
consists of seven phases. They are :
- Elements and dimensions isolation
- Supports recognition
- Relationships recognition
- Reconstruction order
- Supports recalculation
- Elements recalculation
- Exact drawing plotting
CA-1 479
FIFTH ASAT CONFERENCE
4 - 6 May 1993, CAIRO
The seven phases are implemented in four modules as shown in
Fig.2, They are :
MODULE 1 : ELEMENTS AND DIMENSIONS ISOLATION
MODULE 2 : RECOGNITION OF SUPPORTS AND RELATIONS
MODULE 3 : RECONSTRUCTION ORDER
MODULE 4 : SUPPORTS AND ELEMENTS RECALCULATION
4.3 Elements and dimensions isolation
In this module an input DXF file representing the sketch
will be processed to generate two sets of tables. These two sets
describe the geometrical elements and the dimensional elements of
the sketch.
1- Elements Tables
a- points
b- segments
c- arcs
2- Dimensional tables
a- linear dimensions
b- angular dimensions
c- circular dimensions
Each table contains the geometrical attributes of the corresponding
elements.
4.4 Recognition of supports and relationships
-RECOGNITION OF SUPPORTS
The system finds out the set of geometrical supports
(points, lines, and circles) corresponding to the geometrical
elements of the input drawing in the following tables :
1- SUPPORT TABLES
a- points
b- lines
c- circles
2- SCALARS TABLE
3- MAPPING TABLES
-RECOGNITION OF RELATIONS
The relations recognition module is divided into several
submodules, each of them is responsible for recognizing cretin
type of relationship. The recognition process is done by solving
a set of mathematical equations. For each relationship like :
- Intersection of two segments
- Intersection of two arcs
- Intersection of a segment with an arc
- Tangency
The result of each submodule will be a relationship. A set of
actions are performed for each relationship. The relationship is
to be referred to the supports of elements, rather than the
elements.
4.5 Reconstruction order
This module receives as an input a set of geometrical
supports and a set of relationships between these supports. Also
two supports are supposed to be initially known The supports are
divided into two sets :
FIFTH ASAT CONFERENCE
CA-1 480
6 May 1993, CAIRO
4 -zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLK
Known set (K), and Unknown set (U). Each support in K may have
U. These
zyxwvutsrqponmlkjih
some relationships with other supports S i where S1 e
relationships will be used to transfer the support Su from U to K.
The reconstruction order is achieved in a recursive way. One
unknown support s e U is to be transferred from U to K if and
only if there are sufficient number of relationships connecting
with supports belonging to K. This action is repeated until U is
empty.
4.6 Supports and elements recalculation
In this module the new geometrical parameters of all
supports will be calculated. Then the new geometrical parameters
of the elements of set E will be calculated. The supports
recalculation depends on the reconstruction order obtained by the
previous module, which has a set of relationships associated with
each support in the order. To calculate a support Si the
associated relationship with support are transferred into
equations. The equations are to be solved in the support
parameters.
5. ADDI NG RECONSTRUCTI ON TO AUTOCAD
The whole system is incorporated within AutoCAD package
(ver. 10.0) such that the generation of sketch is done by AutoCAD
and all phases are executed from a menu of AutoCAD. The different
modules are added to AutoCAD in the following way :
1- Put the compiled modules in AutoCAD directory.
2- Put the names and volumes of compiled modules in the
ACAD.PGP file of the AutoCAD package.
3- Make a menu and submenues for the reconstruction process in
the ACAD.MNU file of the AutoCAD package.
4- Now every module becomes one of the external commands of
AutoCAD that can be used from the reconstruction menu in the
package.
Next is the sequence to generate the exact drawing for certain
sketch :
1- Plot the sketch drawing by AutoCAD drawing editor.
2- Transfer drawing file to DXF format by AutoCAD built-in DXF
translator (text file .dxf which will be processed next).
3- Extract geometrical elements and dimensions from DXF file
by command in menu that will put it in tables in output file.
4- Recognize different supports and relations from last file by
command in menu.
5- Obtain Reconstruction order and read initial supports from
last files by command in menu.
6- Calculate the exact supports and elements and generates new
DXF file from last files by command in menu.
7- Redraw the exact drawing by DXFIN command again.
Fig.3 and Fig.4 give an example which is a sketch drawn by
AUTOCAD and reconstructed by the system.
CA-1 481
FIFTH ASAT CONFERENCE
4 - 6 May 1993, CAIRO
6. CONCLUSI ON
This system is initially implemented to reconstruct
mechanical drawings, however it can be applied to solve other
problems. It can also be used alone or with other modules in
different applications.
The reconstruction system is expected to help solving
different problems in the domain of mechanical drawing. For
example, the system can be
used
as an interface module
between different drafting systems, analyzing of dimensioning
problems, checking of mechanical drawings and documentation of
old drawing....etc.
REFERENCES
1. J. Encarnacao E.G.SchlechtendahlC , "Computer Aided
Design", Fundamentals and System Architectures printed in
Germany by springer-verlag Berlin Heidelberg PP10-13, 1983.
2. J. W. FELLOWS , "All About CAD/CAM ", A guide for senior
or mid-level management, printed and bound in Great Britain
in PP24-27, 1983.
3. Robert L. Knight AND William Valaki, with Brenda L. Fouch
CraigW. Sharp Brent Ring,"Using AutoCAD" 2nd Edition
4.
"The AutoCAD Drafting Package",Reference Manual ver 2.18
7 December. 1986,PP367-386.
5. AUTOCAD Manual Rel. 10PP421-429, PP435-441, 1989.
6. Taiichi Yuasa, "Common Lisp Drill", Research Institute for
Mathematical Sciences, kyoto University, KYOTO, JAPAN,
published in 1987, Translated into English by / Richard
Weyhrauch and Yasuko Kitajima, PP3-9, published in 1988.
7., Patrick Hery Winston and Berthold klaus paul,"LISP",
Massachusetts Institute of Technology, copyright 1981 by
Addison-wesley publishing Company, Inc, PP13-33.
8. Soft Wave Lisp
User Manual Version 2.6
9. Cadence Magazine, "Presentation & Animation", PP 170 User
Library, in June 1990.
10.
M. Salah PH.D Thesis, " CAD Mechansque : Verification,
Reconnaissance, Reconstruction", ENSTA, PARIS, 1986.
11.
M. Emera M.Sc Thesis,
An intelligent CAD system for
industrial drawing"
computer department, statistical
institute, cairo university PP14-24, PP45-51, PP83-86,
in 1992.
FIFTH ASAT CONFERENCE
CA-1 482
4 - 6 May 1993, CAIRO
12.
Thomas E. French and Chartes J. Vierck, " A manual of
engineering drawing for students and draftsman", ninth
edition, 1960, Mc Graw-Hill book company, inc.
13. Mostafa Saleh,
Military Technical College,
Cairo,
Egypt, "Evolution of automated machine drawing in the
industry", 12th. International congress for statistics,
computer science, social and demographic research, Cairo,
Egypt march 87.
14. Aly A. Fahmy and Mostafa Saleh, Military Technical College,
Cairo, Egypt, "Towards an intelligent CAD system",thirteen
International congress for statistics, computer science
social and demo graphic research, Cairo, Egypt march 88.
15.
Sturat Watson, Deltacam Ltd., "Relational geometry :
anew generation of two-dimensional CAD", computer aided
engineering journal, vol. 5, number 4, august 1988,
16.
Robert Light and David Gossard,computer aided design lab
oratory, Department of mechanical engineering,Massachusetts
institute technology, MA, USA, "Modification of
geometric models through variational geometry", computer
aided design vol. 14, number 4, July 1982.
17.
Drawing courtesy of Klinger Rise, Franks Straw, Inc.,
Philadelphia, PA, "Drawing interchange files Manual of
AutoCAD ver. 2,53j.
18.
Jack Gjovaag and Robert zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
N. perry, Tektronix, Inc.,
"Drafting as paradigm for the user interface to a
geometric modeler
19.
Sadashiv Adiga, Dept. of industrial and management systems
engineering, Arizona state university, Temp, Arizona 85287
"Artificial intelligent and its relevance to industrial
engineers", Institute of industrial engineers, 1985 annual
international engineering conference proceedings.
20.
Warren J. Luzadder, "Making a sketch", Fundamentals of
engineering drawing, 1967 , fifth edition.
21.
Manual of AutoCAD ver. 9.031.
22.
Roy A. Plastock, Gordon Kalley, "Computer graphics"schaum,
Mc Graw-Hill, USA.
23.
J. W. Fellows, Sigma technical press, UK, " All about
computer-aided design and manufacture, aguid for senior
or mid-level management", copyright 1983
FI FTH ASAT CONFERENCE
CA- 1 483
4 - 6 May 1993,
CAI RO
SKETCH
- SCAN DRAWI NG
( PI XELS)
- CONVERT I T TO
( STROKES)
- REFI NE I T
( DXF)
zyxwvutsrqp
I
SKETCH
*
*
*
*
*
RECOGNI TI ON OF
ELEMENTS
DI MENSI ONS
SUPPORTS
RELATI ONSHI PS
MAPPI NG
SKETCH
- ORDERI NG
- RECALCULATI ON OF
* NEW SUPPORTS
* NEW ELEMENTS
1
EXACT
- PLOTTI NG DRAWI NG
THROUGTH MENU
I N AUTOCAD
EXACT
Fig .i. AU TOM ATED D RAFTI N G PROCESS
FIFTH ASAT CONFERENCE
CA-1 484
4 - 6 May 1993, CAIRO
ED
D
( SKETCH )
ELEM EN TS&
D I M EN SI ON S
I SOLATI ON
M OD ULE 1
M OD ULE 2
I N I TI AL
RELATI ON SH I PS
RECOGN I TI ON
( SKETCH )
SUPPORTS
RECOGN I TI ON
( SKETCH )
ELEM EN TS & SU PPORTS
RELATI ON SH I PS
( SKETCH )
SUPPORTS
ELATI ON
SUPPORTS
SEGM EN TS
ARCS
FI LE
M AP FI LE
M AP FI LE
FI LE
RECON STRUCTI ON
M OD ULE 3
ORD ER
( EX ACT D RAW I N G)
ELATI ON
ORD ER
M OD ULE 4
SUPPORT
RECALCULATI ON
( EX ACT D RAM
ELEM EN TS
RECALCULATI ON
( EX ACT D RAW I N G )
PLOTTI N G
Fi g. 2. SYSTEM PHASES
)
FI FTH ASAT CONFERENCE
CA- 1 485
4 - 6 May 1993,
Fig.3.
CAI RO
sketch drawing
FI FTH ASAT CONFERENCE
CA- 1 486
4 - 6 May 1993,
Fig.4.
exact drawing
CAI RO
zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA