Creating True Splines

To create true spline curves in AutoCAD, you use the SPLINE command. Splines can be either 2D or 3D objects. You draw splines by specifying a series of fit-data points (vertices) through which the curve passes. The fit-data points determine the location of the spline’s control points. Control points contain the curve information for the spline. AutoCAD’s spline objects are true splines, unlike the spline approximations formed by spline-fit polylines. The SPLINE command draws non-uniform rational B-splines (NURBS). AutoCAD NURBS are mathematically more accurate than spline-fit polylines are. And even though spline objects are more accurate than spline-fit polylines, they actually require less memory for storage and result in smaller drawings, other factors being equal.

You can use the SPLINE command to convert 2D and 3D spline-fit polylines into true splines. Unlike spline-fit polylines, which can be either quadric or cubic spline approximations depending on how the SPLINETYPE system variable is set, the SPLINETYPE system variable does not affect the true spline objects produced by the SPLINE command.

The SPLINE command offers the following options:

  • Specify first point or [Object]: The default option of the main prompt specifies the starting point of the spline. After you specify a starting point, AutoCAD prompts you to specify a second point. Spline objects must consist of a minimum of three points.

  • Object. This option enables you to convert existing spline-fit polylines to true spline objects. After you specify this option, AutoCAD asks you to select objects.

  • Specify next point or [Close/Fit tolerance] <start tangent>: AutoCAD displays this prompt after you specify a second point. The default option is to continue to specify additional data points for the spline that you are drawing. If you press Enter, AutoCAD prompts you to specify the tangent information for the start and endpoints and then ends the command.

  • Close. This option causes the start and end of the spline to be coincident and to share vertex and tangent information. When you close a spline, AutoCAD prompts only once for tangent information.

  • Fit Tolerance. This option controls how closely the spline curve follows the data points. The distance of the Fit Tolerance is expressed in current drawing units. The smaller the tolerance, the closer the spline fits the data points. When the value is 0, the spline follows the data points exactly.

  • (Undo). Although this option does not appear in the prompt, you can enter U after any point to undo the last segment.

In the following exercise, you use the SPLINE command to draw the outline of a mechanical part.

Exercise 8.6 Constructing a Spline

1.
Open the drawing called 08DWG03.dwg found on the accompanying CD (see Figure 8.13).

Figure 8.13. Fitting a spline to data points.


In the next step, you use the pre-positioned data points shown by Xs in the drawing. You need to set the Node and Endpoint running osnaps so you can easily snap to the data points.

2.
From the Draw menu, choose Spline to start the SPLINE command. The Object/<Specify first point>: prompt appears.

3.
Use the default option of specifying a first point. Snap to the endpoint at . Then enter the first point by clicking. The Specify next point: prompt appears.

4.
Continue to specify points, snapping to each successive X node at each Specify next point: prompt. Finally, specify the last point by snapping to the endpoint at .

5.
Press Enter three times to end the SPLINE command. Your drawing should now resemble Figure 8.14.

Figure 8.14. The completed spline curve.


6.
You will use this drawing in the next exercise, so leave it open.

In the preceding exercise, you used pre-positioned points to help construct the spline. Depending on the type of work you want to do, you usually base splines on some form of preliminary data points rather than just drawing the curve in free-form style, although both methods are possible with AutoCAD. At best, splines are “tricky” objects to construct, and after you draw one, you frequently need to alter or refine it.

Controlling Splines with SPLINEDIT

The SPLINEDIT command enables you to edit a spline’s control points and, if present, fit-data points. When you draw a spline, you pick fit-data points, which AutoCAD uses to calculate the location of the spline’s control points. You can add additional control or fit-data points or move existing ones. You can change the weight or influence of control points, as well as the tolerance of the spline. You also can close or open a spline and adjust the tangent information of the start and endpoints.

Control points usually are not located on the spline curve (except at the start and endpoints), but they control the shape of the spline. AutoCAD uses the fit-data points to calculate the position of the control points. After AutoCAD determines the control points, it no longer needs the fit-data points. If you remove the fit-data from a spline, however, you cannot use any of the fit-data editing options of the SPLINEDIT command to further edit the shape of the spline.

When you select a spline for editing, AutoCAD displays its control points just as it does if you use grips editing, although grips editing is not available through the SPLINEDIT command. The SPLINEDIT command works on only one spline object at a time.

The SPLINEDIT command has the following options:

  • Fit Data. Enables you to edit the fit-data points for spline objects that have them, in which case, AutoCAD displays another prompt of Fit Data options, which are described following this list.

  • Close. Closes an open spline. Adds a curve that is tangent between the start and end vertices for splines that do not have the same start and endpoints. If the spline does have the same start and endpoints, the Close option makes the tangent information for each point continuous. If the spline is already closed, the Close option is replaced by the Open option.

  • Open. Opens a closed spline. If the spline did not have the same start and endpoints prior to being closed, this option removes the tangent curve and removes tangent information from the start and endpoints. If the spline shares the same start and endpoint before you close it, the Open option removes the tangent information from the points.

  • Move Vertex. Enables you to move the control vertices of a spline. You specify a vertex to edit by moving the current vertex to the next or previous vertex.

  • Refine. Displays suboptions that enable you to add control points and adjust the weight of control points. You can add individual control points in areas where you want finer control of the curve. Performing any refine operation on a spline removes fit-data from the spline. You can reverse the effect of the Refine option and restore the fit-data with the Undo option before ending the SPLINEDIT command. The following list describes the Refine options:

    • Add control point. Enables you to add a single control point to a spline. AutoCAD locates the new control point as close as possible to the point you pick on the spline. Adding a control point does not change the shape of the spline.

    • Elevate Order. Elevates the order of the spline’s polynomial, which adds control points evenly over the spline. This option does not change the shape of the spline. The order of the polynomial cannot be reduced after it has been increased.

    • Weight. Controls the amount of tension that pulls a spline toward a control point.

    • eXit. Returns to the main SPLINEDIT prompt.

    • rEverse. Changes the direction of the spline.

    • Undo. Undoes the most recently performed SPLINEDIT option.

  • eXit. Ends the SPLINEDIT command.

The following are the suboptions of the Fit Data option for editing spline object fit-data. When you choose the Fit Data option, the grips-like boxes change to highlight the fit-data points.

  • Add. Adds additional fit-data points to the curve. Adding fit-data points changes the shape of the spline curve. Added fit-data points obey the current tolerance of the spline.

  • Close. Performs the same function as the control point Close option using fit-data points.

  • Open. Performs the same function as the control point Open option using fit-data points. The Open option replaces the Close option if the spline is already closed.

  • Delete. Removes fit-data points and redraws the spline to fit the fit-data points that remain.

  • Move. Enables you to move fit-data point vertices of a spline. You specify a vertex to edit by moving the current vertex to the next or previous vertex. You cannot edit fit-data information with AutoCAD’s grips editing feature.

  • Purge. Removes all fit data from the spline.

  • Tangents. Enables you to change the tangent information of the start and endpoints of a spline.

  • toLerance. Changes the tolerance of the spline’s fit-data points and redraws the spline. A spline loses its fit data if you change the tolerance and move a control point or open or close the spline.

  • eXit. Returns to the control point editing prompt.

In the following exercise, you edit the spline you drew in the preceding exercise using some options of the SPLINEDIT command. First, you reduce the number of fit-data points, and then you add additional control points to the spline by changing its order.

Exercise 8.7 Editing a Spline

1.
Continuing from the previous exercise, remove the running Node osnap by right-clicking on the OSNAP window on the status line at the bottom of the display. Choose Settings and in the Drafting Settings dialog box, remove the check next to the Node option. Click OK to exit the dialog box.

2.
Press F3 to disable the OSNAP function. From the Modify menu, choose Spline to start the SPLINEDIT command. Select the spline you drew in the preceding exercise. The control points appear (see Figure 8.15). Note that the control points do not necessarily fall on the spline curve itself. The following prompt appears:

Figure 8.15. SPLINEDIT displays a spline’s control points.


Enter an option [Fit Data/Close/Move 
Vertex/Refine/rEverse/Undo]: 

3.
Right-click to display the SPLINEDIT shortcut menu. Choose the Fit Data option, and AutoCAD changes the control points to show the fit-data points. Notice that the fit-data points are not the same as the control points. The Fit Data prompt appears.

Enter a fit data option 
[Add/Close/Delete/Move/Purge/Tangents/toLerance/eXit] <eXit>: 

4.
Right-click and choose the Delete option, then pick a couple of points. Note that the points disappear as you pick them. Press Enter after you remove the points. The prompt returns. Choose the Tangents option. The Specify start tangent or [System default]: prompt appears.

5.
Press Enter to keep the current tangent. Then at the Specify end tangent: or [System default]: prompt, pick a point near , as shown in Figure 8.15.

6.
When the prompt returns, press Enter to return to the main control point prompt. The control points are displayed, and the control point prompt appears.

7.
Right-click and choose the Refine option, then at the new prompt, right-click again and choose the Elevate Order option.

8.
At the Enter new order <4>: prompt, type 6 and press Enter. This elevates the order of the polynomial and adds control points. The prompt returns. Respond by pressing Enter to exit to the main prompt.

9.
Press Enter again to exit the SPLINEDIT command.

10.
From the Layer Control box on the Object Properties toolbar, turn off the layer Frame. Your drawing should now resemble Figure 8.16, depending on which points you removed in step 4. You are finished with this drawing.

Figure 8.16. The completed spline fit curve after modification.


The options and sub-options of the SPLINEDIT command offer a great deal of control. In this exercise, you had the opportunity to investigate several ways you can modify and “tweak” a spline object. Splines are quite complex, but they are also quite accurate and flexible.

Tip

As with polylines, Spline objects can be modified using AutoCAD’s grips editing feature. Chapter 11 tells more about grips editing.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.239.214