Professional Documents
Culture Documents
Design: CAD
Lecture 18
- Transformation
- Curves and Surfaces
• From trigonometry
(b)
(d)
(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
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
T=tangent vector
Segmentation
-divide into two
Trimming
Surface
Analytic Synthetic
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
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)