Documente Academic
Documente Profesional
Documente Cultură
CHAPTER 5
SURFACES
5.1 Introduction
Wire frame models are unable to represent complex surfaces of objects like car, ship, airplane wing, castings etc. A surface model can be used to represent the surface profile of these objects. Also, surface model can be used for calculating mass properties, interference between parts, generating cross-sectioned views, generating finite element mesh, and generating NC tool paths for continuous path machining. Additionally, surface model can be used to fit experimental data, discretized solutions of differential equations, construction of pressure surface, construction of stress distribution etc. Surface creation on a CAD system usually requires wire frame entities: lines, curves, points, etc. All analytical and synthetic curves can be used to generate surfaces. In order to visualize surfaces on a graphic display, a mesh, say m x n in size is usually displayed; the mesh size is controlled by the user. Most CAD systems provide options to set the mesh size. A surface of an object is more complete and less ambiguous representation than its wire frame model; it is an extension of a wire frame model with additional information. A wire frame model can be extracted from a surface model by deleting all surface entities (not the wireframe entities point, lines, or curves!). Databases of surface models are centralized and associative, manipulation of surface entities in one view is automatically reflected in the other views. Surface models can be shaded and represented with hidden lines.
Chapter 5 - Surfaces
Boundary Curve
Curve
axis of symmetry
5-2
Chapter 5 - Surfaces
P2
P3
P1
P4
Edge 2
Edge1
Edge 3
Edge 4
5-3
Chapter 5 - Surfaces
5-4
Chapter 5 - Surfaces
P (0,1) v P (0,0)
The interpolated parametric equation of a bilinear surface is given as: P (u,v) = (1-u) (1-v) P(0,0) + u (1-v) P(1,0) + (1-u) P(0,1) + u v P(1,1) In matrix form, it can be written as P(u,v) = [(1-u)(1-v) u(1-v) (1-u)v uv]
P(0,0) P(1,0) P(0,1) P(1,1)
Node points in FEA Application of Bilinear Surfaces Bilinear patches are extensively used in 2-D finite element analysis (FEA). In FEA, an engineering structure is defined by several bilinear surfaces (elements), which are created by joining points on the structures geometry, called nodes. The nodes are connected to other nodes to create quadrilateral surfaces. Points not lying on the nodes are calculated by interpolation. Thus, the entire structure is completely defined by the nodes and the bilinear surfaces. Drawbacks of Bilinear Surfaces Bilinear surfaces have a very limited use, mainly, for FEA. Since only 4 points can be used in the interpolation, the smoothness of the generated surface is limited. Additionally, there is no flexibility to control shapes of the surface, unlike the sweeped surfaces.
5-5
Chapter 5 - Surfaces
u
P(u,0) Coons Patch
P (0,1)
v
P(0,v)
P (0,0)
The above equation gives wrong values at the corners (u,v = 0 and 1). For example, substituting the values of u and v we get, Q(0,0) = P(0,0) + P(0,0) = 2P(0,0) Q(1,0) = 2P(1,0), etc. Which are obviously wrong values. Therefore, The coons patch is created by modification of the interpolation equation, where the corners are subtracted. The modified interpolation equation is given as, P(u,v) = (1-v) P(u,0) + u P(1,v) v P(u,1) + (1-u) P(0,v) (1-u) (1-v) P(0,0) u (1-v) x P(1,0) - (1-u) v P(0,1) u v P(1,1).
5-6
Chapter 5 - Surfaces
P(u,v) = [(1 v)
(1 u) ]
End-points (coordinates)
- [(1 u)(1 v)
u(1 v)
(1 u)v
uv]
Which gives,
Q(u,v) = [(1 u)
1]
(1 -v) v 1
Other interpolated surfaces include the Parametric Cubic patches. Applications Coons surface is easy to create, and therefore, many 2-D CAD packages utilize it for generating models. However, it has only a limited application since the surface is inflexible and cannot create very smooth surfaces. It would be very difficult to produce a smooth automobile fender using the Coons surface. Several CAD software, including AutoCAD, use this surface for generating surfaces between 4-bounded edges.
5-7
Chapter 5 - Surfaces
L t=0 t=1
A surface is an extension of a curve. The parametric representation of a curve is given by a single-vector equation of the form: P(t) = [x(t) y(t) z(t)]
Here, only one parametric variable or one degree of freedom is needed. Whereas, a surface representation requires two parametric variables, and the equation is given as: Q(s,t) = [x(s,t) y(s,t) z(s,t)] Tracing a point in the s and t directions, as shown in the figure on the next page, generates a surface. One parameter variable is kept constant while varying the other one. A series of curves is created along the s and t directions. For example, constraining the parameters s and t between zero and 1, the set of curves generated along the s direction is, P(0,t), P(0.1,t), P(0.2, t).P(1, t) and the other set of curves along the t direction is,
5-8
Chapter 5 - Surfaces
Thus, creation of a surface requires creation of the multiple curves that constitute it. This concept can be applied to both, the surface that has an analytical formulation (conic sections) and to a free-form surface (Bezier, B-spline).
5-9
Chapter 5 - Surfaces
x B
angle of 2 radians, generating a cylinder. A line or curve when revolved can generate all kinds of surfaces, based on the condition of rotation. Any point on the surface is a function of two parameters t and . Here, t describes the entity to be rotated and represents the angle of rotation. In general, a point on line AB (lying in the xz-plane) is represented by [x(t), 0, z(t)] and, when rotated by radians, it becomes [x(t)cos, x(t)sin, z(t)]. In general, the point matrix gives a point on the surface of revolution obtained by rotation around the z-axis, P(t, ) = [x(t) cos x(t) sin z(t)] In matrix form the equation can be written as,
x X sin
x cos
Lecture notes by R. B. Agarwal Computer Aided Design in Mechanical Engineering
5-10
Chapter 5 - Surfaces
cos 0 0 0
sin 1 0 0
0 0 1 0
0 0 0 1
Note: The above rotation matrix is equivalent to the rotational transformation matrix studied earlier, which is,
cos 0 0 0
sin 1 0 0
0 0 1 0
0 0 0 1
cos - sin 0 0
sin cos 0 0
0 0 1 0
0 0 0 1
Thus, the generated surface is a rotational transformation of a line (or curve), except is not constant, but has values, 0 2. Example Generate the conical surface obtained by rotation of the line segment AB around the zaxis with, A = ( 1,0,1) and B = ( 7,0,7). Solution Line AB can be represented in parametric form as: P (t) = [x(t) y(t) z(t)], and the parametric equation of a line is, P (t) = A + (B-A) t based on this equation, the coordinates of a of point on the line are given as, x(t) = 1 + (7-1) t = 1+ 6t, y(t) = 0
5-11
Chapter 5 - Surfaces
z(t) = 1 + (7-1) t = 1 + 6t The equation of the surface as given above is, P(t, ) = [x(t) cos x(t)sin z(t)] or = [(1+6t) cos (1+6t) sin (1+6t)] - equation of the surface
Any point on the surface can be located by substituting t and values in the above equation, e.g.: at t = 0.4 and = /2 radians P(0.4, /2) = [1+6(.4)cos (/2) 1+ 6(.4) sin (/2) 1 + 6(.4) ] = [0 3.4 3.4], which is the point on the surface at (.4, /2)
Example Generate a Torus by rotating a circle of radius r and the center at (a,0,0) about the z-axis.
Solution
Rotating a circle contained in the x z plane around the z-axis can generate a torus. The center of the circle has coordinates (a,0,0) and equation of the circle in parametric form is given as; P () = [(a + r cos, 0, r sin] The torus is represented by, Q(, ) = {[(a + r cos) cos], [(a + rcos) sin], rsin} equation of the torus In this case, the parameters are and .
5-12
Chapter 5 - Surfaces
Example: A cubic Bezier curve is defined by the control points: P1 (1,0,2), P2 (3,0,4), P3 (2,0,6), P4 (5,0,7). Find the surface of revolution obtained by revolving the curve about the z-axis and calculate the point on the surface at t = 0.5, = /4 rad. Solution The cubic Bezier curve is given by the equation, P (t) = = [t][m][v] [t3 t2 t 1] -1 3 -3 1 3 -6 3 0 -3 3 0 0 1 0 0 0 v0 v1 v2 v3
P (t) = [t3 t2 t 1]
5-13
Chapter 5 - Surfaces
Q (t, ) = [t3 t2
0 2n 0n1
For t = 0.5 and = /4, the surface equation is, -1 3 -3 1 3 -6 3 0 2 (.5) (.5) 1] -3 3 0 0 1 0 0 0 1.86 4.86 1] 1 3 2 5 0 0 0 0 2 1 4 1 6 1 7 1 cos(/4) 0 0 0 sin(/4) 0 0 0 0 0 1 0 0 0 0 1
Q (t, ) = [(.5)3
= [1.86
5-14
Chapter 5 - Surfaces
T(s) =
Where, a, b, c are coordinate values, and 0 s 1 This is equivalent to a three-dimensional translation of a curve with several traces generated along the path, controlled by how the parameter s is varied. Example Consider the Bezier curve defined by the control points P1 = (0,5,0), P2 = (3,4,0), P3 = (2,0,0), and P4 = (5,0,0). Translate the curve five units along the z-axis to generate a swept surface. Solution Q (t,s) = [P(t)] [Tt], substituting the numbers, we get, -1 3 -3 3 -6 3 -3 3 0 1 0 0 1 0 0 0 0 3 2 5 5 4 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 5s 1
Q (t, s) = [t3 t2 t 1]
Substituting the value of s and solving the matrices can calculate any point on the surface.
5-15
Chapter 5 - Surfaces
5-16
Chapter 5 - Surfaces
= [t3
t2 t 1]
Where P(0) = Coordinates of the first point at t = 0 P(1) = coordinates of the last point at t = 1 P(0) = values of the slopes in x, y, z directions at t = 0 P(1) = values of the slopes in x, y, z directions at t = 1 Analogous to a cubic curve, a parametric cubic surface can be defined by 16 points: 4 points for coordinates of the corner points 8 points for slopes in the s & t directions 4 points for twist vectors (second derivatives)
Using a procedure similar to the one carried out in the derivation of the cubic curve, we can derive the geometric coefficient matrix for the surface, which is given as, P(0,0) P(1,0) Ps(0,0) Ps(1,0) P(0,1) P(1,1) Ps(0,1) Ps(1,1) Pt(0,0) Pt(1,0) Pst (0,0) Pst(1,0) Pt(0,1) Pt(1,1) Pst(0,1) Pst (1,1)
[G]H =
5-17
Chapter 5 - Surfaces
Twist vectors, not shown here, are the partial derivatives: dPs/dt & dPt/ds. These vectors control the internal shape of the surface. With the geometric coefficient matrix defined, the equation of the surface can be written as, P(s.t) = [s] [M]H [G]H [MH]T [t]T Where: [s] = [s3 s2 s 1] [M]H = [Constant matrix for n = 3 ] [MH]T = Transpose of [M]H [G]H = Geometry matrix as defined by the 16 points, and t3 [t]T = t2 t 1
Example: Given: A parametric cubic surface is defined by its Cartesian components as follows: 3 1 2 0 0 0 1 2 1 0 1 -1 1 1 1 0 t3 t2 t 1
x(s,t) =
[s3 s2 s 1]
y(s,t) =
[s3 s2 s 1]
1 1 2 1
1 0 3 2
1 0 0 0
1 0 0 2
t3 t2 t 1
z(s,t) =
[s3 s2 s 1]
0 1 3 1
1 0 1 0
2 2 2 1
3 0 1 1
t3 t2 t 1
5-18
Chapter 5 - Surfaces
Obtain the normal vector at the point where s = , t = Solution: P(s,t) = [S] [M]H [G]H [MH]T [t]T = [x(s,t), y(s,t), z(s,t)] X(s,t) = [s] [A]x [t]T Where [A]x = [M]H [G]H [MH]T The normal vector n is given by n = Psx Pt where Ps = P/ds & Pt = P/dt
x(s,t) =
[s3 s2 s 1]
3 1 2 0
0 0 1 2
1 0 1 -1
1 1 1 0
t3 t2 t 1
xs(s,t) =
[3s2 2s 1 0]
3 1 2 0
0 0 1 2
1 0 1 -1
1 1 1 0
t3 t2 t 1
xt(s,t) =
[s3 s2 s 1]
3 1 2 0
0 0 1 2
1 0 1 -1
1 1 1 0
3t2 2t 1 0
5-19
Chapter 5 - Surfaces
xs(s,t) = 4.5313 xt(s,t) = 3.3438 similarly, we can evaluate ys(s,t), yt(s,t), zs(s,t) and zt(s,t) ys (s,t) = 2.5313 yt (s,t) = 5.5313 zs (s,t) = 6.9375 zt (s,t) = 5.4375 And, Ps(s,t) = [4.5313, 2.5313, 6.9375] Pt(s,t) = [3.3438, 5.5313, 5.4375]
n = Ps(0.5,0.5) x Pt(0.5,0.5) = =
i 4.5313 3.3438
j 2.5313 5.5313
k 6.9375 5.4375
5-20
Chapter 5 - Surfaces
BEZIER S URF AC ES
P 14 P1 3 P 12 P 11 v u
P 24
P 34 P 44 P 74 P 43 P 42 P 54 P 64 P 73 P 72 P 41 P 51 P 61 P 71
P 21
P 31
Two b lende d Be zier patche s. Con trol points P 4 1 , P 42 , P 43 and P 4 4 are shared by both pa tches. Slope contin uity between the two patche s is main tained by ha ving each group of three c on trol points which cross th e shared edge (P 3 1 , P4 1, P5 1, etc .) lie on straight line s.
In Bezier surface: o The surface takes the general shape of the control points. o The surface is contained within the convex hull of the control points. o The corner of the surface and the corner control points are coincident. General Equation of the Bezier surface is given as, Q(s,t) = Vi,j Bi,n(s) Bj,m(t) 0 s,t 1 Vi,j defines the control points
Lecture notes by R. B. Agarwal Computer Aided Design in Mechanical Engineering
5-21
Chapter 5 - Surfaces
Bi,n(s) & Bj,m(t) are the Bernstein blending functions in the s and t directions. In matrix form, the Bezier surface can be represented by, Q(s,t) = [S] [M]B [V]B [([M)T]B [t]T For a cubic surface this equation reduces to: -1 3 -3 -3 -6 3 3 3 0 1 0 0 1 0 0 0 v0,0 v1,0 v2,0 v3,0 v0,1 v1,1 v2,1 v3,1 v0,2 v1,2 v2,2 v3,2 v0,3 v1,3 v2,3 v3,3
Q(s,t) = [s3 s2 s 1]
1 3 -3 1
3 -6 3 0
-3 3 0 0
1 0 0 0
t3 t2 t 1
Note that, to represent a cubic Bezier surface, 16 control points must be specified, and several Bezier surfaces can be combined to create a complex surface.
5-22