0% found this document useful (0 votes)
9 views26 pages

CASDLectureNotes 3

The document provides an overview of computer-aided design (CAD) basics, including digital data management, design concepts, and CAD applications structure. It discusses the importance of digital formats, user interfaces, modeling spaces, and data structures, as well as the various drawing entities and actions involved in 2D drawing. Additionally, it highlights the use of layers, symbols, attributes, and reference files in CAD systems, emphasizing their role in efficient design and modeling processes.

Uploaded by

eberber05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views26 pages

CASDLectureNotes 3

The document provides an overview of computer-aided design (CAD) basics, including digital data management, design concepts, and CAD applications structure. It discusses the importance of digital formats, user interfaces, modeling spaces, and data structures, as well as the various drawing entities and actions involved in 2D drawing. Additionally, it highlights the use of layers, symbols, attributes, and reference files in CAD systems, emphasizing their role in efficient design and modeling processes.

Uploaded by

eberber05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

COMPUTER AIDED SHIP DESIGN LECTURE NOTES

3. CAD BASICS
3.1. Digital Data
The word digital derives from a latin word digits, originally meaning fingers, better understood meaning
numbers. "Something which can be described with numbers" is digital. Human beings tend to
understand a common 10-based number system easily, whereas computers are basically based on
binary number system (2-based) where only two digits 0 and 1 are used.

Any information in digital format could be called data. In other words, digital means that "information
can be managed and manipulated with a computer". The essential basic concepts in digital data
management are:

file "container" for digital information


directory hierarchical "folders" to organize files in any reasonable order.

Whenever manipulating with digital information, one finds out that the information can exist in several
"data formats", types of data, which in fact usually cannot be translated to each other easily. In practise
this means that computer programs generally are designed to operate with certain type of data. The
most common data formats or types are:

 alphanumeric information - data which can be described with letters (a b c A B), numbers (0 1 2
3 ) or special characters (+ - / * &)
 graphical information
 vector graphics - line-based graphics, typically CAD, basic element is a vector ("a line")
 raster graphics - pixel-based graphics, for instance scanned images, basic element is a pixel
("a point"), the basic entity in an image
 other information in digital format, for instance music

3.2. Design, Drawing, Modeling

Design is again a common concept describing creative work, i.e. describing or inventing something
new. In the areas of engineering and especially concerning the construction field, the design often
includes a strong flavor of working with graphical information, i.e. drawing. Drawing is often
understood to be so essential to design, that those two concepts cannot be described without each
other. Hence, drawing can be described "a creative design tool", or drawing from a more technical
aspects meaning copying another drawing.

Modeling is within CAD understood to be working with "geometric objects in 3-dimensional space".
CAD-work is more accurately often geometric modeling, whereas "modeling" could in general best be
understood together with design - it is the imaginary [non-existing] objective or target of a design
process. Different "traditional" modeling examples besides geometric modeling, are physical models,
functional and process models or mathematical models (describing climatical changes).

3.3. CAD Applications Structure


To be usually rather complicated and large, CAD-software consists often of several programs and sub-
programs located in a system specific file structure. It also usually requires skilful installation, to make
the CAD-systems work. A CAD-software often consists of both

 general and basic parts (such as elementary drawing routines, etc.) which often can be bought
off-shelf
 application area specific features (programmed features, symbol libraries etc.) which in fact are
the core of the application, sometimes called 3rd party software

3.3.1. User Interfaces


The user interface is understood to include all the possible tools and methods the user can use in
communicating and controlling a CAD-system. Important parts of a CAD-hardware are the monitor,
the keyboard and a pointing device plus an output device, a printer.

3.1
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Typical features for CAD-software interface are the numerous windows, subwindows and menus
on the screen. The user typically gives commands to a CAD-application from the menus or with the
keyboard, keyboard being a quick way for the advanced user, and also because exact coordinate- and
numerical information is typical to precise CAD-work.

CAD-applications' interfaces can often be customized to meet the users needs. A proper CAD-
interface should be logical, straightforward and rational – although clumsy interfaces can also be
operated effectively.

Figure 3.1. A typical CAD-screen includes several windows, menus and tools for separate tasks.

3.3.2. Modeling space


The working area in CAD-applications can be called modeling space, and it can for instance be a flat
drawing (2D) or 3-dimensional space.

Essential to the modeling space is the coordinate system, if in 2D usually XY-based, Z-coordinate in
3D-systems usually defines "the height". The coordinate origin is a point either in 2D or in 3D where all
the coordinate values are zero.

Figure 3.2. Typical 3-axial coordinate system. X and Y define a planar drawing surface (plan-drawing)
and Z-coordinate usually defines "the height" of the elements.

In CAD coordinates can be given by pointing (currently usually with a mouse), referring to

 a grid-system - a user defined raster of snapping points (depending on the model space and
working accuracy, say 100 by 100 mm, or 50 by 50 mm)
 snapping to existing elements - such as other lines, corner points, line centers, etc.

The concept of scale is - perhaps surprisingly - usually not so essential in CAD-work. The coordinate
units are often defined in the beginning of the work (choose for example 1 mm or 1 m), and all the
coordinate values are real after that. The scale is used in printing the documents, since it has to be
defined to fit the model space to the paper.

In working the two methods of absolute or relative coordinates are important - absolute refers to the
model space origin, and relative usually to the last active coordinate point.

3.2
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

3.3.3. Windows and Projections


A window gives the user a viewpoint to the CAD-model. A window is a mathematically defined
projection to the model space and it usually can be:

 Parallel projection (plan, facade or axonometric)


 Conic projection (perspective)

Figure 3.3. 2D-plan view, 2D-facade view and a 3D- perspective projection to a model space.

Since a monitor is rather small compared to the model space, moving in the windows is a typical task
in CAD, and it can usually by panning (moving sideways) and zooming in or out of the current window
scale

Figure 3.4. Pan and zoom allow the user to move the active window to the model space.

3.4. Data Structures in CAD

3.4.1. Basic primitives - drawing and modeling elements


The constructing of a CAD-model is done with the basic modeling primitives which are sometimes
called entities or modeling elements or objects,. Typical elementary CAD-primitives are:

 2D-drawing - points, lines, polylines, circles, arcs, etc...


 3D-geometric modeling - 3D-lines, volumic boxes (parallel-piped), cylinders, cones, etc...
 Object oriented CAD - "real" design entities, such as building walls, windows and slabs, etc...

Figure 3.5. Basic primitives vary in 2D-CAD-drawing, 3D-CAD-modeling and object-oriented modeling.

3.3
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

The basic primitives' outlook in CAD-applications characterized by primitives' properties, of which


linetype, color and layer are the most common. Linetype and color are typical visual properties, which
determine how the primitives appear on the screen and on the final output (usually on the paper).

3.4.2. Layers
Layers are one of the most important methods in structuring CAD-primitives and material. They are just
like thin overhead films layered on top of each other. A layer can be set to visible or invisible (in some
systems also other possibilities), hence it controls whether an element is visible on the screen and in
the output. The amount and naming of layers depends of the user. Theoretically all different elements
could be put into separate layers, but in practise just some, in ship design perhaps several different
layers are used.

Figure 3.6. Example of layers in building design.

3.4.3. Symbols and Symbol Libraries


CAD-symbols are "pre-fabricated" components, which are created from the elementary entities. In 2D-
drawing symbols are created from lines, arches and texts, for instance. A symbol is a group - an
independent entity, which can be moved and deleted as a single primitive. In AutoCAD, the most used
CAD-application, symbols are called "blocks".

Figure 3.7. A door-symbol is created from a bunch of lines, a box-element, an arc and a text element.

Figure 3.8. Using pre-defined door-symbols from a symbol library in constructing a building plan.

3.4
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

3.4.4. Attributes
An attribute is alphanumeric information connected to graphic primitives, defined by the user. Attributes
are one remarkable key to efficient and "intelligent" CAD-applications, and attributes usually contain
very essential design information. Attributes can for instance be asked from the user, or they can be
derived automatically from graphics, or they can also be calculated from graphical information.

Figure 3.9. Three attributes are linked to a graphic polyline-primitive. The user writes room number
and name. The floor-area-attribute's data will be derived automatically from the graphics, with a
calculation algorithm from polyline's length.

The use of so-called parameterized symbols is a kind of combination of symbols and attributes. A
symbol instance in the drawing is dependent of the attributes the user defines during the creation.

Figure 3.10. A parameterized door symbol. On creation, the user gives the door type, width, and
height. An instance of this kind is then created to the drawing with the given parameters, some
automatically calculated. In the drawings 2D-floor plan symbol only width, wall thickness and type are
needed.

Drawing automation can be done efficiently with parameterized symbols. With just one parameterized
door-symbols, the user can create several different kind of doors to the drawing, if the parameters are
chosen wise.

3.4.5. Reference files


A reference file (a reference drawing) is a method to link CAD-files together to form logical structures
to resemble reality. With reference files CAD-drawings and CAD-models can also be refreshed
automatically, since changes to the original files causes visible changes to all of the file combinations
the originals are used in.

Figure 3.11. With reference file technique the red final output document on the paper consists of
drawing frames, but also material from two other drawing files, the green site plan and the blue building
plan, which is used twice in the output drawing.

3.5
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

The use of reference files is efficient, since it reduces the need to copy drawing parts into other
drawings. It can also make the active working files smaller, because some of the visible information
can also locate in other files. The referred files cannot be altered via the visible links, but they have to
be opened from the original files. The use of reference files is also currently used in normal office tools
like writing and calculating (called DDL- and OLE-linking in Microsoft-applications).

3.4.6. File structure


The CAD-model - or more precisely - a CAD-drawing file often contains elements physically located in
other files, such as symbols and reference files. Hence, the CAD-file structure usually is more
complicated than, for instance in word processing.

Figure 3.12. A typical file structure of a CAD-system.

3.5. Drawing in 2D
Despite CAD-systems are divided into 2D-drawing and 3D-modelling systems, most commercial CAD-
systems include both 2D and 2D-features. Both features are also used simultaneously in practical
CAD-work.

3.5.1. 2D Drawing Entities


Typical basic drawing primitives in CAD-drawing are for instance:

 Line and polyline


 Circle, and other entities derived from it: arc and ellipse
 Text entity - a box containing editable text
 Hatchings and rasterized areas
 Measures and dimensions
 Symbols and attributes.

A polyline is a primitive, which consist of several line-elements. In some applications a polyline-


primitive can also contain other kinds of parts too, for instance arcs.

Figure 3.13. Typical 2D-drawing entities found in most CAD-systems.

3.6
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Figure 3.14. Lines and polylines. Despite vectors, a polyline-primitive can in some CAD-systems
contain also other primitives, such as arcs. On the right examples of different line widths, linetypes and
line colors, which are in CAD-systems usually, defined with lines attributes.

3.5.2. Drawing Actions


Drawing is often started either from roughly similar kind of existing drawing files, or from empty drawing
templates - files which already include all the required layer-combinations, linetypes and colors and
possibly proper drawing grids created. In starting to draw with CAD, the first thing to do is to create
some of the most essential graphic primitives. It is often started from the most essential baselines or
modular grids for the drawing.

Figure 3.15. A CAD- template can include drawing boundaries and some common text elements. The
modular grid lines and essential graphical aids are also created in the beginning.

Very essential to CAD-drawing activity is the possibility to modify existing entities - elements are easily
created and reused and modified later. Typical modifying actions (transformations) in CAD-systems
are:

 Move (drag)
 Rotate
 Scale

Figure 3.16. Moving and rotating a door primitive - a door symbol.

Since deleting is quick in CAD, a common drawing method is to create a lot of supplying drawing
elements - such as helping lines and points - during the process, and finally delete the unnecessary
ones in the end. The unnecessary elements can also be stored to invisible layers, which are not shown
in the final drawings.

In creating a drawing, copying primitives is usually very quick. Hence, it is often used in CAD to
produce drawings efficiently. In practise this leads to copying not only primitives but also larger drawing
sections from other existing documents. Another typical CAD-method is the efficient use of symbols,
since large amounts of symbols can quickly be altered by simple actions.

3.7
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Figure 3.17. In the beginning of the work, the most essential reference points and lines are created.

3.5.3. Layers in 2D
Typical layers in drawing production in ship design could be for instance:

 Drawing frame and texts


 Modular grid
 Hull form
 Frames and other structural elements
 General arrangement
 Pipes
 Cables

If so called "integrated use of CAD" is concerned, data from different authors (naval architect,
constructional engineer and HVAC-specialists) is usually separated with layers - certain layers are
created by certain authors.

Figure 3.18. CAD-systems layers are often emphasized with color. In the figure different color means
different layer.

3.5.4. Drawing scale, Measuring and Dimensioning, Coordinates


Working in CAD is usually done in real scale: 1 / 1, whereas in so called "traditional design" work and
drawing very often happens in certain drawing scales (1 / 20, 1 / 50, 1 / 100, 1 / 200, ...). Scales are
mainly used in CAD-environment in printing documents to the paper from the "real scale" CAD-model.

There are usually several methods to define exact dimensions or to draw precisely in CAD:

 Reference grids quide the cursor movement so that grid points are the only accessible points (for
instance 50 by 50 mm, or 1 by 1 millimeter)
 Snap to existing primitives to their corners or endpoints (snap, object snap)
 Key in exact numbers from a keyboard

3.8
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Figure 3.19. Snap-features in CAD-systems allow precise drawing. When the cursor is close enough
to a "magnetic" snapping point, it is connected exactly to the point. For instance lines end- and
midpoints are typical snapping points.

In practical CAD-work the two methods of using coordinates - absolute and relative - are important.
Absolute coordinates refer to the model space origin, and relative usually refers to the last active
coordinate point.

Figure 3.20. Examples of absolute (left) and relative (right) use of coordinates.

Absolute coordinates (XY or XYZ) and measures can for instance in AutoCAD be given separated by a
comma:

 3000,5000,0 (refers to an absolute drawing location measured from the origin)

In AutoCAD relative coordinates are marked with at-sign:

 @ 3000,0,0 (refers to a relative drawing location along x-axis 3000 mm from the last point)

Despite the axial coordinate systems, CAD-systems often support also polar coordinates, which define
locations with a dimension and an angle:

 @ 500 < 45 (in some systems d = dimension and a = angle)

 The zero angle in polar coordinates points usually to the right, 90 degrees upwards, etc.

Figure 3.21. Polar coordinates are measured with an angle and a distance.

3.9
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Dimensioning with CAD is usually done automatically or better semi-automatically. All the created
primitives in CAD already have exact dimensions, due to the nature of CAD. Hence the created
drawing also has all the dimensions existing - it is often just a question of marking them down to the
document.

Figure 3.22. A dimension primitive can be connected to a polyline primitive. When the polyline is
changed, also the dimensions are changed automatically.

3.5.5. Digital Output - File Exchange


The shift to digital design often brings also new problems in digital file exchange, since the file formats
different CAD-systems use are not always compatible to each other. The key issue is the fact, that
information is always lost when delivered between different applications, because other systems can
usually not understand all special features of other systems. If system or application specific features
are used in design, that information cannot usually be sent to others easily.

The most common so called "de facto" file exchange standards among different CAD-systems are
DWG and DXF, which in fact are AutoCAD's file formats. DWG is an AutoCAD drawing, DXF (data
exchange file) is a neutral and general file exchange format developed by AutoDesk. One dilemma in
using these "standards" is the fact that AutoDesk alters them slightly version by version.

Figure 3.23. File exchange. CAD-systems usually allow saving in several file formats

3.6. CAD-tools in 3D-modeling

3.6.1. Geometrical Modeling Methods


The objective of 3-dimensional modeling is different than in drawing production: it is often to describe,
analyze or visualize 3-dimensional space. It usually takes more time to describe spatial primitives than
to describe 2D-drawing projections of it, since all spatial details have to be described. The design area
is often modeled just partly in 3D-model, since the whole design target in 3D could include just too
much work. A 3D-model is quite often created from 2D-material - existing drawing files, which are
completed and detailed more to form a 3D-model.

3.10
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Figure 3.24. The difference between 2D and 3D. 2D-drawing produces lines. 3D-modeling produces
spatial elements.

3.6.2. 3D modeling primitives


The basic idea for 3D modeling is the evolution of graphic primitives. It is based on the element series:
point - line - face - volume. Mainly lines and points are used in 2D drawing and mainly 3D-faces and
elements, which have spatial volume, are used in modeling.

Figure 3.25. Spatial elements: point - line (1 dimension) - face (2 dimensions) - volume (3 dimensions)

The most used 3D-modeling methods in PC-environment are surface modeling and solid volume
modeling. Although the primitives may look exactly similar on the screen, there lie essential differences
in the modeling methods. A volume model consists of 3D-primitives, which usually have spatial
properties (mass, center of mass, etc.). Surface model principles consist of "paper thin envelopes".

Typically solid volume modeling applications are used in engineering areas, where it is important to
analyze the volumes, the importance is both the primitives interior and exterior. Surface modeling
methods are typical for the areas where just elements exterior is in focus, such as in hull form
visualization. Typical 3D-elements (primitives) in modeling applications are:

 3D-lines and polylines


 Surface- or face-elements, also more complex "terrain-like" surfaces which consist of several
smaller faces
 Rectangular solid elements, boxes, etc.
 Mathematically simple primitives, such as cylinders, cones, pyramids, spheres, etc.
 Typical solid volume modeling elements can also be created by mathematical actions: rotate and
sweep.

Figure 3.26. Solid 3D-element created with a 360 degrees rotation around a center axis. Another
created with a sweep of a 2D-face along a transition vector.

3.11
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Boolean operations are also typical to solid modeling. More complex primitives can be constructed
from several basic elements with a couple of typical Boolean operations:

 Union of elements
 Subtract an element from another - intersection
 Intersection of several elements
 Slice an element with a planar element

Figure 3.27. Examples of typical Boolean operations. Two volume primitives (far left) combined to
form a union element. Intersection of the elements results when an element is subtracted from
another. Far right the union element cut with a planar element.

3.6.3. Windows and Projections in 3D


Axonometric 3D-projections are called parallel projections, since all the parallel lines are parallel also in
drawings. Perspective projections are called conic projections, 2 or 3 vanishing points to parallel lines.
Perspective projections are "more real" to the viewer, whereas axonometric views tend to be good
working projections, since the axis can be measured.

Figure 3.28. Axonometric parallel projection and conic perspective projection methods shown both in
plan drawing and projected screen.

To create 3D-projections requires somewhat more information than 2D-views. The viewer looks the
model via a sight line, which is often defined with:

 Viewers location - where he is standing


 Target point - where he is looking at
 Viewing angle

3.6.4. Rendering 3D-images


In visualizing and rendering, a CAD-system such as AutoCAD, is usually used first in building and
constructing the model. The textures, materials and other visual properties are then added to the
model - usually in specific rendering and visualization software, such as 3D-Studio. In high quality

3.12
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

rendering, usually more powerful machines than common PCs are used, since realistic rendering of
large images requires a lot of computing power.

Figure 3.29. The process of 3D-modeling. 1) Build the 3D-model. 2) Add the colors and other
environmental attributes. 3) Render the image or an animation.

The 3D-images can usually be rendered with several rendering methods. Common 3D-image types
are:

 Wire frame images - quick to produce, but sometimes messy to understand, especially in large
models
 Hidden line images - just visible edges of surfaces are shown, usually no colors
 Shaded images - visible surfaces colored with "flat colors"
 Rendered images - can include several possible "reality effects", suchs as materials, textures,
shadows, etc.

A wireframe image --- A hidden line image --- A shaded image --- A rendered image

Figure 3.30. Different 3D-images produced from a single model.

In shaded images the colour looks "flat" if no environmental attributes are defined. In most visualizing
software several environmental attributes define how the model primitives finally appear in rendered
images. Lights are typical environmental attributes. In most modelling software a light element is a
modelling primitive. In visualizing with 3D-software, the colour of a modelling primitive is an essential
attribute. Other attributes that affect the primitives appearance in rendered images, are for instance:

 Transparency
 Highlights
 Shining and glowing
 Surface texture (texture mapping)
 Surface structure (bump mapping)

3.13
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Figure 3.31. Attributes that affect modeling primitives appearance define the final look.

The surface texture is often defined with so called texture mapping - a method to attach a scanned
image into the primitive surface. In some systems the surface structure can also be defined with bump
mapping.

Figure 3.32. Texture mapping is a method to add pixel images into model surfaces.

Current 3D-modeling applications allow the user to create single images but also animations from 3D-
models. Since an animation usually consists of several rendered images - a sequence of rendered
images - animations usually require even more disk capacity, computing power - and after all a lot of
time to produce.

3.7. Object Transformation

The principal types of object transformation are translation, or linear movement, rotation and
scaling. With standard co-ordinates, translation is a matrix addition operation, whereas rotation and
scaling are matrix multiplications. Homogeneous co-ordinates are used to allow all three types of
transformation to be treated in a consistent way (as matrix multiplications), so that they can be
combined easily.

3.7.1. Two Dimensional Transformations

a) Transformation of Points

The coordinates of a point P(x,y) can be transformed as follows:

a b 
XT   x y   ax  cy bx  dy
c d 
a b 
 
Where T    is the transformation matrix
c d 

Consider the following cases

 A scale change in the x component of the position vector


a 0 
b  c  0, d  1 x y    ax y
 0 1 

 A scaling of both the x and y coordinates of the original position vector P


a 0 
bc0 x y    ax dy 
0 d 

 A reflection through the y axis

3.14
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

 1 0
b  c  0, d  1, a  1 x y    x y
 0 1

 A reflection through the x axis


1 0 
b  c  0, d  1, a  1 x y   x  y
0  1

b) Transformation of Straight Lines

Consider a straight line between two points A and B in a two dimensional plane. The position vectors of
       
points A and B are A  x 1 y 1 and B  x 2 y 2 or the straight line is defined by the following
matrix

L  
x1 y1 
x 2 y 2 
Let the transformation matrix is defined by

T   
ba

c d 
Then the transformed straight line is
y 1  a b  ax 1  cy 1 bx 1  dy1 
LT  
x1

x 2 y 2  c d  ax 2  cy 2 bx 2  dy 2 

Example 3.1. Consider the following line and find the coordinates of this line reflected through the y
axis

L  
0 1

2 3
Solution

0 1   1 0   0 1 
LT      
2 3  0 1  2 3

ORIGINAL LINE TRANS MATRIX REFLECTED LINE


X Y X Y X Y
0 1 -1 0 0 1
2 3 0 1 -2 3

2 ORIGINAL
REFLECTED

0
-3 -2 -1 0 1 2 3

3.15
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Example 3.2. Consider the following line and find the coordinates of a new line scaled by 2 in the x
direction and by 3 in the y direction

L  
0 1

2 3
Solution

LT   
0 1  2 0   0 3 
  
2 3 0 3 4 9

5
ORIGINAL
4 NEW

0
0 1 2 3 4

c) Rotation of Points

cos sin  
Transformation matrix for a  0 rotation about the origin is T    
 sin  cos 

T   
0 1
Transformation matrix for a 900 rotation about the origin is 
 1 0
1
T   
0
 1
Transformation matrix for a 1800 rotation about the origin is
0
0  1
Transformation matrix for a 2700 rotation about the origin is T    
1 0 
Example 3.3. Consider the plane triangle ABC defined by

3  1
ABC   4 1 
2 1 

The triangle is rotated through 900 about the origin in a counter clockwise sense

3.16
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

3  1  1 3
 4 1   0 1     1 4
    1 0  
2 1    
  1 2 

2
ORIGINAL
NEW
1

0
-2 -1 0 1 2 3 4 5

-1

-2

Example 3.4. Rotate the triangle defined by A(1,1), B(3,1), C(2,4) around the origin by 180 degrees.

T   
cos180 sin180 
cos180
Transformation matrix
 sin180

1 1 
Triangle matrix ABC   3 1
2 4

Rotation

1 1   1  1
1
ABC   ABC T  3 1 
0 
   3  1
*

 1
2 4 
0 5
y
 2  4
4

A
3

1
B C

-5 -4 -3 -2 -1 1 2 3 4 5
B* A* x
-1

-2

-3
C*
3.17
-4

-5
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

d) Rotation about an Arbitrary Point


In general, a rotation about an arbitrary point can be accomplished by first translating the point to the
origin, performing the required rotation, and then translating the result back to the original centre of
rotation. Thus, rotation of the position vector [ x y 1 ] about the point (m,n) through and arbitrary
angle, , can be accomplished by

 1 0 0  cos  sin  0  1 0 0

x y 1  0 1 0  sin  cos  0  0 1 0
 
 m  n 1  0 0 1 m n 1

By carrying out the two interior matrix products we can write

 cos  sin  0
x y 1   sin  cos  0
 m(cos   1)  n sin   n (cos   1)  m sin  1

Example 3.5. Consider the triangle ABC with corner coordinates A(1,3), B(3,9), C(5,3). This triangle is
to be rotated by 1800 about its centroid.

First we find the coordinates of the centroid

x1  x 2  x 3 y1  y 2  y 3
xm   3, ym  5
3 3

1 0 0
First the triangle is translated to the origin
0 1 0

 3 5 1
 1 0 0
The rotation matrix is
0 1 0

 0 0 1

1 0 0
Finally the triangle is translated to its original position
0 1 0 
 
3 5 1
Therefore the required transformation matrix is

1 0 0  1 0 0 1 0 0   1 0 0
x y 1  0 1 0  0  1 0 0 1
 0 Or x y 1  0  1 0
 3  5 1  0 0 1 3 5 1  6 10 1
1 3 1

The triangle is defined by the matrix ABC   3 9 1

5 3 1
The transformed triangle is defined as

3.18
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

1 3 1  1 0 0 5 7 1
ABC   ABC T  3 9 1  0  1 0  3 1 1
*

5 3 1  6 10 1 1 7 1

B
9

C* A*
7

5
y
4

3 A C

1
B*

-2 -1 1 2 3 4 5 6
x
-1

-2

e) Scaling

The transformation matrix for scaling is defined as follows

T   
0n

0 m

Where n and m are the scaling factors in the x and y directions, respectively.

Example 3.6. Consider a square defined by the corner points A(1, 1), B(2, 1), C(2, 2) and D(1, 2).
Find the coordinates of a new square after a 2 times uniform scaling in both directions.

A 1 1 2 2 A 
B 2 
1 2 0 4 2 B

C 2 2 0 2 4 4 C 
   
D 1 2 2 4 D 

D C

D C A B

A B

3.19
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Example 3.7. Consider a square defined by A(1, 0), B(2, 0), C(2, 1), D(1,1) and apply the nonuniform
2 0
scaling  
0 3
A 1 0 2 0 A 
B 2 0 2 0 4
 0 B

C 2 1 0 3 4 3 C 
   
D 1 1 2 3 D 

y y

D C

D C

x x
A B A B

3.7.2. Three Dimensional Transformations

A point in three dimensional space is represented by a four dimensional position vector

x  y  z  h   x y z 1T 

Where [T] is the generalized transformation matrix


a b c p 
d e f q 
T   
g i j r 
 
l m n s

a) Three Dimensional Scaling

a 0 0 0
0 b 0 0
XT  x y z 1   ax by cz 1
0 0 c 0
 
0 0 0 1

x  y  z  1  ax by cz 1

3.20
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Example 3.8. Consider the rectangular parallelepiped (RPP) with homogeneous position vectors

0 0 2 1
3 0 2 1

3 5 2 1
 
0 5 2 1
X   
0 0 1 1
 
3 0 1 1
3 5 1 1
 
0 5 1 1

Locally scaling the RPP to yield a unit cube requires scale factors of 1/3, 1/5 and 1 along the x,y,z
axes, respectively

1 / 3 0 0 0
 0 1/ 5 0 0
T  
 0 0 1 0
 
 0 0 0 1

The resulting cube has homogeneous position vectors


0 0 2 1 0 0 2 1
3 0 2 1 1 0 2 1
 
3 5 2 1 1 / 3 0 0 0  1 1 2 1
   
0 5 2 1  0 1 / 5 0 0 0 1 2 1
X   X T    
0 0 1 1  0 0 1 0  0 0 1 1
    
3 0 1 1  0 0 0 1  1 0 1 1
3 5 1 1 1 1 1 1
   
0 5 1 1 0 1 1 1
y

z
(a) (b)

Overall uniform scaling is obtained by using the fourth diagonal element.

3.21
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Example 3.9. Uniformly scaling the unit cube by a factor of 3 requires the following transformation:

1 0 0 0 1 0 0 0 
0 1 0 0 0 1 0 0 
T   
0 0 1 0  0 0 1 0 
   
0 0 0 s  0 0 0 1 / 3

0 0 2 1 0 0 2 1 / 3 0 0 6 1
1 0 2 1 1 
0 2 1 / 3 3 0 6 1
  
1 1 2 1 1 0 0 0  1 1 2 1/ 3  3 3 6 1
     
1 2 1 0 0  0
 
X  X T   
*
0
0
0 1 1 0
1 0
0 1

0  0
1 2 1 / 3
0 1 1 / 3
or X   
0
0 3 6 1
0 3 1
      
1 0 1 1 0 0 0 1 / 3 1 0 1 1 / 3 3 0 3 1
1 1 1 1 1 1 1 1 / 3 3 3 3 1
     
0 1 1 1 0 1 1 1 / 3 0 3 3 1

The same effect can be obtained by means of equal local scaling.

1 / s 0 0 0
 0 1/ s 0 0
T   
 0 0 1/ s 0
 
 0 0 0 1

3.22
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

b) Three Dimensional Rotation

Three dimensional rotation matrix about x axis by θ degrees:

1 0 0 0
0 cos  sin  0
T    
0  sin  cos  0
 
0 0 0 1

Three dimensional rotation matrix about y axis by  degrees:

cos  0  sin  0
 0 1 0 0
T   
 sin  0 cos  0
 
 0 0 0 1

Three dimensional rotation matrix about z axis by ψ degrees:

 cos  sin  0 0
 sin  cos  0 0
T  
 0 0 1 0
 
 0 0 0 1

Example 3.10. Consider the rectangular parallelepiped define below and rotate about x axis by θ=900

0 0 2 1 A 
3 0 2 1  B 

3 5 2 1  C 
   
0 5 2 1  D 
X    
0 0 0 1  E 
   
3 0 0 1  F 
3 5 0 1 G 
   
0 5 0 1 H 
The rotation matrix is

1 0 0 0 1 0 0 0
0 cos 90 sin 90 0 0 0 1 0
T   
0  sin 90 cos 90 0 0  1 0 0
   
0 0 0 1  0 0 0 1

Then the result of rotation is

3.23
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

0  2 0 1 A 
3  2 0 1  B  

3  2 5 1  C  
   
0  2 5 1  D 
X   X T    
0 0 0 1  E  
   
3 0 0 1  F  
3 0 5 1 G 
   
0 0 5 1 H 
y y

H G

D C

x x
E F
E F
A B
A B
z
H G
z

D C

For rotation by =-900 about the y axis

cos( 90) 0  sin( 90) 0  0 0 1 0


 0  0 1 0 0
 
T 
* 0
 sin( 90)
1 0

0 cos( 90) 0  1 0 0 0
   
 0 0 0 1  0 0 0 1

 2 0 0 1
 2 0 3 1

 2 5 3 1
 
2
 
* *
 
X  X  T  
0
5 0 1
0 0 1
 
0 0 3 1
0 5 3 1
 
 0 5 0 1

3.24
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

y y*

H G D* H*

D C C* G*

x x*
E F A* E*

A B B* F*
z z*

c) Three Dimensional Reflection

In a reflection through the xy plane, only the z coordinate values of the object’ position vectors change.
In fact, they are reversed in sign. Thus, the transformation matrix for a reflection through the xy plane
is
1 0 0
0
0 1 0 0
T   
0 0  1 0
 
0 0 0 1
For a reflection through the yz plane

 1 0 0 0
0 1 0 0
T   
0 0 1 0
 
0 0 0 1
For a reflection through the xz plane

1 0 0 0
0  1 0 0
T   
0 0 1 0
 
0 0 0 1

d) 3D Translation

Arguments: dx, dy, dz – displacements

1 0 0 0
0 1 0 0

0 0 1 0
 
dx dy dz 1

Shifts the point by the vector (dx, dy, dz).

3.25
COMPUTER AIDED SHIP DESIGN LECTURE NOTES

Homework Assignment No 3

A cube is defined by the following points

1 0 2 1 A 
2 0 2 1  B 
 1. Translate by dx, dy and dz
2 1 2 1  C  2. Rotate by  degrees
    3. Find the reflection through the xy plane
1 1 2 1  D 
X    
1 0 1 1  E 
   
2 0 1 1  F 
2 1 1 1 G 
   
1 1 1 1 H 

dx dy dz 
1 080190017 Ata Emir Erdoğdu 1 2 3 15
2 080200003 Ayşegül Özşen 2 3 4 20
3 080200019 Cemal Yasin Atasoy 3 4 1 25
4 080200020 Alper Toprak 4 1 2 30
5 080200034 Yiğitcan Tilaver 1 2 3 35
6 080200040 Sefa Ramazan Nacakcı 2 3 4 40
7 080200052 İlker Aksoy 3 4 1 45
8 080200059 Emre Berber 4 1 2 50
9 080200065 M. Mustafa Karakaya 1 2 3 55
10 080200070 Ekin Saraçoğlu 2 3 4 60
11 080200071 Burak General 3 4 1 15
12 080210057 Yağmur Tuncay 4 1 2 20
13 080210069 Emre Altun 1 2 3 25
14 080220026 İsranur Bülbül 2 3 4 30
15 080220713 Ceylan Şavluk 3 4 1 35
16 4 1 2 40
17 1 2 3 45
18 2 3 4 50
19 3 4 1 55
20 4 1 2 60
21 1 2 3 15
22 2 3 4 20
23 3 4 1 25
24 4 1 2 30
25 1 2 3 35
26 2 3 4 40
27 3 4 1 45
28 4 1 2 50
29 1 2 3 55
30 2 3 4 60
31 3 4 1 15
32 4 1 2 20
33 1 2 3 25
34 2 3 4 30
35 3 4 1 35
36 4 1 2 40

Draw both the original and modified cubes in AutoCAD

3.26

You might also like