Surface Drawing with Sweeping using MLAB

Surface Drawing with Sweeping using MLAB A surface Qin3-dimensional space maybe represented in two parameter form as a function Q (s; t) = (x (s; t) ; y (s; t) ; z (s; t))…

Aspecialcaseof this is that the surface is the surface of a function. Then the parameter form of the surface is just (x; y; z (x; y)). In this paper, we will discuss aspecial case of surfaces in 3 dimensions. i.e. tube-like-surfaces that are generated by sweeping a space curve along another central space curve. Given a space curv er (t) = (x (t) ; y (t) ; z (t)), at each point, there are three directions associated with it, the tangent, normal and bi-normal directions. The unit tangent vector is denoted by T, i.e. T (t) =r0 (t) =kr0 (t) k, the unit normal vector is denoted by N, i.e. N (t) =T0 (t) =kT0 (t) k, the unit bi-normal vector is denoted byB, i.e. B (t) =T (t) £N (t) (cross product). With r (t) ; T (t) ; N (t) and B (t), atube-like surface can be expressed as follows: Q (s; t) =r (t) +d¢ (cos (s) N (t) ¡sin (s) B (t)) where dis a parameter corresponding to the radius of the rotation (In generaldcanbea function oft). Forflxedt, whens runs from 0 to 2…, we have a circle around the pointr (t) in the N; Bplane. As we changet, this circle moves along the space curver, and we will generateatube-like surface alongr. A simple example of this is a torus, where risacircle. r (t) = (cos (t) ; sin (t) ; 0). In this case, T (t) = (¡sin (t) ; cos (t) ; 0), N (t) = (¡cos (t) ; ¡sin (t) ; 0) and B (t) = (0; 0; 1). Thus, the parametric form of the torus is: x (s; t) =cos (t) ¡d¢cos (s) cos (t) y (s; t) =sin (t) ¡d¢cos (s) sin (t) z (s; t) =d. We can easily construct and draw suchatorusin MLAB by merely computing thex; yandzfunctionsona regular grid of (s; t)-points. Using the functionsx, yandz, this can be done as follows: grid=cross((0:(2*pi)! 30,0:(2*pi)!30) d=0.5 m= (xongrid) &’ (yon grid) &’ (zongrid) drawmlthide. Note that the MLAB draw statement is able to correctly discover the underlying grid structure in the matrixm automatically! We can also build a general do-fllewhichdrawsa tube-like-surface given a central curve and a radius function. Here is such an MLAB do-flle. “tube.do” “generateatubeof radiusd(t) around the curve: r(t) = (x(t),y(t),z(t)) ” “Thecentralspace curve component functionsx(t), y(t) and z(t) must be” “predefined. The radius functiond(t) must also be predefined, and” “finally the (s,t) grid matrix called grid must also be predefined.” “Construct unit tangent vector T(t)” “nd(t) is the norm of the derivative” fctnd(t) = ((x’t(t))^2+(y’t (t))^2+(z’t(t))^2)^0.5 “a(t), b(t) andc(t) are the component of T(t)” fcta(t) =x’t(t)/nd(t) fctb(t) =y’t(t)/nd(t) fctc(t) =z’t(t)/nd(t)…

Source: http://www.civilized.com/

Download Surface Drawing with Sweeping using MLAB

Leave a Reply