You are on page 1of 30

MECH 6305: Computer Aided

Design: CAD

Lecture 18

- Transformation
- Curves and Surfaces

Dr. Yonas Tadesse


Mechanical Engineering Department
The University of Texas at Dallas
1
Transformation
World Coordinate System (WCS):
- Lecture note 2
• Often called Model Coordinate System
• A reference space in which model geometrical
data is stored
• The only coordinate system a software system
recognize when storing or retrieving
geometrical data of a model.
• Is the default coordinate system in CAD
software
User Coordinate System (UCS)
- Lecture note 2

• Defined by the user particularly for complex


object modeling
• The coordinate system can be set up at any
position and orientation
• Many UCS can be constructed but only one
can be active at one time
Transformation: Rotation
• Given initial position of point P and after rotation P*, the following
relation can be written
(a)

• From trigonometry
(b)

• Substituting (b) into (a)

A relationship between original and


(c) rotated position of point P
Transformation: Rotation
• In matrix form Eq. (c) can be written as

(d)

• In short form Eq. (c)


(e)

• The rotation matrix about Z axis with angle Θ is :

(f)
Transformation: Translation
• If the coordinate of the new axis is translated some distance

 xo 
[Tr ]   yo  (g)
 zo 

Yw
• To make homogenized transformation,
yo
(g) can be written as:
Tr

 xo  xo Xw
y  (h)
[Tr ]   o  Zw
 zo 
 
1
Homogeneous Transformation
• Combining rotation and translation matrix
cos( )  sin( ) 0 xo 
 sin( ) cos( ) 0 yo  (i)
[T ]  
 0 0 1 zo 
 
 0 0 0 1
• Transformation matrix :
cos( )  sin( ) 0 xo 
 yo 
 R T   sin( ) cos( ) 0
[T ]     (j)
0 1  0 0 1 zo 
 
 0 0 0 1

• Relation between World Coordinate and User Coordinate can be written


[ P*]  T P (k)

Transformation matrix
Example 1:
Problem: The position of point P is given in a User Coordinate System(UCS) as shown in
the figure below as P(x, y)= (3,4). The origin of the UCS is located at O(x,y) = (5,10) with
respect to the World Coordinate System(WCS). The point P is rigidly attached to the UCS.

Question: Find the position of point P w.r.t WCS when the UCS is rotated 450.
w.r.t= with respect to

After
Before

Yw Yu Yw

4 P(3,4)
10 Xu 10
3
450

Xw Xw
5 5
Example 2
• The transformation matrix can be used
– To convert between World Coordinate System ( Model
Coordinate system) and User Coordinate Systems.
– To rotate any curve  A cos(u )
  B sin(u ) 
• Parametric representation of Ellipse [ P ]  
x = xc + A cos u  0 

y = yc + B sin u
z = zc
A B

What will be the orientation of ellipse after rotation?


Ellipse after rotation
x = xc + A cos u  A cos(u )
 B sin(u ) 
y = yc + B sin u [ P]   
z = zc  0 
 
 1 
cos( )  sin( ) 0 xc 
 sin( ) cos( ) 0 yc 
[T ]  
 0 0 1 zc 
 
 0 0 0 1

x’ = xc + A cos(u) cos(a) – B sin(u) sin(a)


y’ = yc + A cos(u) sin(a) + B sin(u) cos(a)
z’ = zc
Curve Manipulation
Curve Manipulation
• Curve manipulation is required in CAD
modeling
• The goal of manipulation:
– Evaluate points on curves
– Blend curves
– Segmentation
– Trimming
– Transformation
– Identify intersections
Curve Manipulation
Blending
• Given P1(u1) for 0 < u1 < a and P2(u2) for 0 < u2 < b
• Create curves that are continuous at the joint

T=tangent vector

Segmentation
-divide into two

Trimming

Evaluate points on curves X u=?


Use successive or incremental values of u
Surface
Types of surface

Surface

Analytic Synthetic

-Plane surface -Hermite


-Ruled (loft surface) - Bezier
-Surface of revolution -B-spline
-Tabulated (extruded) - Coons
Surfaces
• More advanced surface definition result in flexibility
in manufacturing parts
• Curves are used to create surfaces
• Surfaces are used to create volumes (Parts)
• Types of surfaces:
– Plane surface Plane

– Ruled (loft surface)


Plane Ruled
– Surface of revolution
– Tabulated (extruded)
– Fillet
– Offset
– Bezier
– B-spline
– Coons
Plane surface
- defined by 3 non-coincident points
Ruled
• Created by joining corresponding points on two rails (curves).
• The rails are Q(u) and G(u)
• P(u,v) = G(u) + v ( Q(u) – G(u) )

Q(u)

G(u)
Surface of revolution
Tabulated
Fillet surface

Offset surface
Bezier surface
- Based on a given set of points
- Extension of Bezier curve

Coons surface
- Based on a given set of points
- A closed patch used to create surface
- The boundary is closed

B-spline surface
- Based on a given set of points
- Extension of B-spline curve
Types of surface

Surface

Analytic Synthetic

-Plane surface -Hermite


-Ruled (loft surface) -Bezier
-Surface of revolution -B-spline
-Tabulated (extruded) - Coons
Planes: Nonparametric
Equation of a plane with
- non zero normal vector n= [a b c]
- through X o  ( xo , yo , zo )

n  X  X o   0

Or
ax  by  cz  d  0 n  X  X o   0
d  axo  byo  czo
Planes: parametric
• P(u,v) = P0 + u (P1 – P0) + v (P2 – P0)
0 < u ≤ 1, 0 < v ≤ 1
• P(u,v) = P0 + u r + v s
r = P1 - P0

s = P2 - P0
Tabulated: Nonparametric cylinder
Surf command

• xo=5;
• yo=5;
• r=4; 10
• H=10;
8

• x=linspace(1,9,30); 6
• z=linspace(0,H,30);

Z
• [x,z]=meshgrid(x,z); 4

• y=sqrt(r^2-(x-xo).^2)+yo; 2


0
• 0
10
• figure(2) 5 8
• h=surf(x,y,z) 10
6
4
• % set(h,'EdgeColor',[1,0,0]) X
Y
• set(gca,'Fontsize',14)
• xlabel('X'); ylabel('Y'); zlabel('Z');
• view(50,20)
Tabulated: Parametric cylinder
P(u,v) = G(u) + vn
x=xo+r*cos(2πu); Mesh command
y=yo+r*sin(2π u);
z=v*H;
• xo=5;
• yo=5;
10
• r=4;
• H=10; 8

• th=linspace(0,2*pi,30); 6
• z=linspace(0,H,30);

Z
• [th,z]=meshgrid(th,z); 4

• x=xo+r*cos(th); 2
• y=yo+r*sin(th);
• z=z; 0
0
• 10
• figure(1) 5 5
• h=mesh(x,y,z) 10 0
• set(h,'EdgeColor',[1,0,0]) X
Y
• set(gca,'Fontsize',14)
• xlabel('X'); ylabel('Y'); zlabel('Z');
• view(50,20)

You might also like