CHAPTER 3

MODIFICATION OF PARAMETRIC CURVES


This chapter describes a number of facilities for modifying simple parametric curves of the type described in Chapter 2. Some of these modifications change the actual shape of the curve, other modifications merely alter its position in space or change the parameterisation. Section 3.1 is concerned with the smoothing of spline curves, this is the most drastic modification which can affect the position of some, or all, of the data points. Section 3.2 is concerned with reparameterisation, this has no geometric affect upon the curve itself but can modify the shape of surfaces defined from the curve. Section 3.3 describes the division of curves into segments. Section 3.4 introduces an alternative splining algorithm which modifies the shape of a spline curve between data points. In the final section a method of using geometric transformation matrices to define new curves is described.

3.1 SMOOTHING

The operation of smoothing can only be carried out on SPLINE curves. Such curves are smoothed automatically, i.e. the definition data points are moved according to criteria specified in the SPLINE definition, in order to remove undesired oscillations in the curves. The criterion used in the existing algorithm is the minimisation of a quantity approximating to the integral over the curve of the square of the curvature. This is analogous to the internal energy of a thin beam. Constraints are, however, required since the unconstrained solution is an indeterminate straight line. The constraints are specified by the user during the SPLINE definition. They are of two types, WEIGHT and LIMIT.

3.1.1 WEIGHT CONSTRAINT

The mathematical model shown in Figure 3.1 is used. The curve is assumed to be attached by springs to the corresponding original data points, and the resulting smoothed curve is that which minimises the total energy of the system. This, of course, depends upon the stiffness of each spring, specified by a WEIGHT. 53 Figure 3.1 54 A WEIGHT can have a value ranging from 0 to 1. 0 corresponds to near zero stiffness, while 1 corresponds to infinite stiffness, in which case the data point is fixed. The example in Figure 3.1 was produced by the following SPLINE definition: P1 = POINT/0,0,0 P2 = POINT/1,1,0 P3 = POINT/2,0,0 P4 = POINT/3,1.5,0.5 P5 = POINT/4,1,1 CNAME = SCURV/SPLINE, WEIGHT,0.5,$ P1,WEIGHT,1,$ P2,P3,P4,$ P5,WEIGHT,1 The first WEIGHT, which appears before any of the points, is global, applying to all points. It can be countermanded by specifying a WEIGHT for a particular point after its appearance in the SPLINE definition. Hence, in the example, P1 and P5 have WEIGHT 1 and P2,P3 and P4 have WEIGHT 0.5. The default WEIGHT is 1 and hence, if no weights appear in the definition, smoothing does not take place. Parts of the verification listings for the two curves in Figure 3.1 are shown below. 55 Unsmoothed curve: PARAM XCOORD YCOORD ZCOORD CURVATURE ARC NUMBER 1 0.0000 0.0000 0.0000 0.0000 0.2611 0.2500 0.2365 0.4072 0.0012 0.3048 0.5000 0.4997 0.7408 0.0031 0.5512 0.7500 0.7631 0.9540 0.0035 1.6083 1.0000 1.0000 1.0000 0.0000 4.5062 ARC NUMBER 2 0.0000 1.0000 1.0000 0.0000 2.7253 0.2500 1.2837 0.8082 -0.0132 0.3205 0.5000 1.5265 0.4828 -0.0261 0.0821 0.7500 1.7560 0.1660 -0.0259 0.9173 1.0000 2.0000 0.0000 0.0000 4.1699 ARC NUMBER 3 0.0000 2.0000 0.0000 0.0000 1.2098 0.2500 2.1134 0.1922 0.0381 0.1799 0.5000 2.3100 0.6501 0.1307 0.2235 0.7500 2.6017 1.1580 0.2829 0.5559 1.0000 3.0000 1.5000 0.5000 1.3269 ARC NUMBER 4 0.0000 3.0000 1.5000 0.5000 3.3289 0.2500 3.2047 1.5055 0.6075 1.4868 0.5000 3.4484 1.3986 0.7288 0.5019 0.7500 3.7180 1.2175 0.8607 0.1615 1.0000 4.0000 1.0000 1.0000 0.0306 56 Smoothed curve: PARAN XCOORD YCOORD ZCOORD CURVATURE ARC NUMBER 1 0.0000 0.0000 0.0000 0.0000 0.2043 0.2500 0.2363 0.1414 -0.0160 0.2463 0.5000 0.4798 0.2679 -0.0233 0.3030 0.7500 0.7306 0.3740 -0.0232 0.3698 1.0000 0.9888 0.4547 -0.0170 0.4392 ARC NUMBER 2 0.0000 0.9888 0.4547 -0.0170 0.4407 0.2500 1.2240 0.5031 -0.0068 0.2556 0.5000 1.4616 0.5388 0.0106 0.1793 0.7500 1.6977 0.5732 0.0381 0.3069 1.0000 1.9288 0.6179 0.0791 0.5066 ARC NUMBER 3 0.0000 1.9288 0.6179 0.0791 0.5079 0.2500 2.2395 0.7107 0.1626 0.3000 0.5000 2.5389 0.8227 0.2721 0.1796 0.7500 2.8332 0.9298 0.4009 0.2747 1.0000 3.1284 1.0082 0.5426 0.4732 ARC NUMBER 4 0.0000 3.1284 1.0082 0.5426 0.4720 0.2500 3.3461 1.0358 0.6504 0.3874 0.5000 3.5654 1.0405 0.7620 0.3061 0.7500 3.7841 1.0270 0.8783 0.2372 1.0000 4.0000 1.0000 1.0000 0.1880 From these listings it can be seen, on examination of the curvature values, that on the whole there has been a reduction in curvature. In particular there is a much more uniform spread replacing the high peaks in curvature at the arc junction points. The discontinuities in curvature at these points are also much smaller. The price paid for these improvements is an increase in curvature towards the end of arc 4 and in the middle of arcs 2 and 3, though these are relatively small. 57 Figure 3.2 Figure 3.3 58

3.1.2 LIMIT CONSTRAINT

A LIMIT constraint, as the name suggests, specifies a maximum distance through which a point may be moved. LIMITS are effected immediately after smoothing with WEIGHT constraints by moving any point which has exceeded its LIMIT back along a straight line towards the original data point, until the boundary sphere specified by the LIMIT is reached. The format for LIMITS is the same as that for WEIGHTS, global definitions being possible. The default LIMIT is 0 which means no LIMIT. Care should be taken with WEIGHT values when using LIMITS. In particular, points with low WEIGHT may be initially moved several times the specified LIMIT and their moving back then cause undesirably high curvature. The two examples in Figure 3.2 and Figure 3.3 illustrate the difference that can occur when zero WEIGHTS are used indiscriminately. The SPLINE definitions are: Figure 3.2: CNAME = SCURV/SPLINE,WEIGHT,0.5,LIMIT,0.3,$ P1,WEIGHT,1,$ P2,P3,P4,$ P5,WEIGHT,1 Figure 3.3: CNAME = SCURV/SPLINE,WEIGHT,0,LIMIT,0.3,$ P1,WEIGHT,1,$ P2,P3,WEIGHT,0.75,$ P4,P5,WEIGHT,1 From the verification listing extracts below it can be seen that though there is not much difference in the overall curvature (Figure 3.3 has slightly greater curvature than Figure 3.2), there is a greater variation in curvature in Figure 3.3 with regions of undesirably high curvature, in particular at the junction points of arcs 1 and 2, and 2 and 3. 59 Figure 3.2: PARAM XCOORD YCOORD ZCOORD CURVATURE ARC NUMBER 1 0.0000 0.0000 0.0000 0.0000 0.3826 0.2500 0.2205 0.2851 -0.0071 0.4640 0.5000 0.4690 0.5151 -0.0095 0.7167 0.7500 0.7314 0.6626 -0.0095 1.2965 1.0000 0.9939 0.7002 -0.0094 2.0559 ARC NUMBER 2 0.0000 0.9939 0.7002 -0.0094 1.7941 0.2500 1.2501 0.6222 -0.0102 0.7521 0.5000 1.4959 0.4853 -0.0070 0.1385 0.7500 1.7338 0.3548 0.0068 0.9884 1.0000 1.9659 0.2956 0.0379 2.5336 ARC NUMBER 3 0.0000 1.9659 0.2956 0.0379 4.5675 0.2500 2.2087 0.4112 0.1029 0.9740 0.5000 2.4630 0.6819 0.2079 0.1210 0.7500 2.7462 0.9883 0.3496 0.5098 1.0000 3.0755 1.2107 0.5251 1.1656 ARC NUMBER 4 0.0000 3.0755 1.2107 0.5251 1.7872 0.2500 3.2839 1.2446 0.6335 1.1543 0.5000 3.5138 1.2072 0.7497 0.6139 0.7500 3.7557 1.1188 0.8724 0.3104 1.0000 4.0000 1.0000 1.0000 0.1396 60 Figure 3.3: PARAM XCOORD YCOORD ZCOORD CURVATURE ARC NUMBER 1 0.0000 0.0000 0.0000 0.0000 0.3199 0.2500 0.2366 0.2943 -0.0089 0.4063 0.5000 0.4941 0.5302 -0.0137 0.6928 0.7500 0.7553 0.6762 -0.0158 1.4821 1.0000 1.0031 0.7005 -0.0166 2.7140 ARC NUMBER 2 0.0000 1.0031 0.7005 -0.0166 2.1661 0.2500 1.2732 0.5687 -0.0176 0.8163 0.5000 1.5199 0.3507 -0.0142 0.1082 0.7500 1.7557 0.1410 0.0008 1.0123 1.0000 1.9935 0.0342 0.0342 3.2388 ARC NUMBER 3 0.0000 1.9935 0.0342 0.0342 11.9768 0.2500 2.1806 0.1719 0.0853 0.7728 0.5000 2.4116 0.6158 0.1786 0.1460 0.7500 2.7019 0.9123 0.3190 0.5005 1.0000 3.0672 1.2078 0.5112 1.0948 ARC NUMBER 4 0.0000 3.0672 1.2078 0.5112 2.1552 0.2500 3.2687 1.2483 0.6175 1.2843 0.5000 3.4987 1.2112 0.7365 0.6057 0.7500 3.7461 1.1205 0.8651 0.2664 1.0000 4.0000 1.0000 1.0000 0.0825 61 Figure 3.4 62

3.1.3 VECTOR CONSTRAINTS IN SMOOTHING

Vector constraints can be used in conjunction with WEIGHT and LIMIT constraints. Figure 3.4 shows the SPLINE defined in Figure 3.1 with a TANSPL constraint put on P3, it being TANSPL, 1,0,0.25, and also the smoothed version, using the same WEIGHTS as in Figure 3.1. Part of the verification listing for the end of arc 2, beginning of arc 3 is given for the smoothed curve to show the TANSPL constraint is still satisfied, even though the attached data point has moved. PARAM XCOORD YCOORD ZCOORD UTAN-I UTAN-J UTAN-K ARC NUMBER 2 1.0000 1.9288 0.6179 0.0791 0.9701 0.0000 0.2425 ARC NUMBER 3 0.0000 1.9288 0.6179 0.0791 0.9701 0.0000 0.2425 63 64

3.1.4 SMOOTHING INFORMATION IN THE CANONICAL ARRAYS

The WEIGHT and LIMIT information specified in the SPLINE definition is stored in the fifth group of each block of the interim canonical array. The array for the smoothed SPLINE of Figure 3.2 is given below. INDEX = 1 0.000 1.000 2.000 5.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.500 0.300 0.000 0.000 0.000 0.000 0.000 0.000 INDEX = 25 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 1.000 0.300 0.000 0.000 0.000 0.000 0.000 0.000 INDEX = 49 1.000 1.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.500 0.300 0.000 0.000 0.000 0.000 0.000 0.000 INDEX = 73 2.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.500 0.300 0.000 0.000 0.000 0.000 0.000 0.000 INDEX = 97 3.000 1.500 0.500 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.500 0.300 0.000 0.000 0.000 0.000 0.000 0.000 INDEX = 121 4.000 1.000 1.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 1.000 0.300 0.000 0.000 0.000 0.000 0.000 0.000 The header block contains the global values of the WEIGHT and LIMIT in the first two numbers of the fifth group, if specified in the definition. Despite the default WEIGHT being 1, a 0 is stored in this case. The default LIMIT of 0 is stored if not specified. The first two numbers of the fifth group of each of the remaining blocks store the WEIGHT and LIMIT respectively, of the point to which the block corresponds. In this example the numbers are 1.000 and 0.300 or 0.500 and 0.300. 65 Figure 3.5 Figure 3.6 66

3.1.5 SMOOTHED CURVES IN SURFACE DEFINITION

It is possible to smooth SPLINE curves which are used to define SMESH or GENCUR sculptured surfaces. This can lead to problems when smoothing of the major SPLINES results in movements of data points producing less smooth cross SPLINES. An exaggerated example is given in Figures 3.5 and 3.6 in which the oscillations removed from the major SPLINES are reproduced to a similar extent in the cross SPLINES. The surface definitions are: Figure 3.5 CNAME = SSURF/SMESH, SPLINE,P1,P2,P3,P4,P5,$ SPLINE,P6,P7,P8,P9,P10,$ SPLINE,P11,P12,P13,P14,P15,$ SPLINE,P16,P17,P18,P19,P20,$ SPLINE,P21,P22,P23,P24,P25 Figure 3.6 CNAME = SSURF/SMESH,$ SPLINE,WEIGHT,0.5,P1,WEIGHT,1,$ P2,P3,P4,P5,WEIGHT,1,$ SPLINE,WEIGHT,0.5,P6,WEIGHT,1,$ P7,P8,P9,P10,WEIGHT,1,$ SPLINE,WEIGHT,0.5,P11,WEIGHT,1,$ P12,P13,P14,P15,WEIGHT,1,$ SPLINE,WEIGHT,0.5,P16,1,$ P17,P18,P19,P20,WEIGHT,1,$ SPLINE,WEIGHT,0.5,P21,WEIGHT,1,$ P22,P23,P24,P25,WEIGHT,1 where, P1 = POINT/0,0,0 P2 = POINT/1,1,0 P3 = POINT/2,-1,0 P4 = POINT/3,1,0 P5 = POINT/4,0,0 P6 = POINT/0,0,-1 P7 = POINT/1,1,-1 P8 = POINT/2,-1,-1 P9 = POINT/3,1,-1 P10 = POINT/4,0,-1 P11 = POINT/0,0,-2 P12 = POINT/1,1,-2 P13 = POINT/2,-1,-2 P14 = POINT/3,1,-2 P15 = POINT/4,0,-2 P16 = POINT/0,0,-3 P17 = POINT/1,1,-3 P18 = POINT/2,-1,-3 P19 = POINT/3,1,-3 P20 = POINT/4,0,-3 P21 = POINT/0,0,-4 67 Figure 3.7 Figure 3.8 68 P22 = POINT/1,1,-4 P23 = POINT/2,-1,-4 P24 = POINT/3,1,-4 P25 = POINT/4,0,-4

3.2 FLOW OF PARAMETRIC CURVES

The sculptured surfaces system provides via the FLOW structure the opportunity to re-parameterise a parametric SCURV. This re-parameterisation has no effect upon the geometric shape of the curve but does alter the parametric values associated with particular points of the curve. Any reparameterisation of this nature can have significant geometric effects on any surface defined from the curve. As a very simple example a ruled surface is constructed by joining with straight lines points with equal parameter values on two boundary curves. Reparameterisation can alter the direction of these lines and so modify the shape of the surface being created. A very simple example of this is illustrated in Figures 3.7 and 3.8. In each case the boundary curves for the ruled surface are semi-circles. In Figure 3.7 each semi-circle has the same parameterisation with the parameter proporitonal to the arc length of the curve, the result is half a circular cylinder. In Figure 3.8 both curves have been re-parameterised and clearly the resulting surface is not part of a circular cylinder. The FLOW facility offers the user 3 separate methods to control the variation of the parameter along an SCURV. These methods are described in detail in the following sections. It should be noted that in each case the computation is performed by establishing a relationship, via a spline function, between the natural parameter used to define the curve and the new flow parameter. All geometric computations are performed by first determining the value of the natural parameter corresponding to the current value of the flow parameter.

3.2.1 ARC length FLOW

The most obvious method of re-parameterising a curve is to make the parameter proportional to the arc length of the curve. In the sculptured surfaces system the FLOW structure is added to the curve at the end of the geometric definition. It can also be added to a previously defined curve by using the COMBIN facility described in Section 2.3. The format for the flow data is devided into two parts, the first part defining precisely how the new FLOW parameter will vary along the curve, the second part defines the subsequent sub-division of the curve into segments. 69 Figure 3.9 70 Example: P1 = POINT/-5,0,0 P2 = POINT/0,5,0 P3 = POINT/5,0,0 C1 = SCURV/CURSEG,P1,P2,P3,FLOW,ARC,0,1,SEG,LENGTH,0,1 These statements define a circular arc, in fact a semi-circle of radius 5, and make the flow parameter proportional to the arc length. This applies to the first arc (in fact the only arc) of the curve and the curve is finally formed into a single segment. Figure 3.9 shows 9 points at equally spaced parametric intervals for both the natural parameter (upper picture) and the flow parameter. The verification listing for this curve contains: PARAM XCOORD YCOORD ZCOORD UTAN-I UTAN-J UTAN-K 0.0000 -5.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.2500 -4.0000 3.0000 0.0000 0.6000 0.8000 0.0000 0.5000 0.0000 5.0000 0.0000 1.0000 0.0000 0.0000 0.7500 4.0000 3.0000 0.0000 0.6000 -0.8000 0.0000 1.0000 5.0000 0.0000 0.0000 0.0000 -1.0000 0.0000 FLOW TYPE = ARC TOLERANCE FACTOR = 0.0050 ARC LENGTH = 15.6756 NUMBER OF FLOW SPLINES = 6 FLOW RATE ACROSS CURVE BY SEGMENTS PARAM XCOORD YCOORD ZCOORD UTAN-I UTAN-J UTAN-K SEGMENT NUMBER 1 0.0000 -5.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.2500 -3.5360 3.5351 0.0000 0.7070 0.7072 0.0000 0.5000 -0.0064 5.0000 0.0000 1.0000 0.0013 0.0000 0.7500 3.5328 3.5383 0.0000 0.7077 -0.7066 0.0000 1.0000 5.0000 0.0000 0.0000 0.0000 -1.0000 0.0000 FIRST POINT = 0.0. LAST POINT = 1.0 TYPE OF FLOW = LENGTH TOTAL SPAN = 15.6756 Note: the verification listing also includes the values of UNORM, the curvature and the radius which have been omitted in this description. 71 A comparison of the two sets of coordinates show how the parameterisation of the curve has been changed by the flow statement. The quoted arc length of 15.6756 is a numerical approximation to the true arc length, which for this curve is precisely 5 * PI (15.70796). The process of assigning the flow parameter so that it is proportional to the arc length is also an approximate one, the tolerance factor defines the acceptable accuracy for this process. The reparameterisation is in fact done by establishing a cubic spline function which relates the natural parameter to the flow parameter. The number of data points used to define this function is given by the number of flow splines ( 6 in this example ). The coefficients for this spline function are contained in the canonical array. The approximate nature of the equivalence between the flow parameter and the arc length can be seen from the above listing; the coordinates corresponding to a flow parameter of 0.75 are 3.5328 and 3.5383 whereas the point at 0.75 arc length has coordinates ( 5 cos 45, 5 sin 45 ) = (3.5355, 3.5355). The user has the option of varying the tolerance for the flow splining. The default value of 0.005 used in this example gives a maximum error of less than 0.5%. If the user sets a smaller default value the time taken for the flow computation and the number of data points in the flow splines will be increased. If a tolerance factor is introduced, it is included in the flow statement immediately after the arc numbers. C1 could be re-defined with a tolerance of 0.001 if the definition statement is replaced by C1 = SCURV/CURSEG,P1,P2,P3,FLOW,ARC,0,1,0.001,SEG,LENGTH,0,1

3.2.2 CANONICAL ARRAY FOR A FLOW CURVE

For a flow curve the final canonical array contains extra data which relates to the flow and segment information. For the simple semi-circle introduced in the previous section we have: 72 FINAL SCURV HEADER TABLE 1.000 = 1. APT FILE RECORD NUMBER 1.000 = 2. NUMBER OF BLOCKS FOR HEADER 13.000 = 3. 1 = COMBIN, 2 = SPLINE, 3 = CURSEG 1.000 = 4. NUMBER OF CUBIC ARCS 25.000 = 5. LOCATION OF FIRST CUBIC ARC 1.000 = 6. NUMBER OF ROWS FOR FLOW DATA 49.000 = 7. LOCATION OF FIRST FLOW ROW 1.000 = 8. NUMBER OF ROWS FOR SEGMENTS 53.000 = 9. LOCATION OF FIRST ROW OF SEGMENTS 6.000 = 10. TOTAL NUMBER OF FLOW SPLINES 57.000 = 11. LOCATION OF FIRST FLOW SPLINE 80.000 = 12. TOTAL SIZE OF STRUCTURE 1.000 = 13. FIRST LOCATION OF STRUCTURE CANONICAL ARRAY INDEX = 1 1.000 1.000 13.000 1.000 25.000 1.000 49.000 1.000 53.000 6.000 57.000 80.000 1.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 INDEX = 25 -5.000 5.000 10.000 10.000 0.000 0.000 10.000 -10.000 0.000 0.000 0.000 0.000 1.000 1.000 -2.000 2.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 INDEX = 49 57.000 6.000 1.005 15.676 0.000 1.000 2.000 15.676 0.000 0.000 1.568 0.000 0.147 0.190 1.085 0.147 0.350 0.380 0.829 0.203 0.545 0.535 0.788 0.195 INDEX = 73 0.813 0.768 1.008 0.268 1.000 1.000 1.568 0.187 0.000 0.884 0.079 0.012 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 73 74 The interpretation of the header block is explained by the printed captions. Since the curve has only a single arc, all the geometric data is contained in the second block of the canonical form, the interpretation of this was explained in Section 2.4.2. The final two blocks commencing at INDEX=49 contain all the flow and segment data, as usual they are divided into groups of 4 real numbers. The first group (index 49 - 52) gives the basic definition of the flow. 57 is the position of the first 'flow spline', 6 is the number of flow splines. 1.005 defines the type of flow (1 for arc, 2 for angle, 3 for chord, 4 for parameter) and gives the tolerance (.005 in this case). The final entry of this group contains the arc length. The second group of data contains the segment information. The first two entries define the start and finish point for the segment. The third entry is a PARAM (=1.0) or LENGTH (=2.0) indicator, the final entry gives the total length of the segment (arc length in this case). The next 6 groups starting from INDEX = 57 contain the coefficients for the flow spline function. Each group contains data relating to one point on the flow parameter spline function. The first entry in each contains the flow parameter value, the second entry the corresponding natural parameter value, the third entry is a function derivative. In this example, starting from index 61 we have a flow parameter of 0.147 corresponding to a natural parameter of 0.190 and at this point the derivative of the natural parameter is 1.085. The final entry in each group and the final non-zero group contain data used internally by the subroutine CURFLO.

3.2.3 ANGLE specification of FLOW

The new FLOW parameter of a curve can be made proportional to the angle subtended by the curve at a chosen point outside the curve. In this case the flow parameter is made to vary in such a way that sections of the curve corresponding to the same increment of the flow parameter subtend the same angle at the specified point. The flow length of the curve is then the total angular span of the curve measured in radians. 75 Figure 3.10 76 For a simple plane curve the flow specification takes the form: FLOW,ANGLE,N1,N2,›TOL,!,P where N1 and N2 are the numbers of the points at the ends of the arc or arcs concerned, P is the point from which the angles are measured and ›TOL,! denotes the optional further specification of the flow tolerance. Example: P1 = POINT/-5,0,0 P2 = POINT/0,5,0 P3 = POINT/5,0,0 P4 = POINT/-4,0,0 C1 = SCURV/CURSEG,P1,P2,P3,FLOW,ANGLE,0,1,P4,SEG,LENGTH,0,1 These statements define a semi-circle though P1,P2,P3 with the flow determined by the angle subtended at the point P4 which is along the diameter. Figure 3.10 shows points at equally spaced flow parameter intervals on this curve and the corresponding angles subtended at P4. This particular flow curve was in fact used as one of the definition curves for the ruled surface illustrated in Figure 3.8. For a simple plane curve, as in the above example, the angles can be unambiguously specified by giving any point in the plane from which the angles are measured. For a twisted curve in 3 dimensional space the angular measurement is not so simple. In such cases the angles being measured will generally lie in different planes. The user has the option of choosing a particular plane for the curve to be projected onto before commencing the angular measurements. This selection can have a considerable impact upon the final flow parameters. 77 Figure 3.11 Figure 3.12 78 The format for the flow specification in this case is: FLOW,ANGLE,N1,N2,›TOL,!,P›,VECTOR! where the optional vector defines the normal to the projection plane. Example: A = POINT/0,0,0 B = POINT/2,0,0 C = POINT/3,1,5 D = POINT/4,3,6 P = POINT/2,2,6 V1 = VECTOR/0,0,1 C1 = SCURV/SPLINE,A,B,C,D,FLOW,ANGLE,0,3,P,SEG,LENGTH,0,3 C2 = SCURV/SPLINE,A,B,C,D,FLOW,ANGLE,0,3,P,V1,SEG,LENGTH,0,3 In this example, both C1 and C2 are defined as the spline curve through A,B,C, and D. The flow structure of each curve is defined in terms of the angles measured from the point P. For C1 the flow length of each arc is the angular span in radians measured in the plane of P and the end points of the arc. For C2 all measurements are taken after the curve has been projected into the XY plane (z=0). In the verification listings there is a marked difference in the flow length of the first arc which is 0.7844 (approximately PI/4) for C2 and only 0.3066 for C1. Figure 3.11 and 3.12 illustrate C1 and Figures 3.13 and 3.14 illustrate C2. In each case the points shown are equally spaced on the flow curves. These illustrate the way in which the choice of projection plane can have a considerable effect upon the flow of the curve. The choice of point P from which the angles are measured should also be made with some care. Clearly it will influence the flow properties of the curve but more importantly an inappropriate choice can produce an execution error when the program is run. If, in fact, P is in such a position that it is possible to draw a tangent from P to some point of the curve the angular displacements cannot be correctly defined in this vicinity and the result is an execution error (divide by zero). As an example of this if we redefine the point P4 of the first example as P4 = POINT/0,8,0 the part program will fail with this execution error. 79 Figure 3.13 Figure 3.14 80

3.2.4 CHORD specification of FLOW

The third alternative for re-parameterising a curve is in terms of projected lengths onto a chord. In the simplest case the chord spans from the first point to the end point of the curve and the direction of projection is normal to the chord. The flow length of the curve is the projected length of the curve in this direction, in this simple case it is equal to the chord length. Example: A = POINT/0,0,0 B = POINT/2,1,1 C = POINT/3,2,1 D = POINT/6,3,2 C1 = SCURV/SPLINE,A,B,C,D,FLOW,CHORD,0,3,SEG,LENGTH,0,3 The above statements define C1 as a spline curve through the points A,B,C and D. The flow is determined by the projected lengths of the curve onto the chord AD, the direction of projection being normal to AD. Figure 3.15 shows this curve together with the lines joining equally spaced points on the flow curve to points on the chord AD. Note that since the curve is a twisted curve in 3 dimensional space, these lines are not parallel but lie in parallel planes normal to AD. Rather than accepting the default option of projecting onto the chord of the SCURV the user has the option of defining the line onto which the curve is projected and/or defining the direction of projection. The complete format of this type of flow specification is: FLOW,CHORD,N1,N2›,TOL,!›,P1,P2!›,VECTOR! where the terms in › ! are optional. As before, TOL denotes the optional tolerance on the flow splining accuracy to replace the default value of 0.005. P1 and P2 are previously defined points used to specify the line onto which the curve is projected. VECTOR denotes a previously defined vector quantity used to specify the direction of projection. This vector in fact defines the normal to the planes of projection. 81 Figure 3.15 82 Either the pair of points, or the vector or both may be included in the flow specification. The examples below illustrate these concepts, using the same basic spline curve as in the definition of C1. Examples: E = POINT/1,-1,0 F = POINT/5,-1,0 V = VECTOR/1,1,0 C2 = SCURV/SPLINE,A,B,C,D,FLOW,CHORD,0,3,E,F,SEG,LENGTH,0,3 C3 = SCURV/SPLINE,A,B,C,D,FLOW,CHORD,0,3,E,F,V,SEG,LENGTH,0,3 C2 is defined as a flow curve with the flow parameter being proportional to the projected length onto the line EF, which in this case is parallel to the X axis. The curve together with the projection lines joining equally spaced points on the flow curve to EF, or its extensions, is illustrated in Figure 3.16. Note that the direction of the projection lines is normal to EF. The verification listing for this curve gives the total flow length as 5.99 which is approximately equal to the true projected length of AD onto the X axis. The corresponding flow length for C1 was 6.98 which was equal to the chord length AD. Note that the actual length of the line EF is irrelevant to the flow structure of the curve the only significant factor is the direction of EF which in turn defines the projection direction. C3 includes in its definition the vector V which defines the direction of projection onto the line EF. This direction differs from the direction of EF and the result is a completely different flow structure. Figure 3.17 illustrates C3 and the corresponding projection. In this case all lines joining equally spaced points of EF to corresponding points on the flow curve are normal to vector V. The flow length of the curve C3 is 8.98 which corresponds to the distance from E to the projection of D on the extension of EF. Once more the actual length of EF is irrelevant to the result and in fact if EF was any line in space not normal to V the flow structure of the curve would not be changed, the only modification would be a different flow length. Exactly the same flow structure is obtained if E,F are omitted from the definition of C3 simply using V to define the direction of projection. In this case, the curve is implicitly projected onto a line parallel to V and the resulting flow length is 6.98 which is approximately cos(45) times the length of C3 above. 83 Figure 3.16 Figure 3.17 84

3.2.5 PARAM specification of FLOW

As a final option the flow parameter of a curve can be directly proportional to the natural parameter. This option is used in cases where the natural parameterisation is satisfactory but the curve is to be incorporated into a sculptured surface defined in terms of flow curves. The only format for this type of flow specification is: FLOW,PARAM,N1,N2 where N1 and N2 refer, as before, to arc numbers of the curve.

3.3 DIVISION OF PARAMETRIC CURVES INTO SEGMENTS

After defining the flow of a parametric curve the user is required to specify how the curve is finally divided into segments. For the earlier examples illustrating the flow facility, each curve was specified as a single segment to avoid undue complication. In general, a parametric curve will consist of many arcs each of which will have a flow structure and an associated flow length. The curve is finally divided into a number of segments each consisting of one or more arcs. Each segment has a segment parameter ranging from 0 to 1.0 along it. This parameter can either be made to be proportional to the chosen flow parameter for the arcs concerned or can be related to the natural parameter from the initial definition of the curve. This selection is made by using the words LENGTH (meaning the flow length) or PARAM when defining the segment. The segment specification which comes after the FLOW specification takes the form: SEG,N1,N2,type,N2,N3,type,N3,N4,type etc. where N1,N2,N3 etc. are node numbers denoting the segment division points and type is one of the words LENGTH or PARAM. Each arc of the curve should appear in precisely one segment and the total parametric span of the final curve will be equal to the number of segments. It is possible to use different types of flow structure for different parts of the curve and in such cases the segment divisions need not coincide with the divisions between different types of flow. 85 Figure 3.18 86

3.3.1 SEGMENTATION EXAMPLES

The concept of segmentation will be illustrated by dividing a COMBIN curve into segments in two different ways and comparing the results. A = POINT/0,0,0 B = POINT/2,0,0 C = POINT/3,1,1 D = POINT/4,3,1 E = POINT/5,1,1 F = POINT/6,1,1 P1 = POINT/3,-1,0 P2 = POINT/6,-1,0 C1 = SCURV/SPLINE,A,B,C C2 = SCURV/SPLINE,C,D,E,F C3 = SCURV/COMBIN,C1,C2,FLOW,ARC,0,3,CHORD,3,5,P1,P2,$ SEG,LENGTH,0,3,LENGTH,3,5 C4 = SCURV/COMBIN,C1,C2,FLOW,ARC,0,3,CHORD,3,5,P1,P2,$ SEG,PARAM,0,2,LENGTH,2,5 In this example C3 and C4 are constructed by combining the spline curves C1 and C2. In each case the flow structure is by arc length for C1 and the first arc of C2 and is by projected chord length for the last 2 arcs of C2. For C3 the two segments correspond precisely to the flow structure, the first segment spanning from A to D and the second segment from D to F. The option 'LENGTH' means that for each segment the segment parameter is proportional to flow parameter. The verification listing gives the flow lengths of the consecutive arcs of the COMBIN curve as 2.067, 1.77, 2.286, 0.997 and 0.997 respectively. The curve is shown in Figure 3.18 in which points along the segments at equally spaced parameter intervals are joined to points on a line parallel to the x axis. The segment section of the verification listing contains the data: 87 Figure 3.19 88 PARAM XCOORD YCOORD ZCOORD SEGMENT NUMBER 1 0.0000 0.0000 0.0000 0.0000 0.2500 1.4969 -0.1270 -0.1270 0.5000 2.6821 0.5017 0.5017 0.7500 3.2241 1.7239 1.0000 1.0000 4.0000 3.0000 1.0000 FIRST POINT = 0.0 LAST POINT = 3.0 TYPE OF FLOW = LENGTH TOTAL SPAN = 6.1227 SEGMENT NUMBER 2 0.0000 4.0000 3.0000 1.0000 0.2500 4.4996 1.8297 1.0000 0.5000 4.9990 1.0001 1.0000 0.7500 5.4990 0.9325 1.0000 1.0000 6.0000 1.0000 1.0000 FIRST POINT = 3.0 LAST POINT = 5.0 TYPE OF FLOW = LENGTH TOTAL SPAN = 1.9943 From this output it can be seen that the segments join at the point D. The point with segment parameter 0.5 in the first segment is at an arc length of 0.5 x 6.1227 from A. Since AB has arc length 2.067 and BC has arc length 1.77 it corresponds to the point with arc length 0.994 on arc BC, in fact slightly beyond the mid point of BC. The positions of other points are calculated in a similar way. For the second segment both the flow and the segment parameter are proportional to the projected length along the x axis and the points on this segment in the verification listing clearly have approximately equally spaced x coordinates. For C4 the two segments join at the point C and in this case the segment parameter for the first segment is proportional to the natural parameter rather than the flow parameter. The curve C4 is illustrated in Figure 3.19. For this curve the corresponding data from the verification listing is: 89 90 PARAM XCOORD YCOORD ZCOORD SEGMENT NUMBER 1 0.0000 0.0000 0.0000 0.0000 0.2500 1.0044 -0.1511 -0.1511 0.5000 2.0000 0.0000 0.0000 0.7500 2.6244 0.4362 0.4362 1.0000 3.0000 1.0000 1.0000 FIRST POINT = 0.0 LAST POINT = 2.0 TYPE OF FLOW = PARAM TOTAL SPAN = SEGMENT NUMBER 2 0.0000 3.0000 1.0000 1.0000 0.2500 3.3404 2.0193 1.0000 0.5000 3.8720 2.9426 1.0000 0.7500 4.9271 1.0464 1.0000 1.0000 6.0000 1.0000 1.0000 FIRST POINT = 0.0 LAST POINT = 2.0 TYPE OF FLOW = LENGTH TOTAL SPAN = Note that in this case since the first segment consists of two arcs with the option 'PARAM' the point 0.5 on this segment is precisely B. The points with flow parameters 0.25 and 0.75 are approximately the natural parametric mid points of the first and second arcs of the curve. For the second segment the segment parameter is proportional to a combination of arc length (3rd arc of C4) and projected chord length for the final two arcs. As can be seen, the result is not entirely satisfactory with the segment parameter point 0.5 lying in the first arc of the segment.

3.4 ALTERNATIVE SPLINING ALGORITHM

In addition to the possibility of modifying the shape of a spline curve by smoothing as described in Section 3.1 there is an option in the system to select an alternative splining algorithm. This alternative algorithm in fact performs further computations after the original spline curve has been calculated and adjusts the lengths of the tangent vectors at the knot points in such a way that the tension in an elastic beam following the spline curve is minimised. The effect of lengthening the tangent vectors is to produce a fuller curve between the knot points whereas reducing the lengths of these vectors will produce a flatter curve. In most cases a fuller curve is produced when the modified algorithm is selected. 91 Figure 3.20 92 The modified algorithm is selected by the inclusion of the statement MAXDP/-4,10 in a part program. This option is countermanded by the later inclusion of MAXDP/-4,0

3.4.1 EXAMPLE

P1 = POINT/0,1,0 P2 = POINT/2,3,1 P3 = POINT/4,7,4 P4 = POINT/5,8,3 P5 = POINT/6,8,2 T1 = VECTOR/1,3,0 T5 = VECTOR/2,-5,1 MAXDP/-4,10 C1 = SCURV/SPLINE,P1,TANSPL,T1,P2,P3,P4,P5,TANSPL,T5 MAXDP/-4,0 C2 = SCURV/SPLINE,P1,TANSPL,T1,P2,P3.P4,P5,TANSPL,T5 These statements define two spline curves through 5 points with tangent constraints at the end points. The inclusion of MAXDP/-4,10 means that the alternative modified splining algorithm is selected for C1, but the original algorithm is used for C2. The results are shown in Figure 3.20 where for comparison purposes, C2 is displayed below C1. A more detailed examination of the verification listing highlights the differences between the curves. For C1 the first two arcs have verification listing: 93 PARAM XCOORD YCOORD ZCOORD UTAN-1 UTAN-J UTAN-K ARC NUMBER 1 0.0000 0.0000 1.0000 0.0000 0.3162 0.9487 0.0000 0.2500 0.3787 1.6715 0.0809 0.6215 0.7572 0.2010 0.5000 0.9214 2.1917 0.2992 0.7348 0.5834 0.3460 0.7500 1.5033 2.6160 0.6178 0.7250 0.5112 0.4616 1.0000 2.0000 3.0000 1.0000 0.5969 0.5533 0.5811 UNORMI UNORMJ UNORMK CURVATURE RADIUS 0.8439 -0.2813 0.4569 0.5852 1.709 0.5914 -0.6217 0.5135 0.4359 2.294 0.2336 -0.6965 0.6784 0.2288 4.371 -0.4652 -0.1307 0.8755 0.1685 5.936 -0.8017 0.3829 0.4589 0.3900 2.564 ARC NUMBER 2 0.0000 2.0000 3.0000 1.0000 0.5969 0.5533 0.5811 0.2500 2.6031 3.8280 1.8842 0.3478 0.6467 0.6788 0.5000 3.0840 4.9009 2.9352 0.2830 0.7163 0.3378 0.7500 3.5229 6.0233 3.7686 0.3386 0.8240 0.4542 1.0000 4.0000 7.0000 4.0000 0.5188 0.8321 -0.1962 UNORMI UNORMJ UNORMK CURVATURE RADIUS -0.7979 0.3333 0.5022 0.4355 2.291 -0.9007 0.4314 0.0505 0.0970 10.306 -0.0480 0.6747 -0.7365 0.0786 12.717 0.3408 0.3425 -0.8755 0.2843 3.518 0.1270 -0.3020 -0.9448 1.0332 0.968 The corresponding data for C2 is ARC NUMBER 1 - 0.0000 0.0000 1.0000 0.0000 0.3162 0.9487 0.0000 0.2500 0.3321 1.5687 0.0636 0.6299 0.7554 0.1807 0.5000 0.8483 2.0709 0.2530 0.7264 0.6086 0.3193 0.7500 1.4403 2.5377 0.5658 0.7080 0.5477 0.4458 1.0000 2.0000 3.0000 1.0000 0.5969 0.5533 0.5811 UNORMI UNORMJ UNORMK CURVATURE RADIUS 0.8761 -0.2920 0.3838 0.8010 1.249 0.5965 -0.6195 0.5103 0.4365 2.291 0.1756 -0.6135 0.7699 0.2098 4.766 -0.4308 -0.1652 0.8872 0.1738 5.754 -0.7551 -0.1425 0.6399 0.2574 3.886 94 ARC NUMBER 2 0.0000 2.0000 3.0000 1.0000 0.5969 0.5533 0.5811 0.2500 2.7789 3.9996 2.0382 0.3702 0.6540 0.6597 0.5000 3.2629 5.0896 3.0636 0.2633 0.7342 0.6258 0.7500 3.6154 6.1348 3.8071 0.2953 0.8460 0.4439 1.0000 4.0000 7.0000 4.0000 0.5188 0.8321 -0.1962 UNORMI UNORMJ UNORMK CURVATURE RADIUS -0.8021 0.3948 0.4480 0.2116 4.725 -0.9014 0.4245 0.0850 0.1138 8.784 -0.3394 0.6777 -0.6523 0.0890 11.133 0.3390 0.3416 -0.8766 0.3235 3.091 0.2175 -0.3504 -0.9110 1.1687 0.856 From these listings, it is clear that at each of the nodes P1,P2 and P3 the coordinates and the tangent vector direction are the same on each of the curves. At all intermediate points the coordinates are different. Even at the nodes the two curves differ in their normal direction and curvature, these quantities being dependent upon the higher derivatives of the cubic interpolation function. At the knot P2 the discontinuity in the curvature and the normal direction is less for the modified curve C1 than for the simple spline curve C2, this behaviour is repeated at the other intermediate knots. Even though the tangent vector directions coincide at the knot points, the tangent vectors stored in the canonical array are different for the two curves. At the end of ARC1 (P2) the tangent vectors from the canonical array are: (1.650, 1.530, 1.607) for C1 and (2.030, 1.882, 1.976) for C2 It is the change in the magnitudes of these vectors which influences the shape of the curve between P1 and P2. The use of this alternative splining algorithm is computationally more expensive than using the standard algorithm but it should be considered in cases where the standard algorithm fails to produce satisfactory results. 95 Figure 3.21 96

3.5 APPLICATION OF GEOMETRIC TRANSFORMATIONS

The final method of modifying an SCURV is by applying one of the APT geometric transformation matrices. These transformations and their associated matrices were described in detail in part 1 of this manual. The full range of available transformations includes rotation, translation, scaling and reflection. Two or more of these basic operations can be combined into a single transformation matrix which is then included with the key word TRFORM, at the end of the curve definition. The effect is to define the curve in the normal way and then transform it to produce the geometrically modified curve.

3.5.1 EXAMPLE

A = POINT/-4,0,0 B = POINT/0,4,0 C = POINT/4,0,0 M1 = MATRIX/XYROT,45,TRANSL,8,-2,0 M2 = MATRIX/MIRROR,ZXPLAN C1 = SCURV/CURSEG,A,B,C C2 = SCURV/CURSEG,A,B,C,TRFORM,M1 C3 = SCURV/COMBIN,C1,TRFORM,M2 In this example A,B,C are 3 points on a semi-circle in the XY plane of radius 4 and centred at the origin. C1 is defined as this semi-circle using the properties of the CURSEG statement. M1 is defined as the transformation matrix which combines a rotation through 45 degrees in the XY plane with a translation which takes the origin (in this case the centre of the circle) to the point (8,-2,0). M2 is the matrix corresponding to a reflection in the ZX plane, this has the effect of reversing the sign of the y coordinate for each point. C2 is also defined as the CURSEG curve through A,B and C but this curve is then rotated and translated by M1. C3 makes use of the COMBIN statement to avoid re-defining the basic curve C1 which is then reflected by M2. The three curves are shown in Figure 3.21. 97 For each transformed curve the verification listing gives details of the original curve, followed by the transformation matrix and details of the curve in its final location. For C2 this verification listing includes: PARAM XCOORD YCOORD ZCOORD UTAN-I UTAN-J UTAN-K 0.0000 -4.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.2500 -3.2000 2.4000 0.0000 0.6000 0.8000 0.0000 0.5000 0.0000 4.0000 0.0000 1.0000 0.0000 0.0000 0.7500 3.2000 2.4000 0.0000 0.6000 -0.8000 0.0000 1.0000 4.0000 0.0000 0.0000 0.0000 -1.0000 0.0000 THE FOLLOWING SSURF OR SCURV WAS TRANSFORMED BY THE MATRIX 0.70711 -0.70711 0.00000 8.00000 0.70711 0.70711 0.00000 -2.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 1.00000 CURVE SHAPE DISPLAYED BY CUBIC ARCS PARAM XCOORD YCOORD ZCOORD UTAN-I UTAN-J UTAN-K 0.0000 5.1716 -4.8284 0.0000 -0.7071 0.7071 0.0000 0.2500 4.0402 -2.5657 0.0000 -0.1414 0.9899 0.0000 0.5000 5.1716 0.8284 0.0000 0.7071 0.7071 0.0000 0.7500 8.5657 1.9598 0.0000 0.9899 -0.1414 0.0000 1.0000 10.8284 0.8284 0.0000 0.7071 -0.7071 0.0000 The full verification listing also contains normal directions, curvature and radius in addition to the canonical form which has been omitted for brevity. For the transformed curve the centre is at (8,-2,0) which is the mid point of the line from the point with parameter 0 to the point with parameter 1. The effect of the rotation can most clearly be seen in the tangent vectors, the initial tangent was originally parallel to the y axis and is now seen to be at 45 degrees to this axis. The matrix listed here, when used as a multiplier with the homogeneous coordinates performs these geometric transformations. In fact the first 3 rows and columns of this matrix form a rotation matrix for the Cartesian coordinates and the final column defines the translation. 98