Sie sind auf Seite 1von 66

Chapter 3

“Transformation, Manipulation and


Data Storage”

Mr. S. P. Deshmukh, MPSTME, Vile Parle 1


2D and 3D Transformations

Translation, Rotation, Scaling etc

Concatenations, Matrix representation

Object oriented programming on transformations

Object Transformation, Mirror transformation

Data Structures for interactive modeling

Bill of Materials, Engg Data management system

SQL, Design Info System

Mr. S. P. Deshmukh, MPSTME, Vile Parle 2


2D Transformations
 What is transformations?
 The geometrical changes of an object from a
current state to modified state.

 Why the transformations is needed?


 To manipulate the initially created object and
to display the modified object without having
to redraw it.

Mr. S. P. Deshmukh, MPSTME, Vile Parle 3


 Can be done in Two ways –

1. Object Transformation
 Alter the coordinates descriptions of an
object
 Translation, rotation, scaling etc.

 Coordinate system unchanged

2. Coordinate transformation
 Produce a different coordinate system

Mr. S. P. Deshmukh, MPSTME, Vile Parle 4


Translation
 Moving drawing or model across the
screen

y
P x  x  t x , y   y  t y

T  x  x  t x 
P    , P    , T   
P  y  y t y 
x
P  P  T

Mr. S. P. Deshmukh, MPSTME, Vile Parle 5


1 1
 Consider a line defined by, L =
2 4
Translate the line in space by 2 units in x direction
and 3 units in y direction.

Solution:-
This would involve adding 2 to the current x
value and 3 to the current y value.

That is -
1 1 2 3 3 4
+ =
2 4 2 3 4 7

The new line would have end points (3,4) & (4,7).
Mr. S. P. Deshmukh, MPSTME, Vile Parle 6
Mr. S. P. Deshmukh, MPSTME, Vile Parle 7
Scaling
 Changing the dimensions of window and
viewport to alter the size of drawing

 Used to enlarge or reduce the size of an


element

 Not necessarily be done equally in x and y


directions.

Mr. S. P. Deshmukh, MPSTME, Vile Parle 8


Scaling
x  x  s x , y   y  s y
Sx
 x   s x 0   x
 y   0 s y   y 
Sy   
P  S  P
y Scaling about a fixed point  x f , y f 
x  x  sx  x f 1  sx 

y  y  s y  y f 1  s y 
x f , yf 
x
P  P  S  P f   1 - S 

Mr. S. P. Deshmukh, MPSTME, Vile Parle 9


1 1
 Consider a line defined by, L =
2 4
Apply the scaling factor of 2 to the line and redraw
the line.

Solution:-
The scaling matrix for the 2*2 line definition would be-
2 0
T=
0 2

The resulting line is -


1 1 2 0 2 2
* =
2 4 0 2 4 8
The new line would have end points (2,2) & (4,8).

Mr. S. P. Deshmukh, MPSTME, Vile Parle 10


Mr. S. P. Deshmukh, MPSTME, Vile Parle 11
Rotation
 Rotation of a drawing about a pivot point.

 Point P1 can be rotated about the origin through


an angle θ in the anti clockwise direction to
position P2.

 The coordinates of P2 can be obtained by


multiplying the coordinates of P1 by matrix-

cos 𝜃 𝑆𝑖𝑛𝜃
−𝑆𝑖𝑛𝜃 𝐶𝑜𝑠 𝜃

Mr. S. P. Deshmukh, MPSTME, Vile Parle 12


1 1
 Consider a line defined by, L =
2 4
Rotate the line in space about the origin at 30°.

Solution:-
The Rotation matrix would be-
cos 30 𝑆𝑖𝑛30
R=
−𝑆𝑖𝑛30 𝐶𝑜𝑠 30

The resulting line will be –

1 1 cos 30 𝑆𝑖𝑛30 0.366 1.366


* =
2 4 −𝑆𝑖𝑛30 𝐶𝑜𝑠 30 −0.268 4.464

Mr. S. P. Deshmukh, MPSTME, Vile Parle 13


 Point P1 (40,20) can be rotated about the origin
through an angle θ = 45° in the anti clockwise
direction to position P2.

 The coordinates of P2 can be obtained by


multiplying the coordinates of P1 by matrix-

cos 45 𝑆𝑖𝑛45
−𝑆𝑖𝑛45 𝐶𝑜𝑠 45

Mr. S. P. Deshmukh, MPSTME, Vile Parle 14


 The new coordinates are -

cos 45 sin 45
= 40 20
− sin 45 cos 45

0.707 0.707
= 40 20
−0.707 0.707

= 14.14 42.42

Mr. S. P. Deshmukh, MPSTME, Vile Parle 15


y
Rotation in angle  about a

pivot (rotation) point  xr , yr  .



yr
x
xr
x  xr   x  xr  cos    y  yr  sin 
 x, y
y
y  yr   x  xr  sin    y  yr  cos 

 x, y  P  Pr  R   P  Pr 

cos   sin  
 xr , yr  x R
 sin  cos  

Mr. S. P. Deshmukh, MPSTME, Vile Parle 16


3D Transformations
 Homogeneous coordinates: (x,y,z)=(wx,wy,wz)

 Transformations are now represented as 3x3


matrices

 Typical graphics packages allow for specification


of translation, rotation, scaling and arbitrary
matrices

 Translation, Rotation, Scaling, Concatenation

Mr. S. P. Deshmukh, MPSTME, Vile Parle 17


3D Transformations

 Very similar to 2D.

 Same general procedure are applied.

 Using 3x3 matrices rather than 2x2.

Mr. S. P. Deshmukh, MPSTME, Vile Parle 18


3D Translation

 The translational matrix for a point defined


in three dimensions would be –
T = (m n p)

 It would be applied by adding the


increments m, n, p to the respective
coordinates of each of points defining the
3D geometry element.

Mr. S. P. Deshmukh, MPSTME, Vile Parle 19


3D Translation

x  x  t x
y
y  y  t y

z  z  tz

 x, y, z  x   1 0 0 tx   x 


 x, y, z   y 0
  1 0 t y   y 

 z  0 0 1 tz   z 
z x      
 1  0 0 0 1  1 

Mr. S. P. Deshmukh, MPSTME, Vile Parle 20


3D Rotation
 Rotation in 3D is about an axis in 3D space
passing through the origin

 Using a matrix representation, any matrix with


an orthonormal top-left 3x3 sub-matrix is a
rotation.

 Rows are mutually orthogonal (0 dot product)

Mr. S. P. Deshmukh, MPSTME, Vile Parle 21


3D Rotation
 Determinant of matrix is 1

 Implies columns are also orthogonal, and that the


transpose is equal to the inverse

 Rotation matrix about z axis -

cos 𝜃 − sin 𝜃 0
R = sin 𝜃 cos 𝜃 0
0 0 1

Mr. S. P. Deshmukh, MPSTME, Vile Parle 22


3D Rotation
 x  rxx rxy rxz 0  x 
 y  r r r 0  y
    yx yy yz  
 z   rzx rzy rzz 0  z 
    
 1   0 0 0 1  1 
and for example :
rxx ryx  rxy ryy  rxz ryz  0

Mr. S. P. Deshmukh, MPSTME, Vile Parle 23


y y y
P2
P2
P1
P1 P1
x x x
P2
z z z

y y y
P2 P2

P1 P1 P1

P2 x x x

z z z

Mr. S. P. Deshmukh, MPSTME, Vile Parle 24


1 0 0  x1 
0 1 0  y1 
The vector from P1 to P2 is: T
0 0 1  z1 
 
V  P2  P1   x2  x1 , y2  y1 , z2  z1  0 0 0 1 

Unit rotation vector: u  V | V |  a, b, c 

a   x2  x1  | V | y u   a, b, c 
b   y2  y1  | V |

c   z2  z1  | V |
x
a 2  b2  c2  1
z
Mr. S. P. Deshmukh, MPSTME, Vile Parle 25
Rotating u to coincide with z axis

First rotate u around x axis to lay in x  z plane.


Equivqlent to rotation u 's projection on y  z plane around x axis.

cos   c b 2  c 2  c d , sin   b d .

 
We obtained a unit vector w  a, 0, b 2  c 2  d in x  z plane.
y u   a, b, c 
1 0 0 0
0 c d b d 0  u
R x    
0 b d c d 0 
   x
0 0 0 1
z
Mr. S. P. Deshmukh, MPSTME, Vile Parle 26
Rotate w counterclockwise around y axis.
w is a unit vector whose x  component is a, y  component is 0,

hence z  component is b 2  c 2  d . y u   a, b, c 
cos   d , sin   a

d 0 a 0  x
0 1 0 0 
Ry    
 a 0 d 0 z
 
0 0 0 1 w   a, 0, d 

R    T1  R x1    R y1     R z    R y     R x    T

Mr. S. P. Deshmukh, MPSTME, Vile Parle 27


cos   sin  0 0
 sin  cos  0 0 
R z    
 0 0 1 0
 
 0 0 0 1

R    T1  R x1    R y1     R z    R y     R x    T

M R   

 a 2 1  cos    cos  ab 1  cos    c sin  ac 1  cos    b sin  


 
                  
2
ba 1 cos c sin b 1 cos cos bc 1 cos a sin 
 ca 1  cos    b sin  cb 1  cos    a sin  c 2 1  cos    cos  
 

Mr. S. P. Deshmukh, MPSTME, Vile Parle 28


General 3D Rotations
1. Translate the object such that rotation axis passes
through the origin.

2. Rotate the object such that rotation axis coincides with


one of Cartesian axes.

3. Perform specified rotation about the Cartesian axis.

4. Apply inverse rotation to return rotation axis to


original direction.

5. Apply inverse translation to return rotation axis to


original position.

Mr. S. P. Deshmukh, MPSTME, Vile Parle 29


3D Scaling
y y
x  x  S x

y  y  S y

z  x  S z

z x z x
Enlarging object also moves it from origin

 x   S x 0 0 0  x 
 y  0 Sy 0 0  y 
P        SP
 z   0 0 Sz 0  z 
     
1  0 0 0 1  1 

Mr. S. P. Deshmukh, MPSTME, Vile Parle 30


Scaling with respect to a fixed point (not necessarily of object)

y y y

x f , yf , zf  x f , yf , zf  x f , yf , zf 
z x z x z x

y
Sx 0 0 1  S x  x f 
 
1 
TS T  
0 Sy 0 1  S y  y f 
 xf , yf , z f  0 0 Sz 1  S z  z f 
 0 0 0 1 
z x

Mr. S. P. Deshmukh, MPSTME, Vile Parle 31


Concatenation
 To combine the individual transformations in order
to achieve the required results.

 The combined transformation matrix can be


obtained by multiplying the respective
transformation matrices

 The order of the matrix multiplication be the same


as that of transformation

Mr. S. P. Deshmukh, MPSTME, Vile Parle 32


Mirror Transformation
 In modeling operations, one frequently
used operation is mirroring an object.

 Mirroring is a convenient method used


for copying an object while preserving its
features.

 The mirror transformation is a special


case of a negative scaling.

Mr. S. P. Deshmukh, MPSTME, Vile Parle 33


Mirror Reflection
Y Y

(1,1)
(-1,1) (1,1)

X
X

(1,-1)

Reflection about X - axis Reflection about Y - axis


x  x y    y x   x y   y
1 0 0   1 0 0
M x  0  1 0 M y   0 1 0
0 0 1  0 0 1

Mr. S. P. Deshmukh, MPSTME, Vile Parle 34


Other transformations
Reflection:
x-axis y-axis

1 0 0
0  1 0 
 
0 0 1

  1 0 0
 0 1 0
 
 0 0 1

Mr. S. P. Deshmukh, MPSTME, Vile Parle 35


Reflection:

origin line x=y

  1 0 0 0 1 0 
 0  1 0 1 0 0
   
 0 0 1 0 0 1

Mr. S. P. Deshmukh, MPSTME, Vile Parle 36


Shearing Transformation

1 a 0 1 0 0 1 a 0
SH x  0 1 0 SH y  b 1 0 SH xy  b 1 0
0 0 1 0 0 1 0 0 1

Sheared in X Sheared in Y Sheared in both X


unit cube
direction direction and Y direction

Mr. S. P. Deshmukh, MPSTME, Vile Parle 37


Shear:

x-direction y-direction
1 shx 0  1 0 0
0 1 0   sh 1 0
   y
0 0 1  0 0 1

Mr. S. P. Deshmukh, MPSTME, Vile Parle 38


Object Transformation
 Line: Can be transformed by transforming
the end points

 Plane:(described by 3-points) Can be


transformed by transforming the 3-points

 Plane:(described by a point and Normal)


Point is transformed as usual. Special
treatment is needed for transforming Normal

Mr. S. P. Deshmukh, MPSTME, Vile Parle 39


Bill Of Materials
 Bill of materials (BOM): a listing of all of the raw
materials, parts, subassemblies, and assemblies needed
to produce one unit of a product.
 Each finished product has its own bill of materials.

 Product structure tree: Visual depiction of the


requirements in a bill of materials, where all
components are listed by levels.

 Basically, a bill of material (BOM) is a complete list of


the components making up an object or assembly.

Mr. S. P. Deshmukh, MPSTME, Vile Parle 40


Processes that utilize a BOM

 Production

 Materials planning

 Product costing

 Plant maintenance

Mr. S. P. Deshmukh, MPSTME, Vile Parle 41


Types of BOMs
 Static (fixed) bill
 A bill of material for a part that is normally
made from the same components, labor and raw
materials.
 Used for standard assemblies, components, and
engineer-to-order customer orders.

 Example:
 A bill of materials for a standard chair

Mr. S. P. Deshmukh, MPSTME, Vile Parle 42


Types of BOMs
 Dynamic (parametric) bill
 A bill of material for a product or part for
which size, color, laminate, and other
options can be selected.

 Example:
 A bill of materials for a Dell computer

Mr. S. P. Deshmukh, MPSTME, Vile Parle 43


Structure of a BOM

Mr. S. P. Deshmukh, MPSTME, Vile Parle 44


What information is on a BOM?

1. Quantity

2. Item ID#

3. Description of Item

4. Cost of Item

5. Total Project Cost

Mr. S. P. Deshmukh, MPSTME, Vile Parle 45


 Extracting attribute values to form a table or text file
is an excellent application for data extraction. It is
useful for creating bills of materials, schedules, and
associated lists, such as parts lists, application lists,
data lists, index lists, and wire lists.

 The data is already available, so you can add it to a


table or text file without having to retype the
information.

 Extracted data is also associated with the table or


text file. As a result, when you make changes to the
extracted data in the drawing, the corresponding
information in the table or text file updates.

Mr. S. P. Deshmukh, MPSTME, Vile Parle 46


Mr. S. P. Deshmukh, MPSTME, Vile Parle 47
Engineering Data management system
1. Data Base
 Physical Data
 Logical data
 Data independence

2. Objective
1. Reduce redundant data
2. Integrate existing Data
3. Provide Security
4. Share data among users
5. Simplify the method of using data

Mr. S. P. Deshmukh, MPSTME, Vile Parle 48


Engineering Data management system
 Data Base Models
 Hierarchical Database
 Network Database
 Relational Database

 DBMS Architecture

Mr. S. P. Deshmukh, MPSTME, Vile Parle 49


Mr. S. P. Deshmukh, MPSTME, Vile Parle 50
Relational Database for Design
 In object relational/object oriented
databases, attributes can be composite or
multi-valued

 But in relational databases, composite


attributes will need to be flatten out and
multi-valued attributes need to be
represented by another relation

Mr. S. P. Deshmukh, MPSTME, Vile Parle 51


 We can create tables to represent
design in many different ways
 Combine attributes differently to create tables

 Why do we choose some ways over the


others?
 Redundancy
 Inability to represent certain information
E.g. relationships among attributes

Mr. S. P. Deshmukh, MPSTME, Vile Parle 52


Relational Database Design Process
 Decide whether a particular relation R is in “good”
form.
 In the case that a relation R is not in “good” form,
decompose it into a set of relations {R1, R2, ..., Rn}
such that
 each relation is in good form

 the decomposition is a lossless-join decomposition

 Theory is based on:


 functional dependencies

 multivalued dependencies

Mr. S. P. Deshmukh, MPSTME, Vile Parle 53


Mr. S. P. Deshmukh, MPSTME, Vile Parle 54
Object Oriented Database
 A database system that incorporates all
the important object-oriented concepts

 Some additional features


 Unique Object identifiers
 Persistent object handling

Mr. S. P. Deshmukh, MPSTME, Vile Parle 55


Definition of an object
Objects – User defined complex data types
 An object has structure or state (variables) and
methods (behavior/operations)

An object is described by four characteristics-


 Identifier: a system-wide unique id for an object

 Name: an object may also have a unique name in


DB (optional)
 Lifetime: determines if the object is persistent or
transient
 Structure: Construction of objects using type
constructors
Mr. S. P. Deshmukh, MPSTME, Vile Parle 56
SQL Overview
 Structured Query Language
 The standard for relational database management
systems (RDBMS)
 SQL-92 and SQL-99 Standards – Purpose:
 Specify syntax/semantics for data definition and
manipulation
 Define data structures

 Enable portability

 Specify minimal (level 1) and complete (level 2)


standards
 Allow for later growth/enhancement to standard

57 Mr. S. P. Deshmukh, MPSTME, Vile Parle


58 Mr. S. P. Deshmukh, MPSTME, Vile Parle
SQL Environment
 Catalog
 A set of schemas that constitute the description of a
database
 Schema
 The structure that contains descriptions of objects created
by a user (base tables, views, constraints)
 Data Definition Language (DDL)
 Commands that define a database, including creating,
altering, and dropping tables and establishing constraints
 Data Manipulation Language (DML)
 Commands that maintain and query a database
 Data Control Language (DCL)
 Commands that control a database, including administering
privileges and committing data

59 Mr. S. P. Deshmukh, MPSTME, Vile Parle


60 Mr. S. P. Deshmukh, MPSTME, Vile Parle
SQL Data types
 String types
 CHAR(n) – fixed-length character data, n characters long
Maximum length = 2000 bytes
 VARCHAR2(n) – variable length character data, maximum
4000 bytes
 LONG – variable-length character data, up to 4GB.
Maximum 1 per table

 Numeric types
 NUMBER(p, q) – general purpose numeric data type

 INTEGER(p) – signed integer, p digits wide

 FLOAT(p) – floating point in scientific notation with p


binary digits precision

 Date/time type
 DATE – fixed-length date/time in dd-mm-yy form

61 Mr. S. P. Deshmukh, MPSTME, Vile Parle


Design Information Systems
 A logical series of development phases
followed in an organisation to conduct all
the steps necessary to analyse, design,
implement & maintain information systems.

 These logical series of development phases


- known as System Development Life Cycle
(SDLC).

Mr. S. P. Deshmukh, MPSTME, Vile Parle 62


Systems Development Life Cycle (SDLC)

Scope & objectives

Feasibility

Analysis
 Waterfall Model Time
Design
– Proven approach
Implement
– Lacks flexibility
Maintain
– Time lag
– Ensures points of review Review

Mr. S. P. Deshmukh, MPSTME, Vile Parle 63


Final
Exam
University Questions
1) Explain in details any FOUR 3D transformations. Enlist its
benefits. [12 M]

2) Write a short note on –Information systems in


CAD/CAM/CAE. [5 M]

Re-Exam

1. Find the transformed homogenous coordinates when a square


(1,1), (2,1), (1,2) and (2,2) is rotated through one of its vertex
(1,1) and parallel to x axis. Also give its concatenated matrix .
[15 M]

Mr. S. P. Deshmukh, MPSTME, Vile Parle 64


Mr. S. P. Deshmukh, MPSTME, Vile Parle 65
Thank You…

Mr. S. P. Deshmukh, MPSTME, Vile Parle 66

Das könnte Ihnen auch gefallen