## CHAPTER 5

## SCULPTURED SURFACES DEFINED BY TWO CURVES

This chapter is concerned with a number of surface types which can be defined from two parametric curves. In each case the surface produced is a patched bi-parametric surface but the relationship between the initial curves and the final surfaces depends upon the definition statement. In the simplest case two curves can be used to define a ruled surface, this is described in section 5.1. The remaining sections of this chapter are concerned with the 'cross-product' definitions of surfaces. In each case one of the two curves defines a profile curve for the surface and the second curve controls the generation of the surface from the profile curve. Section 5.2 describes the 'TRANSL' type of cross product surface in which the profile curve is translated or swept along the control curve to generate the surface. Section 5.3 is concerned with the rotated types of cross product surfaces. Finally, Section 5.4 describes a type of surface produced by translating and scaling the profile curve. All these types of surface definition can be used to produce smooth sculptured surfaces and the definitions allow great flexibility to the user but in some cases the result can be difficult to visualise from the basic curves.

## 5.1 RULED SURFACES

A ruled surface can be defined as a surface generated by a family of straight lines, at each point of the surface the curvature is zero in the direction of the ruling. In practice the simplest method of generating a ruled surface is to start with two profile curves and connect corresponding points on these curves with straight lines. It is important to note that the shape of the surface produced depends not only upon the profile curves but also on the point to point association between the curves. In the sculptured surfaces system a ruled surface is defined by two profile curves which must be divided into the same number of segments. The rulings on the surface then connect points on the surface with the same parameter value. The two definition formats for ruled surfaces are in fact special cases of the GENCUR and SMESH surface definition statements. For a GENCUR type of ruled surface the curves must have a 'FLOW' structure, which is used to define the rulings. For an SMESH type ruled surface the natural curve parameter is used. 107## 5.1.1 RULED SURFACE EXAMPLES

In the first simple example the profile curves are both plane curves defined in parallel planes. C5 is a semi circle in the plane z = 0 and C6, in the plane z = 8, consists of two short line segments at right angles to each other. A = POINT/-5,0,0 B = POINT/0,5,0 C = POINT/5,0,0 D = POINT/-5,0,8 E = POINT/0,5,8 F = POINT/5,0,8 T = VECTOR/1,0,0 C1 = SCURV/CURSEG,A,B,TANSPL,T C2 = SCURV/CURSEG,B,TANSPL,T,C C3 = SCURV/CURSEG,D,E C4 = SCURV/CURSEG,E,F C5 = SCURV/COMBIN,C1,C2,FLOW,ARC,0,2,SEG,LENGTH,0,1, $ LENGTH,1,2 C6 = SCURV/COMBIN,C3,C4,FLOW,ARC,0,2,SEG,LENGTH,0,1, $ LENGTH,1,2 RS = SSURF/GENCUR,C5,C6 In this example RS is defined as a ruled surface with boundary profile curves C5 and C6. These are both two segment flow curves with the flow proportional to the arc length. The resulting surface is shown in Figure 5.1, it is a ruled surface with two patches, one for each segment of the boundary curves. The parametric curves v = constant, r = r(u) include the two boundary curves (v = 0 and v = 1) intermediate curves are a blend between the two boundary curves. The parametric curves u = constant are all straight lines, this is referred to as the cross spline direction in the standard print out. The full verification listing for this surface is: 108 Figure 5.1 109 SCULPTURED SURFACE RS PT = SURFACE POINT, TN = FIRST (SPLINE) DIRECTION, CS = SECOND (CROSS SPLINE) DIRECTION, NR = SURFACE NORMAL. EACH PATCH HAS FOUR CORNERS PT00, PT10, PT01, PT11. BOUNDARY B1 = PT00 - PT10 , B2 = PT00 - PT01 , B3 = PT10 - PT11 , B4 = PT01 - PT11. NR50, NR05, ETC REPRESENT SURFACE NORMALS AT INTERIM POINTS NR05 REPRESENTS A NORMAL AT u = 0 , v = 0.5 MIDWAY BETWEEN PT00 - PT01. POSITIVE RADII AND CURVATURES ARE CUPPED IN THE DIRECTION OF THE SURFACE NORMALS NRI, NRT, NRK SS HEADER TABLE VALUE TABLE SIZE 263 TOPOLOGY TABLE SIZE 8 NUMBER OF PATCHES 2 SURFACE TYPE (MESH = 2) 2 PNTVEC,POLYGN,PNTSON 6 SIGN OF NORMAL (TN x CR) 1 TOTAL SIZE OF SURF 293 NUMBER OF SPLINES 2 NUMBER OF CROSS SPLINES 3 X Y Z W X Y Z W PATCH NUMBER 1 PT00 -5.000 0.000 0.000 1.000 CR00 0.000 0.000 8.000 1.000 PT50 -3.543 3.529 0.000 1.000 CR50 1.043 -1.029 8.000 1.000 PT10 0.000 5.000 0.000 0.000 CR10 0.000 0.000 8.000 0.000 PT01 -5.000 0.000 8.000 0.000 CR01 0.000 0.000 8.000 0.000 PT51 -2.500 2.500 8.000 0.000 CR51 -1.043 -1.029 8.000 0.000 PT11 0.000 5.000 8.000 0.000 CR11 0.000 0.000 8.000 0.000 PT05 -5.000 0.000 4.000 0.000 CR05 0.000 0.000 8.000 0.000 PT15 0.000 5.000 4.000 0.000 CR15 0.000 0.000 8.000 0.000 110 NRI NRJ NRK NR00 1.00000 0.00000 0.00000 NR50 0.69692 -0.69417 -0.18007 NR10 0.00000 -1.00000 0.00000 NR01 0.70711 -0.70711 0.00000 NR51 0.69555 -0.69555 -0.18006 NR11 0.70711 -0.70711 0.00000 NR05 0.93171 -0.36319 0.00000 NR15 0.36319 -9.93171 0.00000 B1 = 0, B2 = 0, B3 = 2, B4 = 0 PT55 -3.021 3.014 4.000 NR55 0.6963 -0.6948 -0.1801 PATCH AREA 59.0091 CURVATURES 0.1089 0.0000 MEAN & GAUSS = 0.0544 0.0000 RADII = 9.183 105506.803 X Y Z W X Y Z W PATCH NUMBER 2 PT00 0.000 5.000 0.000 1.000 CR00 0.000 0.000 8.000 1.000 PT50 3.529 3.543 0.000 1.000 CR50 -1.029 -1.043 8.000 1.000 PT10 5.000 0.000 0.000 0.000 CR10 0.000 0.000 8.000 0.000 PT01 0.000 5.000 8.000 0.000 CR01 0.000 0.000 8.000 0.000 PT51 2.500 2.500 8.000 0.000 CR51 -1.029 -1.043 8.000 0.000 PT11 5.000 0.000 8.000 0.000 CR11 0.000 0.000 8.000 0.000 PT05 0.000 5.000 4.000 0.000 CR05 0.000 0.000 8.000 0.000 PT15 5.000 0.000 4.000 0.000 CR15 0.000 0.000 8.000 0.000 NRI NRJ NRK NR00 0.00000 -1.00000 0.00000 NR50 -0.69417 -0.69692 -0.18007 NR10 -1.00000 0.00000 0.00000 NR01 -0.70711 -0.70711 0.00000 NR51 -0.69555 -0.69555 -0.18006 NR11 -0.70711 -0.70711 0.00000 NR05 -0.36319 -0.93171 0.00000 NR15 -0.93171 -0.36319 0.00000 B1 = 0, B2 = 1, B3 = 0, B4 = O PT55 3.014 3.021 4.000 NR55 -0.6948 -0.6963 -0.1801 PATCH AREA = 59.00091 CURVATURES = 0.1089 0.0000 MEAN & GAUSS = 0.0544 0.0000 RADII = 9.183 105506.803 APPROXIMATE TOTAL SURFACE AREA = 118.00182O CRITICAL CURVATURES ON THE SURFACE MAXIMUM SIGNED CURVATURE AND RADIUS = 0.10889 9.18266 AT PATCH NUMBER 2 MINIMUM SIGNED CURVATURE AND RADIUS = 0.0000 105506.80300 AT PATCH NUMBER 2 111 MESH PATTERN OF POINTS AND NORMALS POINT X Y Z SNI SNJ SNK SPLINE NUMBER = 1 (v=0) 1 -5.00000 0.00000 0.00000 1.00000 0.00000 0.00000 (u=0) 2 0.00000 5.00000 0.00000 0.00000 -1.00000 0.00000 (u=1) 3 5.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 (u=2) SPLINE NUMBER = 2 (v=1) 1 -5.00000 0.00000 8.00000 0.70711 -0.70711 0.00000 (u=0) 2 0.00000 5.00000 8.00000 -0.70711 -0.70711 0.00000 (u=1) 3 5.00000 0.00000 8.00000 -0.70711 -0.70711 0.00000 (u=2) CROSS SPLINE NUMBER = 1 (u=0) 1 -5.00000 0.00000 0.00000 1.00000 0.00000 0.00000 (v=0) 2 -5.00000 0.00000 8.00000 0.70711 -0.70711 0.00000 (v=1) CROSS SPLINE NUMBER = 2 (u=1) 1 0.00000 5.00000 0.00000 0.00000 -1.00000 0.00000 (v=0) 2 0.00000 5.00000 8.00000 -0.70711 -0.70711 0.00000 (v=1) CROSS SPLINE NUMBER = 3 (u=2) 1 5.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 (v=0) 2 5.00000 0.00000 8.00000 -0.70711 -0.70711 0.00000 (v=1) The above print out was obtained using the SSTEST option, the default print out omits all the patch data and consists of the header table, the surface area and critical curvatures and the mesh pattern of points and normals. Much of the above is self explanatory but some further clarification is needed for some of the details. The explanatory note is used for all patch data output but the format of the actual data depends upon the type of patch. In spite of the reference to tangent data in the spline direction (TN) this is not given for a ruled surface. All output coordinates are given in Cartesian form, the W values although tabulated should be ignored. The boundary data at the end of the patch data is taken from the topology table and shows precisely how the patch is connected to its neighbours. PT55 refers to the central point of the patch, (u = 0.5, v = 0.5) and it is at this point that the curvatures and associated radii are computed. The values printed out are the two principal curvatures (i.e. curvatures in the principal directions which may not coincide with the parametric curves), the arithmetic mean of these two quantities and the Gaussian curvature which is defined as the product of the principal curvatures. 112 The area is obtained by a simple numerical integration method which uses data only from the patch corners, the mid points of the edges and the central point of the patch, the result should be taken as only an approximate indication of the true surface area. Any modification of the segment structure of the boundary curves will have no effect upon the shape of the ruled surface but can alter the computed area. In the condensed form of the output the total surface area is the sum of the computed patch areas and the critical curvatures are the extreme values occurring at the middle of all patches of the surfaces. In this particular example, boundary curve C6 had a tangent discontinuity at its mid point, this discontinuity affects the patch data. The two patches join along edge PT10 - PT11 of patch 1 and edge PT00 - PT01 of patch 2. At the point u = 1 , v = 1 of patch 1 the surface normal has direction cosines (0.70711, -0.70711, 0.00000) but at the same point ( u = 0 , v = 1 ) of patch 2 the direction cosines are (-0.70711, -0.70711, 0.00000) and the two normals are in fact at right angles. At the mid point of this common boundary the data for NR15 of patch 1 and NR05 of patch 2 shows that the change in surface normal is less abrupt and at the opposite end NR10 and NR00 are in precisely the same direction. The printed value of 105506.803 for the radius of curvature is in fact a default value corresponding to zero curvature, normally the radius is the reciprocal of the curvature. The first example was of a simple ruled surface defined between two curves in parallel planes, if the basic curves are parametric curves in 3 dimensional space the resulting surface is more complex but still consists of straight lines in the v direction. A more general example is: 113 Figure 5.2 114 P1 = POINT/0,0,0 P2 = POINT/1,2,0 P3 = POINT/2,0,-2 P4 = POINT/4,1,-1 Q1 = POINT/0,0,5 Q2 = POINT/2,3,7 Q3 = POINT/3,4,6 Q4 = POINT/5,2,7 C1 = SCURV/SPLINE,P1,P2,P3,P4, $ FLOW,ARC,0,3,SEG,LENGTH,0,1,LENGTH,1,2,LENGTH,2,3 C2 = SCURV/SPLINE,Q1,Q2,Q3,Q4, $ FLOW,ARC,0,3,SEG,LENGTH,0,1,LENGTH,1,2,LENGTH,2,3 SURF = SSURF/GENCUR,C1,C2 The above statements define SURF as a ruled surface between the spline curves C1 and C2. In each case the curve is not a plane curve and the final surface is more complex than the first example. SURF has 3 patches and is illustrated in Figure 5.2. Note that if the segment structure of C2 is changed to SEG,LENGTH,0,3 the attempt to define SURF will fail with the error message DEFINITION ERROR 5033 THE NUMBER OF FLOW SEGMENTS DIFFERED BETWEEN TWO SPLINE CURVES.## 5.1.2 MESH TYPE RULED SURFACE

A ruled surface can also be defined as a special case of the SMESH definition. The ruled surface is once more defined between two curves but the natural parameterisation is used to determine which points are to be joined by the rulings. This method will work best when the natural parameterisation for each definition curve is fairly uniform, this is likely to be the case if the data points are approximately equally spaced. For a valid definition each boundary curve should contain the same number (30 or less) of points. Unlike the GENCUR type of ruled surface the boundary curves and the ruled surface are defined in a single statement with the SMESH definition. A simple example is: 115 Figure 5.3 116 P1 = POINT/0,0,0 P2 = POINT/1,0,0 P3 = POINT/2,1,0 P4 = POINT/3,2.5,1 Q1 = POINT/0,0,2 Q2 = POINT/1,-0.5,2 Q3 = POINT/2.2,0,2 Q4 = POINT/3.5,0.5,1.8 T1 = VECTOR/1,1,0 MS = SSURF/SMESH,XYZ,SPLINE,P1,TANSPL,T1,P2,P3,P4,$ SPLINE,Q1,Q2,TANSPL,T1,Q3,Q4 The surface defined by these statements is shown in Figure 5.3 The verification listing for this surface includes the following. SS HEADER TABLE VALUE TABLE SIZE 149 TOPOLOGY TABLE SIZE 12 NUMBER OF PATCHES 3 TYPE OF SURFACE (MESH = 2) 2 PNTVEC,POLYGN,PNTSON 4 SIGN OF NORMAL (TNXCR) 1 TOTAL SIZE OF SURF 189 NUMBER OF SPLINES 2 NUMBER OF CROSS SPLINES 4 APPROXIMATE TOTAL SURFACE AREA = 8.490937 CRITICAL CURVATURES ON THE SURFACE MAXIMUM SIGNED CURVATURE AND RADIUS 0.36271 2.75695 AT PATCH NUMBER 3 MINIMUM SIGNED CURVATURE AND RADIUS -0.51013 -1.96033 AT PATCH NUMBER 1 117 118 MESH PATTERN OF POINTS AND NORMALS POINT X Y Z SNI SNJ SNK SPLINE NUMBER = 1 (V=0) 1 0.00000, 0.00000, 0.00000, 0.70711, -0.70711, 0.00000 (u=0) 2 1.00000, 0.00000, 0.00000, 0.03060, -0.96969, -0.24242 (u=10) 3 2.00000, 1.00000, 0.00000, 0.83405, -0.45555, -0.31118 (u=2) 4 3.00000, 2.50000, 1.00000, 0.89740, 0.04895, -0.43850 (u=3) SPLINE NUMBER = 2 (V=1) 1 0.00000, 0.00000, 2.00000, -0.98995, 0.14142, 0.00000 (u=0) 2 1.00000, -0.50000, 2.00000, 0.69631, -0.69631, -0.17408 (u=1) 3 2.20000, 0.00000, 2.00000, 0.23173, -0.86061, -0.45348 (u=2) 4 3.50000, 0.50000, 1.80000, -0.07293, -0.38606, -0.91959 (u=3) CROSS SPLINE NUMBER = 1 (u=0) 1 0.00000, 0.00000, 0.00000, 0.70711, -0.70711, 0.00000 (v=0) 2 0.00000, 0.00000, 0.20000, -0.98995, 0.14142, 0.00000 (v=1) CROSS SPLINE NUMBER = 1 (u=1) 1 1.00000, 0.00000, 0.00000, 0.03060, -0.96969, -0.24242 (v=0) 2 1.00000, -0.50000, 2.00000, 0.69631, -0.69631, -0.17408 (v=1) CROSS SPLINE NUMBER = 3 (u=2) 1 2.00000, 1.00000, 0.00000, 0.83405, -0.45555, -0.31118 (v=0) 2 2.20000, 0.00000, 2.00000, 0.23173, -0.86061, -0.45348 (v=1) CROSS SPLINE NUMBER = 4 (u=3) 1 3.00000, 2.50000, 1.00000, 0.89740, 0.04895, -0.43850 (v=0) 2 3.50000, 0.50000, 1.80000, -0.07292, -0.38606, -0.91959 (v=1) The above is an example of the default output produced for a sculptured surface (PRINT/SSPRT,ON). Note it was possible to include TANSPL constraints in defining the boundary curves for this surface. Any attempt to include a CRSSPL constraint or a NORMAL constraint would produce a more general type of SMESH surface unless the constraints happened to be consistent with the direction of the rulings. (Note that NORMAL constraint is specifying the surface normal not the normal to the spline curve). A simple ruled surface could also be defined from the other types of SMESH definitions XYPLAN YZPLAN, or ZXPLAN which require a regular spacing for the data points. For example with XYPLAN the data points have to lie in a rectangular mesh when projected onto the XY plane. This means that the curves should project onto parallel lines and the spacings on these lines should be the same for each set of data points. A mesh definition with these properties would be: (0,2,0), (2,2,1), (3,2,1.5), (4.5,2,1) (0,5,1), (2,5,3.1), (3,5,2.5), (4.5,5,1.6) In effect only the z coordinate can be freely varied in this definition to control the shape of the surface and this restriction makes this definition rather impractical. 119## 5.1.3 CANONICAL FORM FOR A SCULPTURED SURFACE

Unlike the canonical array for a curve sculptured surface canonical forms cannot be produced by including a PRINT/SSTEST,ON statement in the part program. The full external canonical form, with the exception of the first record, can be obtained by using the PUNCH command. The data below, which relates to the simple ruled surface example of Section 5.1.1 was produced by using the statement PUNCH/RS. The canonical form differs both in detailed contents and in total size for different types of sculptured surface but in every case is divided into 4 major sections, these are: Section 1: Surface header table. Section 2: Patch header tables. Section 3: Patch geometry data. Section 4: Patch topology data. Section 1 always consists of precisely 10 real numbers. In the first location is a record number which identifies the location of the data on external storage, this is not output by the PUNCH command. Locations 2 to 10 contain precisely the data printed out as the SS header table in the normal verification listing for the surface . Location 2 = Total size of Section 3 (Patch geometry data). Location 3 = Total size of Section 4 (Patch topology). Location 4 = Number of patches. Location 5 = Type of topology structure (1.0 for general topology, 2.0 for a mesh structure). Location 6 = Type of single patch input (1.0, 2.0 or 3.0 for PNTVEC, POLYGN, PNTSON respectively any other value is irrelevant). Location 7 = Sign of surface normal (+1.0 or -1.0). Location 8 = Total size of surface canonical array. Location 9 = Number of spline curves in surface. Location 10 = Number of cross spline curves in surface. Note that the contents of locations 9 and 10 relate only to a mesh type surface. 120 Section 2 contains the header table for each patch and consists of a block of 6 data items for each patch. For each of these blocks the individual items, for a bicubic patch type of surface are: 1st entry: Flag for x coordinate matrix type. 2nd entry: Flag for y coordinate matrix type. 3rd entry: Flag for z coordinate matrix type. 4th entry: Flag for w coordinate matrix type. 5th entry: Location of start of patch geometry data in canonical array. 6th entry: Location of start of patch topology data. The flag which defines the matrix type for the coordinate data takes one of 4 possible values. These are 1.0 for a single number, 2.0 for patch corner points only, 3.0 for points and tangent vectors but zero twist and 4.0 for a full 4*4 matrix corresponding to the PNTVEC type of data for each patch. For the RS example the data in location 2 to 25 of the canonical form was: 2: 263.000000, 8.000000, 2.000000, 2.000000 6: 6.000000, 1.000000, 293.000000, 2.000000 10: 3.000000, 23.000000, 91.000000 0.000000 14: 0.000000, -1.000000, 286.000000 155.000000 18: 223.000000, 0.000000, 0.000000 -1.000000 22: 290.000000, 0.000000, 1.000000 10.000000 For this data the contents of locations 2 to 10 are the surface header table and can be compared directly with the verification listing in Section 5.1.1 of this Chapter. The header table for patch 1 is contained in locations 11 to 16 of this canonical form. This block of 6 data items follows the alternative format for a GENCUR type surface. For this type of surface the interior of the patch is interpolated directly from the boundary curves by subroutine CNSURF rather than using the bicubic form of definition. The items in this block are: Item 1 (Locaton 11): Start of geometric data for boundary curve 1. Item 2: Start of boundary curve 2 data. Item 3: Start of data (if any) for boundary curve 3. Item 4: Start of data for boundary curve 4. Item 5: Two digit flag to indicate type of interpolation. Item 6: Location of start of topology table. 121 The flag in item 5 is a negative two digit number -AB.0 where A = 0 if boundary curves 3 and 4 (in the v parametric direction) are absent, A = 1 if the interpolation between boundaries 3 and 4 is by rulings and A = 2 if tangent vectors are also used to calculate the interpoltion in this direction. The second digit B refers to the interpolation between boundary curves 1 and 2. B = 1 for a ruled surface, and B = 2 if CRSSPL tangent vectors are used in the interpolation. In the example above, locations 11 and 12 contain the numbers 23 and 91 and location 16 contains -1.0. This indicates that the patch is a simple ruled surface between 2 boundary curves whose canonical forms begin in locations 23 and 91 respectively. Locations 17 to 22 contain corresponding data for patch 2. Locations 23 and 24 contain the first two data items of the canonical array for boundary curve 1. Note that this curve canonical array will contain simple geometric data and flow data. Section 3 contains all the patch geometry data. For a bicubic patch type surface this will consist, for each patch, of 4 matrices giving the homogeneous coordinates of the type defined in the first 4 entries of the patch header table. For a GENCUR type surface, which is defined in terms of its boundary curves, the data in this section consists entirely of curve canonical forms. Section 4 contains the topology data which defines the manner in which the patches are inter-connected to form the surface. For each boundary of each patch the topology table gives the number (if any) of the adjoining patch. With the simple rectangular topology currently implemented in the system the topology table for each patch has 4 entries. Note that for reference purposes in the topology table (but not in the GENCUR surface geometry definition) the boundary curves are: Boundary 1: From u=0, v=0 to u=1, v=0 (AB in Fig. 5.1) Boundary 2: From u=0, v=0 to u=0, v=1 (AD in Fig. 5.1) Boundary 3: From u=1, v=0 to u=1, v=1 (DE in Fig. 5.1) Boundary 4: From u=0, v=1 to u=1, v=1 (BE in Fig. 5.1) For the canonical form of surface RS the topological data of Section 4 starts in loction 286, it consists of: 286: 0.000000, 0.000000 2.000000, 0.000000 290: 0.000000, 1.000000, 0.000000, 0.000000 This data confirms that patch 2 is adjacent to boundary 3 of patch 1 and that patch 1 is the only neighbour of patch 2 joining it along boundary 2. 122 The total size of the canonical array depends upon surface type. The surface header table always contains precisely 10 data items. The individual patch headers and topology tables account for 10 data items per patch. The data in Section 3 is however dependent upon the surface type as well as the number of patches.## 5.2 'TRANSL' TYPE CROSS PRODUCT SURFACE

Each of the cross product surface definitions uses two curves to define a sculptured surface. The two curves are referred to as the profile curve and the control curve and the surface can be considered the result of manipulating the profile curve in a manner directed by the control curve. The simplest type of cross product surface is the translation in which the surface is generated by translating, or sweeping, the profile curve along the control curve. The resulting surface is such that each parametric curve v = constant is a geometric copy of the profile curve and each member of the family of curves u = constant is like the control curve. Mathematically the relationship between points on the profile and control curves and a point on the surface can be simply described. If the profile curve has equation r = r (u) and - - the control curve is r = r (v) then the point r(u,v) on the - - - surface is given by the vector sum r(u,v) = r (u) + r (v). - - - Clearly this relationship is symmetrical and precisely the same surface is defined if the profile curve and control curve are interchanged. The format of the definition is SURF = SSURF/TRANSL,C1,CROSS,C2 In this definition C1 and C2 are previously defined SCURVs, C1 is the profile curve and C2 the control curve or 'cross command' curve.## 5.2.1 TORUS EXAMPLE

As an example of a TRANSL definition a torus like figure can be generated by sweeping a small circle round a larger circle. It is necessary that the larger circle should pass through the centre of the small circle and lie in an orthogonal plane. In the statements below the circles are first defined by COMBIN statements from semi-circular CURSEG curves, the final statement defines the torus which has major and minor radii of 15 and 5 respectively. 123 P1 = POINT/-5,0,0 P2 = POINT/5,0,0 T1 = VECTOR/0,1,0 T2 = VECTOR/0,0,1 T3 = VECTOR/1,0,0 T4 = VECTOR/0,0,-1 Q1 = POINT/0,0,0 Q2 = POINT/15,0,15 Q3 = POINT/30,0,0 Q4 = POINT/15,0,-15 C1 = SCURV/CURSEG,P1,TANSPL,T1,P2 C2 = SCURV/CURSEG,P2,P1,TANSPL,T1 C3 = SCURV/COMBIN,C1,C2 C4 = SCURV/CURSEG,Q1,TANSPL,T2,Q2 C5 = SCURV/CURSEG,Q2,TANSPL,T3,Q3 C6 = SCURV/CURSEG,Q3,TANSPL,T4,Q4 C7 = SCURV/CURSEG,Q4,Q1,TANSPL,T2 C8 = SCURV/COMBIN,C4,C5,C6,C7 TORUS = SSURF/TRANSL,C3,CROSS,C8 In these statements C3 is defined as a circle centred 0 of radius 5 in the plane z = 0 and C8 is of radius 15 centred at 15,0,0 in the plane y = 0. C3 has 2 segments and C8 has 4 segments. The torus is then defined as a TRANSL type CROSS product with C3 as the profile curve and C8 as the control curve. The torus itself consists of 8 patches. Because C8 passes through the origin C3 actually lies on the surface with C1 as a boundary of patches 1 and 7 and C2 as a boundary of patches 2 and 8. Note that neither the profile curve or control curve had a flow structure, this is not necessary and, even if present, would be ignored for all types of cross product surface. 124 On the torus all parametric curves v = constant are circles of radius 5 and all parametric curves u = constant are circles of radius 15 in planes parallel to y = 0. If the torus had instead been defined as TORUS = SSURF/TRANSL,C8,CROSS,C3 the resulting surface would be identical in shape but the parametric curves v = constant would now be circles of radius 15. The detailed output for a patch of a cross product surface has a different format from that previously described. For patch 1 of the torus the data is: X Y Z W PATCH NUMBER 1 PT00 -5.000 0.000 0.000 0.333 PT10 5.000 0.000 0.000 0.333 TN00 0.000 10.000 0.000 -0.666 TN10 0.000 -10.000 0.000 0.666 CR00 0.000 0.000 21.212 -0.194 CR10 0.000 0.000 21.212 -0.194 TW00 -1.952 -1.952 -14.142 0.391 TW10 -1.952 1.952 -14.142 -0.391 X Y Z W PT01 10.000 0.000 15.000 0.333 PT11 20.000 0.000 15.000 0.333 TN01 0.000 10.000 0.000 -0.666 TN11 0.000 -10.000 0.000 0.666 CR01 21.212 0.000 0.000 0.194 CR11 21.212 0.000 0.000 0.194 TW01 -18.047 1.952 -5.857 -0.391 NRI NRJ NRK NR00 1.00000 0.00000 0.00000 NR50 0.00000 -1.00000 0.00000 NR10 -1.00000 0.00000 0.00000 NR01 0.00000 0.00000 -1.00000 NR51 0.00000 -1.00000 -0.00001 NR11 0.00000 0.00000 1.00000 NR05 0.70710 0.00000 -0.70710 NR15 -0.70710 0.00000 0.70710 FLAGS 4,4,4,4, B1 = 0, B2 = 0, B3 = 2, B4 = 3 PT55 4.393 5.000 10.607 NR55 0.0000 -1.0000 0.0000 PATCH AREA = 170.71067 CURVATURES = 0.4000 0.0000 MEAN & GAUSS = 0.2000 0.000 RADII = 2.5000 100000.000 125 Figure 5.4 Figure 5.5 126 Much of this data has the same interpretation as the ruled surface output, once more the W coordinates should be ignored. For this type of surface the data now includes the tangent vectors in the spline direction (TN) and in the cross spline direction (CR), these vectors are the values of dr/du and - dr/dv at the appropriate points. - Also included are the so called 'twist vectors' (TW) at the patch corners. These are the values of d(dr/du)dv but it - should be noted that a non zero value of this quantity does not necessarily mean that the surface is twisted in any normal geometric sense. A more detailed examination of this data shows that the surface defined is not quite a true torus. The parametric curve v = 1 is indeed a semi-circle of radius 5 centred at the point (15,0,15) but it lies in the plane z = 15 rather than in the plane x = 15; this can be seen by inspecting the point and tangent (TN) data at 01 and 11. With this type of construction the profile curve has been simply translated rather than translated and rotated as would be necessary to produce a solid of revolution. The topology data shows that internally the figure is not stored as a closed surface, B1 should adjoin patch 7 and B2 should adjoin patch 2. These errors arise because C3 and C8 were not recognised as closed curves. Figure 5.4 shows the construction curves and Figure 5.5 shows the complete surface from the same viewpoint.## 5.2.2 SPLINE CURVE EXAMPLE

In the previous example the profile curve and the control curve were both plane curves, this, together with the fact that one of the curves passed through the origin, produced a simple surface. If both construction curves are spline curves in 3-D space the surface defined by the TRANSL definition is more complex but bears a similar relationship to the two basic curves containing copies of these curves in the two parametric directions. 127 Figure 5.6 128 P1 = POINT/1,0,1 P2 = POINT/2,-1,2 P3 = POINT/3,-2,2 P4 = POINT/5,-1,3 Q1 = POINT/0,0,5 Q2 = POINT/2,3,7 Q3 = POINT/3,4,6 Q4 = POINT/5,2,7 C1 = SCURV/SPLINE,P1,P2,P3,P4 C2 = SCURV/SPLINE,Q1,Q2,Q3,Q4 TSURF = SSURF/TRANSL,C1,CROSS,C2 In the statements above C1 and C2 are defined as spline curves each with 3 segments. TSURF is then defined as a TRANSL type cross product surface with C1 as profile curve and C2 as control curve. This surface consists of 9 patches and is illustrated in Figure 5.6. Because neither of the construction curves passes through the origin neither of these curves is contained in the surface.## 5.3 ROTATIONAL TYPES OF CROSS PRODUCT SURFACE

There are 3 types of cross product surface which are defined by a form of generalised rotation plus scaling from the profile curve. In each case the rotation is determined by the projection of the control curve onto one of the axial planes. The general form of the definition is, XYROT surfname = SSURF/YZROT, curve 1,CROSS,curve 2 ZXROT For XYROT the control curve is projected onto the XY plane and the surface is formed by a generalised rotation of the profile curve about the z axis. The angle of rotation depends upon the angular distance from the point on the control curve to the x axis and the scaling factor is the distance from the origin to the projection onto the XY plane of the control curve. In the simplest case a surface of revolution is produced if the control curve (C2) is a circular arc centred at the origin of the XY plane, in all other cases the 'radius' varies during the revolution. 129 Figure 5.7 Figure 5.8 130## 5.3.1 SIMPLE XYROT EXAMPLE

As a simple example of this variable radius rotation we consider the case where the control curve lies on the XY plane and the profile curve lies in the YZ plane. P1 = POINT/0,2,1 P2 = POINT/0,1.8,2 P3 = POINT/0,2.2,3 P4 = POINT/0,2,5 Q1 = POINT/0,-1,0 Q2 = POINT/1.8,0,0 Q3 = POINT/0,0.4,0 C1 = SCURV/SPLINE,P1,P2,P3,P4 C2 = SCURV/SPLINE,Q1,Q2,Q3 ROTSUR = SSURF/XYROT,C1,CROSS,C2 Figure 5.7 shows the two curves used to define the surface ROTSUR. For this surface the 'radius' depends upon the distance from points on curve C2 to the origin. This distance increases from 1 at Q1 to a maximum of 1.8 at Q2 before reducing to a minimum value of 0.4 at Q3. The profile curve is rotated through 180 degrees (angle 0Q1Q3) to form the surface. Figure 5.8 shows the surface which has been defined by the above statements. This surface consists of 6 patches and is represented by the constant parameter lines at intervals of 0.5 in each direction. The scaling effect can be most clearly seen in the varying degrees of undulation for the parametric curves in the u direction which all have a similar profile to C1. 131 132## 5.3.2 MORE GENERAL XYROT EXAMPLES

The effect of the XYROT construction on curves which are not simple plane curves is more difficult to visualise but can be described in simple mathematical terms. The construction curves C1 and C2 have vector parametric equations: C1 : r = r1(u) = ( x1(u), y1(u), z1(u) ) - - C2 : r = r2(v) = ( x2(v), y2(v), z2(v) ) - - Since the generalised rotation takes place about the z axis neither z1(u) nor z2(v) are relevant to this part of the operation. The x and y coordinates x(u,v) and y(u,v) of the point r(u,v) on the surface are obtained by rotating (x1(u), y1(u)) and scaling the distance from the origin, both the angle of rotation and the scaling factor are specified by (x2(v), y2(v)). In fact this generalised rotation is exactly analogous to the product of complex numbers. If w1 = x1(u) + i y1(u) and w2 = x2(v) + i y2(v) then x(u,v) and y(u,v) are the real and imaginary parts of w1*w2, z(u,v) is not defined by the rotation but is defined by the system as z(u,v) = z1(u) + z2(v) this is a simple translation along the z axis. Since for complex numbers w1*w2 = w2*w1 we can deduce that the relationship between the two curves in the surface definition is actually a symmetric one and precisely the same surface, but with interchanged parameters, is defined by the alternative statement: RSURF = SSURF/XYROT,C2,CROSS,C1 For two general curves, neither of which lies in the XY plane the effect of the XYROT definition is that of a generalised rotation, with varying radius, about the z axis together with a translation along the z axis. If either curve passes through the origin there is likely to be a singular point on the surface in the corresponding position. An example of this situation is: 133 Figure 5.9 Figure 5.10 134 P1 = POINT/-3,0,3 P2 = POINT/-0.5,3,1 P3 = POINT/1.5,2.4,1 P4 = POINT/3.5,0,2 Q1 = POINT/-1,1,-2 Q2 = POINT/0,0,0 Q3 = POINT/1,-2.1,3 Q4 = POINT/2.5,-2.4,4.8 C1 = SCURV/SPLINE,P1,P2,P3,P4 C2 = SCURV/SPLINE,Q1,Q2,Q3,Q4 SRF2 = SSURF/XYROT,C1,CROSS,C2 In this example both the profile curve C1 and the control curve C2 are 3 dimensional spline curves but the point Q2 is at the origin. SRF2 is formed by rotating, scaling and translating C1 and consists basically of 9 patches. Figure 5.9 shows the construction curves and Figure 5.10, which is drawn to a different scale, shows the surface SRF2. The singular point of SRF2 lies on the second cross-spline (u=1) of the surface and is due to the facts that Q2 is at the origin and P2 and P3 have the same z coordinate. Note that only a section of the parametric curve v = 1 corresponds to this singular point the remainder of this curve is a section of the z axis. Although the surface SRF2 has been geometrically defined it would in practice be difficult to machine. The singularity could be removed by re-defining Q2 so that its x and y coordinates are non-zero. (Simply making the z coordinate non zero would merely translate the singular point on the surface). For example Q2 = POINT/0.3,-0.5,0 will produce the surface shown in Figure 5.11 if the remainder of the statements above are unaltered. 135 Figure 5.11 Figure 5.12 136## 5.3.3 YZROT and ZXROT DEFINITIONS

Other definitions of the same type are YZROT and ZXROT. Like XYROT these definitions use the control curve data to define a generalised rotation plus translation. The axes of rotation are the X axis for YZROT and the Y axis for ZXROT. The rotation and scaling is determined by projecting the control curve onto the YZ plane or (for ZXROT) the ZX plane. Unless the control curve lies in the appropriate plane there is also a translation along the axis of rotation. As an example, using the data from Section 5.3.2 with Q2 = POINT/0.3,-0.5,0 SRF3 = SSURF/ZXROT,C1,CROSS,C2 defines the surface shown in Figure 5.12.## 5.4 THE SCALE TYPE OF CROSS PRODUCT SURFACE

The final type of cross product definition uses the data from the control curve to define a generalised scaling operation which is applied to the profile curve in order to define the surface. This operation has a particularly simple mathematical description but the geometry of the final surface can be difficult to visualise from a knowledge of the component curves. If the component curves are C1 : r (u) = (x1(u), y1(u), z1(u)) (Profile curve) and C2 : r (v) = (x2(v), y2(v), z2(v)). (Control curve) Then the surfaces SRFSC = SSURF/SCALE,C1,CROSS,C2 has the parametric vector equation r(u,v) = (x(u,v), y(u,v), z(u,v)) where x(u,v) = x1(u) x2(v) y(u,v) = y1(u) y2(v) z(u,v) = z1(u) z2(v) 137 Figure 5.13 138 These equations show that scaling factors of x2(v), y2(v) and z2(v) are applied independently to the x,y and z components of points on the profile curve. The surface has parametric curves in the u direction (v = constant) which are generally distortions of the profile curve. Since the relationship between the profile and control curves is again symmetrical all parametric curves in the v direction are distortions of the control curve. Again the same surface but with interchanged parameters is defined by: SRFSC = SSURF/SCALE,C2,CROSS,C1## 5.4.1 SIMPLE SCALE EXAMPLE

A simple scaling effect is produced if the profile curve is a plane curve in a plane parallel to an axis plane and the control curve is a straight line whose extension passes through the origin. As an example: P1 = POINT/-3,0,2 P2 = POINT/0,3,2 P3 = POINT/3,0,2 Q1 = POINT/1,2,2 Q2 = POINT/2,4,4 Q3 = POINT/3,6,6 C1 = SCURV/CURSEG,P1,P2,P3 C2 = SCURV/SPLINE,Q1,Q2,Q3 SRFSC = SSURF/SCALE,C1,CROSS,C2 In this example C1 is semi-circle in the plane z = 2. C2, although a straight line, has been deliberately defined in terms of 3 points in order to define a surface with more patches. The extension of C2 passes through the origin and at any point the x,y and z components are in the ratio 1:2:2. SRFSC is obtained from C1 by applying scaling factors in the X and Y directions which are always in the ratio of 1:2 and translating in the Z direction. The resulting surface is somewhat similar to a cone but has elliptic cross section. The surface is shown in Figure 5.13 together with the construction curves. 139 Figure 5.14 Figure 5.15 140## 5.4.2 MORE GENERAL EXAMPLES

Unlike the TRANSL definition the nature of the SCALE type of cross product surface is such that the geometry of the surface defined depends not only upon the geometric shape of the construction curves but also on their position in space relative to the origin. Particular care should be taken when using curves which have one or more zero coordinates at any point. If, for example, in the previous section C1 had been defined as a semi-circle in the XY plane (z = 0) then the entire surface would lie in this plane. Clearly if either curve passes through the origin there will be a corresponding singular point at the origin on the surface being defined. A similar problem will arise if the zero coordinates on one curve coincide with the non zero coordinates at some points on the other curve. (e.g. P2 = (0,2,0), Q3 = (1,0,-1), Q4 = (2,0,3)) If these singularity problems are avoided and C1 and C2 are spline curves in 3 dimensional space which do not pass through the origin then the surface produced from the SCALE definition will generally contain constant parametric curves which bear some similarity to the construction curves and will have an area which depends upon the distances from the origin to the construction curves. Even if the curves have arcs of approximately equal length the surface patches are unlikely to be of similar areas. Examples: P1 = POINT/-3,0,3 P2 = POINT/-0.5,3,1 P3 = POINT/1.5,2.4,1 P4 = POINT/3.5,0,2 Q1 = POINT/-1,1,-2 Q2 = POINT/1,-1,0 Q3 = POINT/1,-2.1,3 Q4 = POINT/2.5,-2.4,4.8 C1 = SCURV/SPLINE,P1,P2,P3,P4 C2 = SCURV/SPLINE,Q1,Q2,Q3,Q4 SURFS2 = SSURF/SCALE,C1,CROSS,C2 In the statements above C1 and C2 are defined as spline curves, each of 3 arcs and SRFS2 is then defined as a SCALE type cross product surface. Figure 5.14 illustrates the surface and Figure 5.15 shows the two construction curves C1 and C2. The similarities in shape between C1 and the spline curves (v = constant) on the surface and between C2 and the cross spline curves can be clearly seen. 141 142