Building Rhino Frameworks31 Dec, 2001 By: John E. Wilson
This column continues to explore Robert McNeel & Associates' 3D modeler Rhinoceros. This month we'll take a closer look at its tools for creating curves. Last month I introduced Rhino, as the program is generally called, and gave you an overall look at its features and capabilities. If you do not currently use Rhino but would like to try it, you can download an evaluation version at www.rhino3D.com.
Rhino can construct both solid and surface models. Unlike many 3D modelers, Rhino's surface and solid models are not different types of objects, and for all practical purposes the only distinction between its solid and surface models is that solid models completely enclose a space while surface models remain open. You will be especially interested, though, in Rhino's surfaces because they can have shapes beyond the capability of solid modelers such as Inventor and SolidWorks.
Except for those having simple triangular and rectangular shapes, all Rhino surfaces are built on a framework of wires. Figure 1 shows an example. A typical surface model is shown in a shaded mode on the left side of this figure, while the wires the model is based on are shown on the right. Such wires are used in a variety of ways: some to define the edges of a surface, some to represent the profile shape of a surface, some to serve as path rails for sweeping profiles through space, and some to trim and shape existing surfaces.
Figure 1. Surface models are built on a framework of wires, or curves as Rhino calls them. The curves shown on the right side of this figure are the basis of the surface model shown on the left.
Rhino refers to wires as curves, and all Rhino's curves are NURBS objects. (See the sidebar, "There's Something About NURBS," p. 48, in the December 2001 Third Dimension column "An Introduction to Rhino," for a description of NURBS objects and their properties.) Therefore, the only difference between a straight line, an arc, and a freeform curve is in the degree of their basic functions, and you can convert a line to an arc or to a freeform curve, and vice versa. Rhino has more than 40 different commands for making curves. Which command you use depends on the shape you want the curve to have and the curve's relationship with existing objects. You can invoke any of the Rhino commands for creating curves from the Curve menu.
When you select Line from the Curve menu, a secondary menu offering more than a dozen choices for creating straight lines is opened. Your choices include a single line, a series of end-to-end individual lines, and a series of end-to-end joined lines. Rhino refers to a series of joined lines as a polyline object, but there is no fundamental difference between polylines and a series of individual lines. Thus, you can explode a polyline to create a series of individual lines and you can join a series of end-to-end individual lines to create a polyline. The Lines menu also has choices for transforming a polyline into a freeform curve, and for transforming a freeform curve into a polyline. Most of the other choices in the Line menu are for drawing a line relative to existing objects. For instance, you will select Tangent to 2 Curves for drawing a line that is tangent to two existing curves.
We tend to use freeform curves extensively in models, and Rhino provides three different methods for drawing them. The method you will most often use lets you specify the locations of the curve's control points. It may take you some time to become accustomed to drawing such curves because the curve does not normally pass through the points you specify, except for the first and last points. If your curve must pass precisely through certain points, use the curve-by-interpolating-points method. The third method for drawing freeform curves is to sketch them. When you use this method, all snaps are automatically disabled and the curve traces the exact movement of the screen cursor. You can create both open and closed curves with any of these methods. You can also draw a freeform curve on a surface when you use either the interpolation or sketch method.
Rhino's Curve menu contains selections for you to draw circles, arcs, ellipses, hexagons, and other closed polygons and rectangles. When you select any of these, a secondary menu displays so you can specify how the object is to be drawn or how it is to relate to existing objects. For example, one method for drawing an arc is to specify its endpoints and its radius; another is to specify its endpoints and the tangent direction at the endpoints. Choose Conic in the Curve menu to draw elliptical, parabolic, and hyperbolic arcs.
Helix and Spiral Curves
You can easily create helix and spiral curves. In creating a helix, Rhino issues command-line prompts for you to specify its centerline axis and its coil radius. It then displays a dialog box for you to specify other parameters, such as pitch or number of turns. The steps for drawing a spiral are the same, except Rhino prompts also for the end radius of the spiral, and offers an option for drawing a planar spiral. You can also specify that the centerline of a helix or spiral is to follow an existing curve. Two examples of helix curves and one of a spiral curve are shown on the left side of Figure 2. You can also see models of springs created by using these curves as sweep rails on the right.
Figure 2. You can easily create helix and spiral curves with Rhino. Typical examples of such curves are shown on the left, while models based on those curves are shown on the right.
Curves From Existing Curves
Select Extend from the Curve menu to lengthen a curve. A secondary menu displays for you to specify how to lengthen the curve. Your choices include extending the curve to intercept another curve or a surface edge and dragging the end of the curve to a desired spot. You can also specify that the lengthened portion of the curve is to be an arc, a line, or a smooth curve. Select Fillet from the Curve menu to create an arc between two existing open curves, and select Chamfer to create an angled (or beveled) line between two existing open curves. Choose Offset to copy an existing curve as it is projected a specified distance from the original curve. Blend creates a curve between two existing open curves. The curvature of the new curve matches that of the existing curves. Figure 3 shows an example of two blend curves created from the edge curves of two existing surfaces.
Figure 3. Rhino can bridge the gap between two existing curves with a new curve. The curvature of the new curve forms a smooth blend between the curves.
Choose From Views in the Curves menu to create a 3D curve based on two 2D curves seen in two different viewports. For instance, you could select a circle from the Top viewport and an arc from the Front viewport to create a saddle-shaped curve. CSec Profiles in the Curve menu creates a set of curves representing cross sections of a set of profile curves. You will first be prompted to select the profile curves and then to indicate where you want the cross section curves positioned. You will typically use the resulting cross section curves as profiles for creating a lofted surface, as shown in Figure 4.
Figure 4. You can create a set of cross section curves based on profile curves. Four profile curves are shown on the left side of this figure, and the cross section curves from those profiles are shown in the center. A surface based on the cross section curves is shown on the right.
Curves From Objects Editing Tools for Curves General Editing Operations Although this has been a quick trip through many different operations, you should nevertheless now have a good idea as to how you can create and work with Rhino curves. The next time we look at Rhino, we'll explore its tools for putting curves to work in creating surfaces.
When you select From Objects in the Curve menu, you see a secondary menu listing more than a dozen methods for creating curves from existing objects. One of the methods often used is Project, which projects an existing curve onto an existing surface. It looks as if the existing curve is extruded to intersect the surface and then a curve is drawn along the intersection boundary. Other methods listed in this menu include Duplicate Edge and Duplicate Border for creating curves from the edges of a surface, Silhouette for transforming the profile of a surface into a curve, and Extract Isopram for creating curves on a surface parallel to the surface's mesh lines (which Rhino refers to as isoprams).
Select Edit Tools from the Curve menu to open a secondary menu for performing specialized editing operations on curves; select Match from the secondary menu when you want to connect two curves and establish their curvature properties at the connection point. You can simply connect the two curves or force them to have the same tangent (slope) or the same curvature at the connection point. To close an open curve, choose Make Periodic in the Edit Tools menu. Other choices in this menu let you perform low-level curve editing, such as changing the degree and number of control points, reducing sharp curvature changes, and adjusting the seam point of a closed curve.
In addition to the editing tools specifically for curves, you can also use Rhino's general editing tools to modify curves. You access most of these tools from Edit in the menu bar. In the Edit menu, select Join to unite two or more curves. Trim shortens a curve to its intersection with another curve. Split works similarly to Trim, but it breaks curves rather than trimming them. When you select Point Editing, a secondary menu for displaying and modifying control points displays. Once control points are displayed, you can delete them and drag them to new locations. Handlebar in the Point Editing menu works on the curve itself rather than on control points. The handlebar is a line-like object attached to the curve, and by dragging and rotating it you can change the shape of the curve.
Curves From Objects
Editing Tools for Curves
General Editing Operations
Although this has been a quick trip through many different operations, you should nevertheless now have a good idea as to how you can create and work with Rhino curves. The next time we look at Rhino, we'll explore its tools for putting curves to work in creating surfaces.