Upload
mostafa-adil
View
216
Download
0
Embed Size (px)
Citation preview
7/25/2019 1st chapter.doc
1/20
Chapter 1 Introduction
Chapter One
1.1 Computer Graphics and Computer Aided Design (CG and CAD)
Graphics are used in many different areas such as industry, education,
physical field, economic for drawing histograms and engineering fields
architecture, mechanical, electrical and mechanical.[1].
A mechanical engineer converts ideas into initial drawing. With the
implementation of computers into academic and industrial institutions,
computer graphics introduced using the computer as a drawing tool.
Generative graphic, image processing and (cognitive) graphics are the maintaonomy of the !G.
Generative graphic involves generation, representation and
manipulation of the graphic o"#ects in a suita"le manner, the related non$
graphic information resides in computer file. %ince !G provide the user with
computer interaction together, the !G is em"edded in to large system such
as !A& system' hence !G has "ecome the primary tool of !A& system [].
t was not until the 1*+ that the !A& system started to appear on the
mar-et. arious types of !A& system currently eist, and they reflect
different stages in its development [/].
0he specification of the geometry of a part or product when held on a
!A& system is -nown as model and the techniue that is used to represent
the model is -nown as geometric modeling. 0here are three types of
conventional geometric modeling techniues used widely in !A& system
namely wire frame, surface modeling and solid modeling.
1
7/25/2019 1st chapter.doc
2/20
Chapter 1 Introduction
Chapter One
1.2 Geometric modeling
Geometric modeling deals with the mathematical representation of
curves, surfaces, and solids necessary in the definition of comple physical
or engineering o"#ects. 0he associated field of computational geometry is
concerned with the development, analysis, and computer implementation of
algorithms encountered in geometric modeling. 0he o"#ect are concerned
within engineering range form the simple mechanical parts (machine
elements) to comple sculptured o"#ect such as ships, automo"iles,
airplanes, tur"ine and propeller "lades, etc.Geometric modeling attempts to provide a complete, flei"le, and
unam"iguous representation of the o"#ect, so that the shape oh the o"#ect can
"e2
$ easily visuali3ed (rendered)
$ easily modified (manipulated)
$ increased in compleity
$ converted to a model that can "e analy3ed computationally
$ manufactured and tested
!omputer graphic is an important tool in this process as visuali3ation
and visual inspection oh the o"#ect are fundamental parts of the design
iteration. !omputer graphics and geometric modeling have evolved
into closely lin-ed field within the last / years, especially after the
introduction of high$resolution graphics wor-station, which are now
pervasive in the engineering environment [4].
7/25/2019 1st chapter.doc
3/20
Chapter 1 Introduction
Chapter One
1.3 Geometric Modeling Forms
&ifferent forms of geometric modeling can "e distinguished "ased on
eactly what is "eing represented, the amount and type of information
directly availa"le without derivation, and what other information can and
cannot "e derived[4].
1.3.1 WireFrame Modelers
n this modeler only the edges of a part geometry are represented
through lines or wires. 0his model is stored in computer as a set of points inorder form the vertices of the part. %ome !A& systems handle only $& wire
frame model where as the others may handle .5$& or over /& modeler.
Wire frame modelers are adeuate for many drafting applications [5].
6igure (1$1) 0he wireframe model of a computer mouse
1.3.2 !ur"ace Modelers
0he information and specification of the polygonal faces enclosed the
edges are employed in this modeling techniue. %hading and hidden surface
/
7/25/2019 1st chapter.doc
4/20
Chapter 1 Introduction
Chapter One
removal is also treated in this -ind of modeling which leads to increase in
the visi"ility of the o"#ect. 0herefore surface modeling is more comple than
wire$frame modeling [5,7], surface modeling using !A& system are widely
used for parts "eing machined where new surfaces are "eing created there
are different types of surfaces[+].
6igure (1$) the parametric surface model of a computer mouse
#$pe o" sur"aces
A%lane !ur"ace
0his is the simplest surface, reuires / non$coincidental points to
define an infinite plane.
0he plane surface can "e used to generate cross sectional views "y
intersecting a surface or solid model with it.
4
7/25/2019 1st chapter.doc
5/20
Chapter 1 Introduction
Chapter One
&'uled (lo"ted) !ur"ace
0his is a linear surface. t interpolates linearly "etween two "oundary
curves that define the surface. 8oundary curves can "e any wire frame
entity. 0he surface is ideal to represent surface that do not have any twists or
-in-s.
C!ur"ace o" 'eolution
0his is aisymmetric surface that can model aisymmetric o"#ects. t
is generated "y rotating a planer wire frame entity in space a"out the ais of
symmetry of a given angle.
5
7/25/2019 1st chapter.doc
6/20
Chapter 1 Introduction
Chapter One
D#aulated !ur"ace
0his is surface generated "y translating a planar curve a given
distance along a specified direction. 0he plane of the curve is perpendicular
to the ais of the generated cylinder.
*&ilinear !ur"ace
0his /$& surface is generated "y interpolation of 4 endpoints. 8i$
linear surfaces are very useful in finite element analysis. A mechanical
structure is dispraised into elements, which are generated "y interpolation 4
node points to form a $& solid element.
7
7/25/2019 1st chapter.doc
7/20
Chapter 1 Introduction
Chapter One
FCoons %atch
!ons patch or surfaces are generated "y the interpolation of 4 edge
curve as shown.
G&!pline !ur"ace
0his is a synthetic surface and dose not passes through all data points.0he surface is capa"le of giving very smooth contour, and can "e reshaped
with local controls.
9athematical derivation of the 8$%pline surface is "eyond the scope of this
course. :nly limited mathematical consideration will give here.
!omputer generated surface play a very important part in manufacturing of
engineering products. A surface generated "y a !A& program provides a
very accurate and smooth surface, which can "e generated "y ;! machine
without any room for misinterpretation. 0herefore, in manufacturing
computer generated surface are preferred. %ince surfaces are mathematical
+
7/25/2019 1st chapter.doc
8/20
Chapter 1 Introduction
Chapter One
models, we can uic-ly find the centroid, surface area, etc. another
advantage of !A& surfaces is that they can "e easily modified.
+&e,ier !ur"ace
7/25/2019 1st chapter.doc
9/20
Chapter 1 Introduction
Chapter One
1.3.3 !olid Modelers
0his is the most powerful tool for representing three > dimensional
o"#ects.
0he o"#ects represented "y the solid model techniue not only have
edges and surface "ut they also include volumetric and mass information.
%ome solid models are represented in computer data"ase of there edges and
vertices of the part and this is called 8$rep. %olis models can also "e created
from solid primitives such as "oes, "loc-s, cylinders, cones and spheres.
0he final part geometric is then created "y performing 8oolean operations
(#oin, intersection and su"traction) on the primitives. 0his form of geometry
is -nown as !%G or !$rep [7, ?]Geometric modeling capa"ilities are an integral part of the !A&
system. nterfacing !A& system with other systems such as !A9 is the
driving force "ehind the development of much of geometric modeling.
@erhaps one of the most fertile applications of geometric modeling is !A9.
*
7/25/2019 1st chapter.doc
10/20
Chapter 1 Introduction
Chapter One
6or eample, geometric modeling ma-es possi"le process planning and
machine tool path$verification systems completely automatic [*]. 0hese
capa"ilities are very important in design and manufacturing of sculptured
surfaces. 0hese surfaces have wide applications in the aircraft and
automo"ile industries [1].
@arametric free form curves and surfaces form as essential part of the
!A& system. %chemes for defining these entities employ a wide range of
mathematical sophistication [11]. epresentation of /$& free$form surfaces
on a computer is one of the most difficult tas-s to "e handles "y the designengineers. nterpolation techniue is used to produce surfaces in $& and
/$& from sampled points data [1].
6igure (1$/) the solid model of a computer mouse
1
7/25/2019 1st chapter.doc
11/20
Chapter 1 Introduction
Chapter One
1.3.3.1 Constructie !olid Geometr$C!G
!onstructive %olid Geometry (!%G) is one of the most popular
representation schemes for solid modeling "ecause it is well understood, and
easy to interface with the user and to chec- for validity.
A !%G model assumes that physical o"#ects can "e created "y
com"ining "asic elementary shapes through specific rules. 0hese "asic
shapes form what are commonly -nown as primitives, which are themselves
valid "ounded !%G models represented "y r$sets. A wide variety of
primitives are availa"le in solid modeling systems, "ut the most commonlyused are "loc-s cylinders cones and spheres as shown in 6igure 1.4, the solid
primitives in the !%G representation are defined mathematically as the
com"ination of un"ounded geometric entities separating the B5space into
infinite portions. 0hese entities are called half>spaces. 0he most commonly
used half$spaces are planar cylindrical spherical and conical and relate to the
natural uadric surfaces.
!%G primitives are represented "y the intersection of a set of half$
spaces. 0he primitive "loc- is formed "y the regulari3ed intersection of si
planar spaces. Bach half$space is epressed "y one limit of three ineualities
forming the primitive. A solid modeler supporting these primitives must "e
a"le to calculate the intersections of the given half$spaces. 9ore details on
the creation of uadric primitives and calculation of uadric intersections.
Cuadric surfaces are commonly used in !%G "ecause they represent
the most commonly used surfaces in mechanical design produced "y the
standard operations of milling turning rolling and so forth. 6or eample,
planar surfaces are o"tained through rolling and milling cylindrical surfaces
11
7/25/2019 1st chapter.doc
12/20
Chapter 1 Introduction
Chapter One
through turning and spherical surfaces through cutting done with a "all$end
cutting tool.
6igure
(1$4)
6rom the userDs point of view and regardless of how the primitive is created
internally "y the system only its location geometric data and orientation data
are needed. 0he location data for each primitive encompasses the
esta"lishment of a local coordinate system and the position of the origin. 0he
geometric and orientation data are usually input "y the user. All primitives
have a default si3e guaranteed "y most modeling system.
0he 8oolean operations union difference intersection descri"ed in this
%ection are used to com"ine the r$sets formed "y the solid primitives 6igure
(1$5) shows an eample of this process.
1
7/25/2019 1st chapter.doc
13/20
Chapter 1 Introduction
Chapter One
2C-/ &OC0!olid1 3C- !OD2
6igure (1$5) 8oolean operations
1.3.3.2 &inar$ #ree
0he !%G is also referred to as method to store a solid model in the
data"ase . 0he resulting solid can "e easily represented "y what is called a
"inary tree . n a "inary tree , the terminal "ranches (leaves) are the various
primitives that are lin-ed together to ma-e the final solid o"#ect (the root).
0he "inary tree is an effective way to represent the steps reuired to
construct the solid model . !omplicated solid models can "e modeled "y
considering the different com"inations of 8oolean operations reuired in the
"inary tree . 0he provides a convenient and intuitive way of modeling that
imitates the manufacturing process . A "inary tree is an effective way to plan
your modeling strategy "efore you start creating anything .
1/
a " c d e
6ig.(1$7) 0he technical illustration pipeline "ased on !%Gprimitives. (a) @rimitive types to "e selected' (") 0he
o"#ect composed from primitives' (c) 0he o"#ect after
hidden surface removal' (d) %patial layout of the o"#ectto "e rendered' (e) 0he resultant illustration
7/25/2019 1st chapter.doc
14/20
Chapter 1 Introduction
Chapter One
1.3.3.3 C!G &oolean operations
CSG shapes can be combined by one of Following Boolean
operations to dene a more complex
CSG shape:
=nion. The resulting shape consists of all regions either
in the rst in the second or in both input Shapes.
ntersection. The resulting shape is the region Common to
both input shapes.
%u"traction. The resulting shape is the region of the rst
shape reduced by the region of the second.
6igure (1$+). 9odeling a dice using !%G. A cu"e and a sphere are
intersected' from the result the dots of the dice are su"tracted.
14
7/25/2019 1st chapter.doc
15/20
Chapter 1 Introduction
Chapter One
1. Fundamentals o" Computer Graphics 4sing MA#A&
9A0EA8 [1/] is a powerful environment for linear alge"ra with graphical
presentation [14], and is availa"le on a wide range of computer platforms.
=nli-e a general$purpose language, 9A0EA8 development goes much
faster and code is dramatically shorter. n some regards, it is a higher
language than most common programming languages li-e ! or 6:0A;.
9A0EA8 is therefore a great computation environment for learning the
fundamentals of computer graphics. 9any 9A0EA8 files have "een
developed in the pastfew years "y the author and his students to help effectively presenting -ey
concepts and visuali3ing these mathematical epressions.
9ost tet"oo-s [15] covering these graphics su"#ects are primarily written
for computer science ma#ors. Algorithms to implement these concepts are
efficient "ut difficult to "e programmed in the conventional programming
languages that engineering students are familiar with. 9any engineering
students feel the comple mathematical epressions and programs hinder the
learning of these concepts.
ntroduction of computer graphics addresses , among other topics,
parametric curves and surfaces, including 8$spine and 8e3ier curves. 0hese
su"#ects applied to the design of airfoils, auto "odies and ship hulls, as well
as to commercial advertising and movie ma-ing. Without good
understanding of these graphics fundamentals, !A& users can not
effectively use associated tools.
15
7/25/2019 1st chapter.doc
16/20
Chapter 1 Introduction
Chapter One
Graphics 4sing MA#A&
1. 2D Graphic
(1). plot
$& line plot.
!$nta5
plot(F)
plot(1,F1,...)
Description6
plot(F) plots the columns of F versus their inde if F is a real num"er. f F
is comple, plot(F) is euivalent to plot(real(F),image(F)). n all other uses
of plot, the imaginary component is ignored. @lot(1, F1,...) plots all lines
defined "y n versus Fn pairs. f only n or Fn is a matri, the vector is
plotted versus the rows or columns of the matri, depending on whether the
vectorHs row or column dimension matches the matri. f n is a scalar and
Fn is a vector, disconnected line o"#ects are created and plotted as discrete
points vertically at n.
Bample2
graphic.m
17
7/25/2019 1st chapter.doc
17/20
Chapter 1 Introduction
Chapter One
x!linspace"# $%pi #'(
plot"x sin"x' )c) x cos"x' )g)'( *+c++g+ means the color of
the line.
xlabel"),nput -alue)'( * the name of axis
ylabel")Function -alue)'( * the name of / axis
title")Two Trigonometric Functions)'( * the title of the graphic
legend")y ! sin"x'))y ! cos"x')'( * annotation
grid on( * open the grid
'esults6 Figure 1
(2). !uplot
!reate aes in tiled positions.
!$nta5
su"plot(m,n,p)
su"plot(mnp)
Description6
%u"plot divides the current figure into rectangular panes that are num"ered
rowwise. Bach pane contains an aes o"#ect. %u"seuent plots are output to
the current pane.
%u"plot(m,n,p) or su"plot(mnp) "rea-s the figure window into an m$"y$n
matri of small aes, selects the pth aes o"#ect for the current plot, and
returns the aes handle. 0he aes are counted along the top row of
the figure window, then the second row, etc.
*5maple6
graphic.m
subplot"$$&'( plot"x sin"x''(
1+
7/25/2019 1st chapter.doc
18/20
Chapter 1 Introduction
Chapter One
subplot"$$$'( plot"x cos"x''(
subplot"$$0'( plot"x sinh"x''(
subplot"$$1'( plot"x cosh"x''(
6igure (1$?)2 result of graphic1.m 6igure(1$*)2 result of graphic.m
2. 3D Graphic
(1) plot3
/$& line plot.
!$nta5
plot/(1,F1,I1,...)
Description
0he plot/ function displays a three$dimensional plot of a set of data points.
plot/(1,F1,I1,...), where 1, F1, I1 are vectors or matrices, plots one or
more lines in three$dimensional space through the points whose coordinates
are the elements of 1, F1, and I1.
*5maple6
graphic/.m
x!20:#.3:0(
y!20:#.3:0(
1?
7/25/2019 1st chapter.doc
19/20
Chapter 1 Introduction
Chapter One
45-6!meshgrid"xy'(
7!25.819-.8125.8$2-.8$2$%5%-(
mesh"7'(
xlabel")x)'(
ylabel")y)'(
label"))'(
esult2 6igure (1$*)
6igure(1$1)2 result of graphic/.m
(2). mesh sur" sur"c sur"l
9esh2 !reate mesh plot
%urf2 !reate /$& shaded surface plot
%urfl2 %urface plot with colormap$"ased lighting
%urfc2 !reate /$& shaded surface plot with contour plot
*5ample6graphic4.m
x! 2&.3:#.$:&.3(y!2&:#.$:&(
4/6!meshgrid"xy'(
p!s;rt"12.8$
7/25/2019 1st chapter.doc
20/20
Chapter 1 Introduction
Chapter One
subplot"$$&'(mesh"p'(legend")>?S@)'(
subplot"$$$'(surf"p'(legend")S5AF)'(
subplot"$$0'(surfc"p'(legend")S5AFC)'(
subplot"$$1'(sur"p'(legend")S5AF)'(
'esults 6 Figure(117)
6igure (1$11)2 result of graphic4.m