You are on page 1of 15

# INTERNATIONAL ISLAMIC UNIVERSITY MALAYSIA

## MME 3109 CAD/CAM

WORK BOOK Part 2a

Semester 1, 2012/2013
October 2012

## CURVES (HERMITE AND BEZIER)

PROBLEM A:HERMITE CURVE
Based on Figure 26,

is a

"1", u = 1.

## Figure 26: Vectors definition

Construct a Hermite Curve connecting both points with the vectors value are shown below:

SOLUTION:
Hermite Curve is constructed based on the following Equation:

Create the Table below. Column A contain value of u from 0 to 1 increase by 0.1. Column B
to M are filled with the vectors value (same for each row). Excel can be used to make the
calculation easier.

## Formula of cell N2 and O2 are as follows

N2 = (1-3*A2^2+2*A2^3)*B2+(3*A2^2-2*A2^3)*E2 + (A2-2*A2^2+A2^3)*H2 + (A2^3A2^2)*K2
Fill in the other cells in Column N by double click cell N2 (if using MS-Excel)
O2 = (1-3*A2^2+2*A2^3)*C2+(3*A2^2-2*A2^3)*F2 + (A2-2*A2^2+A2^3)*I2 + (A2^3A2^2)*L2
Fill in the other cells in Column O by double click cell O2.
Since this is a 2D problem, z values (column P) are zero.

The first and the last X,Y data (highlighted) MUST be the same with the first and second
point respectively.
Draw a Hermite Curve MANUALLY using X, Y data result as shown in the Table above. On
the same graph, draw both of the tangential vectors. Produce EXACTLY THE SAME
GRAPH as example shown below.

## Figure 27: The Hermite curve.

PROBLEM B: BEZIER CURVE
Four control points are defined as shown in Figure 28.

where

## Construct a Bezier curve.

SOLUTION
Definition of Bezier Curve:

Create the Table below. Column B contain value of u from 0 to 1 increase by 0.1. Column C
to N are filled with the control points (same for each row). Excel can be used to make the
calculation easier.
Formula of cell O5 and P5 are as follows
O5 = C5*(1-B5)^3+F5*3*B5*(1-B5)^2+I5*3*(B5^2)*(1-B5)+L5*B5^3
Fill in the other cells in Column O by double click cell O5 (if using MS-Excel)
P5 = D5*(1-B5)^3+G5*3*B5*(1-B5)^2+J5*3*(B5^2)*(1-B5)+M5*B5^3
Fill in the other cells in Column P by double click cell P5.
Since this is a 2D problem, z values (column P) are zero.

The first and the last x(u), y(u) data (highlighted) MUST be the same with the first and last
control point respectively.
Draw a Bezier Curve MANUALLY using x(u), y(u) data result as shown in the Table above.
Produce EXACTLY THE SAME GRAPH as example shown below.

## Figure 29: The Bezier curve

ASSIGNMENT 5: CURVES

1. Based on the previous example, Construct a Hermite Curve connecting both points
with the vectors value are shown below:

## Follow step by step procedure as shown in the example.

2. Based on the previous example, Construct a Bezier Curve from 4 control points as
follow:

## INTERNATIONAL ISLAMIC UNIVERSITY MALAYSIA

ASSIGNMENT 5
CURVES

Name:
Matric:
Section:

October 2012

TRANSFORMATION
PROBLEM: 2D TRANSFORMATION
New Working Coordinate System (WCS) is obtained from Model Coordinate System (MCS)
after translation (2 unit in X direction and 1 unit in Y direction) and rotation (30O CCW) as
shown in Figure 30.
(1) Define the Transformation Matrix.
(2) A point (3, 1.5) in WCS, equal to what coordinate in MCS?

## Figure 30: MCS and WCS

SOLUTION:
Translation

Rotation

Total Transformation

So for a point (x,y,z) in WCS, its coordinates (x*,y*,z*) in the MCS is obtained:

,
The result is shown in the Figure below

10

PROBLEM: 3D TRANSFORMATION
In this example, obtaining WCS1 is simpler as it involves translation from point D to point E,
and a rotation CW around X. However obtaining WCS2 involves translation from point D to
point B, rotation CCW around Y, and rotation CW around X.
If AD = AE = 10, AB=15, and = 60O. If Point I is centre point of the inclined circle and
located in the centre of rectangle BCGF, define its location based on WCS2 and MCS.

## Figure 31: 3D Transformation

SOLUTION:
Based on WCS2, Location of point I is half of BC in X2 direction, half of BF in Y2 direction
and 0 in Z2 direction. BC = AD = 10 while BF = EA/sin = 10/sin(60)=11.55. Therefore, the
coordinate of point I is (5, 5.77, 0)

11

## Transformation Matrix from MCS to WCS2

Translation from point D to point B, the transformation matrix is:

12

## Rotation 30O CW around X, the transformation matrix is

Total Transformation is
[T] = [D][Ry][Rx]CW

13

## INTERNATIONAL ISLAMIC UNIVERSITY MALAYSIA

ASSIGNMENT NO 6
TRANSFORMATION

Name:
Matric:
Section:

October 2012

14

ASSIGNMENT 6: TRANSFORMATION
One MCS and three WCS are shown in Figure 32. Plane GHIF has 30O inclination from
plane CDHG. Length OA=CG=10, AD=AB=20, BE=30. MCS (X-Y-Z) is a Model
Coordinate System, WCS1 (X1-Y1-Z1), WCS2 (X2-Y2-Z2), WCS3 (X3-Y3-Z3) are Working
Coordinate Systems.
a) Define Transformation Matrix of WCS1
b) Define Transformation Matrix of WCS3
c) If Point J (centre of the first circle) is located at 10,10 based on WCS1, what is its location
based on MCS?
d) If Point K (centre of the second circle) is located at 10,10 based on WCS3, what is its
location based on MCS?

15