You are on page 1of 10

# The University of Texas at Dallas, Mechanical Engineering Department

Computer Aided Design - Homework 3
Edgardo Javier Garcia Cartagena
November 13, 2013

1 Problem
A cylinder whose base circle centered at (xo , yo , zo ) = (10, 10, 0)mm has a radius of r = 10mm and the cylinder height is H = 60mm. A plane having a normal vector 1 1 n= √ i+ √ k that passes through point P (20, 0, 30). The plane intersects the cylinder. 2 2 For the given conditions above; (a) Determine the parametric and non-parametric equations of the cylinder. • Parametric x − xo = rcos(θ) y − yo = rsin(θ) z − zo = 0 x = 10 ∗ cos(θ) + 10 y = 10 ∗ sin(θ) + 10 z=0 • Non-parametric

(1.1)

substituting (xo , yo , zo ) and the radius we obtain (1.2)

(x − xo )2 + (y − yo )2 = r2 z = zo

(1.3)

substituting (xo , yo , zo ) and the radius we obtain (x − 10)2 + (y − 10)2 = 102 z=0 (b) Find the equation of the plane (parametric and non-parametric) (1.4)

1

t. t. uz ) + t(vx . vy .• Non-parametric Equation of a plane with a non zero normal vector n ˆ = [a. c] that pass through Xo = (xo .6) Substituting the normal vector n ˆ that pass through point P in equation 1. b. yo . z ) of the plane is a linear combination of direction vectors u and v : − − → Po P = su + tv The vector equation of the plane is: α : r = ro + su + tv The vector of the plane can be rewritten as: (x.8) 2 . z ) = (xo .5) or ax + by + cz + d = 0 where d = −axo − byo − czo (1.7) 1 √ 2 ∗x+ 1 √ 2 ∗z− =0 • Parametric Let consider a plane α. y. ∈ (1. uy . Two vectors u and v .9) s. called direction vectors of the plane α. vz ) (1. yo . yo . su Po tv − − → P Po P α ro r O − − → The vector Po P from a speciﬁc point Po (xo . zo ) n ˆ · (X − Xo ) = 0 (1. zo ) + s(ux . ∈ (1.6 we obtain the following: 1 √ 2 ∗x+ 1 √ 2 ∗z− 1 √ 2 ∗ 20 − 50 √ 2 1 √ 2 ∗ 30 = 0 (1.10) s. zo ) to a generic point P (x. t. parallel to the plane α but not parallel between them.

3 . copy and paste the plots in word ﬁle. the parametric equations for the plane are x = 20 + sux + tvx y = suy + tvy z = 30 + suz + tvz (c) Plot both the cylinder and plane in one plot in Matlab (or equivalent) (1.11) (d) Rotate the result plot in various orientations.or x = xo + sux + tvx y = yo + suy + tvy z = zo + suz + tvz substituting point P .12) (1.

close all . z ]= meshgrid ( th . h o l d on a=1/ s q r t ( 2 ) . s e t ( gca . y l a b e l ( ’Y ’ ) .1 (a) Find the equations of the lines. h=mesh ( x . z=z . z l a b e l ( ’ Z ’ ) . z l a b e l ( ’ Z ’ ) . 1 4 ) x l a b e l ( ’X ’ ) . s e t ( h . 0 . z2 ) . [ th . r =10. z=l i n s p a c e ( 0 . [ 0 . 1 4 ) x l a b e l ( ’X ’ ) . ’ F o n t s i z e ’ . [ 1 . z ) . 1 . 4 . figure . s e t ( h . y2 . % equation of a plane % ax+by+c z +d=0 [ x2 . 2 0 ) ..(e) Copy and paste your Matlab code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 clear all . ’ F o n t s i z e ’ . clc ./MATLAB/union. .H. z ) . 0 ] ) . 2 ∗ pi . ’ EdgeColor ’ . y=yo+r ∗ s i n ( th ) . ’ EdgeColor ’ . 3 0 ) . 2 5 : 2 0 ) . y . x=xo+r ∗ c o s ( th ) . d=−50/ s q r t ( 2 ) . H=60. 0 ] ) s e t ( gca . y2 ]= meshgrid ( 0 : 0 .m 2 Problem Given the lines L1 and L2 and their en points shown in ﬁgure 2. c=1/ s q r t ( 2 ) . y l a b e l ( ’Y ’ ) . 3 0 ) . xo =10. z2=(a ∗ x2+b ∗ y2+d )/− c . yo =10. th=l i n s p a c e ( 0 . h=mesh ( x2 . %view ( 5 0 . b=0.

5) L1 L2 P1 (3. 7) P3 (1. 5.4) (2.1: lines and point Parametric straight line equations in scalar form: x = x0 + t(x1 − x0 ) y = y0 + t(y1 − y0 ) z = z0 + t(z1 − z0 ) 0≤t≤1 substituting for L1 xL1 = 5 + tL1 (3 − 5) yL1 = 6 + tL1 (4 − 6) zL1 = 1 + tL1 (7 − 1) xL1 = 5 − 2tL1 yL1 = 6 − 2tL1 zL1 = 1 + 6tL1 substituting for L2 xL2 = 1 + tL2 (2 − 1) yL2 = 5 + tL2 (9 − 5) zL2 = −2 + tL2 (0 − (−2)) xL2 = 1 + tL2 yL2 = 5 + 4tL2 zL2 = −2 + 2tL2 (2. −2) Figure 2. 1) P (4.P4 (2. 6.5) 5 .1) (2.2) (2. 0) P2 (5.3) (2. 9. 4. 3.

77 = 86. −6) PL2 = (2 − 1.77o θ = 180 − 93. 6 − 4.0658) = 93. they must be in the same plane.10) (2.8) (c) Find the coordinates of the intersection point If we set the two x values equal. therefore lines L1 and L2 do not intersect. 2.13) θ = cos−1 (−0.0658 (2. and the two y values equal we get these two equations.(b) Are the two lines parallel or perpendicular? Two lines are perpendicular if PL1 • PL2 = 0 where PL1 = P2 − P1 and PL2 = P4 − P3 PL1 = (5 − 3. 4. 1 − 7) = (2. 2) PL1 • PL2 = 2 ∗ 1 + 2 ∗ 4 + (−6) ∗ (2) = −2 Two lines are parallel if PL1 × PL2 = 0 PL1 × PL1 i j k = 2 2 −6 = (28.12) this system of equation does not have solution.7) (2. 6) = 0 1 4 2 (2. which is not the case.11) (2. Also this two lines to intersect. 9 − 5. (d) Find the angle between the lines The angle between to lines is given by cos(θ) = PL1 •PL2 |PL1 ||PL1 | = √ −2 √ 22 +22 +62 ∗ 12 +42 +22 = −0. −10.9) (2. 5 − 2tL1 = 1 + tL2 6 − 2tL1 = 5 + 4tL2 1 + 6tL1 = −2 + 2tL2 −2tL1 − tL2 = −4 −2tL1 − 4tL2 = −1 6tL1 − 2tL2 = −3 (2. 0 − 2) = (1.23 6 .6) (2.

2.3) 7 .(e) Find the distance between point P and L1 The distance between a point and a line D = (P − P1 ) × P2 − P1 [2. −2] × = 1. 2. −6] = [1.2) (3.1) when u = 1 (3. −6] (2.14) (f) Plot the lines in Matlab (or equivalent) 3 Problem A spline curve is given by 1 + 4u − u2 x(u) = 2 − u + u2 y (u) 0≤u≤1 (a) Find the endpoints and the midpoints of the curve when u = 0 x(0) 1 = y (0) 2 x(1) 1+4−1 = y (1) 2−1+1 x(1) 4 = y (1) 2 (3. −1.6514 |P2 − P1 | |[2.

5) = x(0. b/2.when u = 0.4) (b) Find the tangent vector at the midpoint P(u) = x(u) 4 − 2u = y (u) −1 + 2u 0≤u≤1 (3. 0]T . 0]T . 0.5) −1 + 2(0. b.P2 = [(3/2)a. 0]T where b > a > 0. i)ui (1 − u)n−i Pi .6) (c) Use CAD software to plot the curve.5) 4 − 2(0.5) 1 + 4(1/2) − (1/2)2 = y (0.5) 7/4 (3.P3 = [2a. 0]T and P4 = [(5/2)a.5) 13/4 = y (0.5) when u = 0. b. 4 Problem Given the coordinates of ﬁve control points.5) 0 (3.5) 2 − 1/2 + (1/2)2 x(0.5) = = y (0.5) = y (0.5) 3 P(0. 0 ≤ u ≤ 1 (4. b.5 P(0.1) 8 .5) x(0. 0]T . The parametric equation of Bezier curve is given by: n P(u) = i=0 C (n.5 x(0. P0 = [1/2.P1 = [a.

for a = 10 and b = 20 the Bezier curve is as follows: (4.B 4 (u).B 4 (u). 14. computing the basis functions B0 1 2 3 4 4! 4 (u) = 0 4−0 = (1 − u)4 B0 0!(4−0)! u (1 − u) 4! 1 4−1 = 4u(1 − u)3 4 (u) = B1 1!(4−1)! u (1 − u) 4! 4 (u) = 2 4−2 = 6u2 (1 − u)2 B2 2!(4−2)! u (1 − u) 4! 3 4−3 = 4u3 (1 − u) 4 (u) = B3 3!(4−3)! u (1 − u) 4! 4 (u) = 4 4−4 = u4 B4 4!(4−4)! u (1 − u) (4.5) 9 . 4 (u). d (u) as: Let deﬁne the basis function Bj d Bj (u) = in our case d = 4.(a) Find the parametric equation of the Bezier curve.4) (b) Stetch the curve along with the control points (c) Find the value of the curve when u = 1/2 P(0.2) (4.B 4 (u).3) where 0 ≤ u ≤ 1.B 4 (u).5) = (15.3750) when a = 10 and b = 20 (d) Select your own valves for a and b and sketch the curve in Matlab. hence the equation of Bezier curves can be written as 4 4 4 4 4 P(u) = P0 B1 (u) + P0 B1 (u) + P2 B2 (u) + P3 B3 (u) + P4 B4 (u) d! uj (1 − u)d−j j !(d − j )! (4.

10 .