3 Drawing 2D shapes Launch form Z. If you have followed our instructions to this point, five icons will be displayed in the upper left corner of your screen. You can tear the three shown below off, to use in this chapter. The other two you will need later. You can also place the ones you tear off wherever you wish, and even click on their orientation boxes to position them vertically. The tools in the left second palette have a teal background. These are modifiers which tell the system what type of object to create from the shape you draw. They generate 2D and 3D objects. In this section, you will use the very first tool to create 2D objects. You will generate 3D objects later. The other two palettes contain icons on a white background. They are used to draw shapes. The tools on the left 3rd palette draw closed shapes: rectangles, polygons, circles, and ellipses. The tools on the right 3rd palette draw open shapes that can also be closed. These tools draw one segment at a time and can produce any kind of a shape. There are also tools that create curved lines and arcs. form Z is above all a 3D program, which allows you to create objects directly in 3D space. However, it also allows you to work in 2D space, which is what you will be doing first. From the View menu select [+XY] Top. Your screen now displays what is known as an orthographic projection or a 2D view. The XY plane of the 3D system of coordinates lies on the screen plane, and there is no 3rd dimension. The reference grid has been redisplayed to reflect the 2D nature of the projection. 25
3.1 Drawing rectangles You are now ready to draw. Initially, try to follow our instructions and draw the shapes we suggest as close to ours as possible, even though it does not really matter if they deviate a bit. You should then feel free to experiment further with the drawing tools. Select the 2D Surface modifier (1st tool on 2nd palette on the left). You will keep this tool selected throughout this section. 2 Select the Draw Rectangle tool (1st tool on 3rd row left). Click on point 1. A rectangle is rubber banded as you move the mouse. Click on point 2. A rectangle is created and is displayed in your window. 1 You may have worked with other drawing programs that required you to drag the mouse between two points. In form Z each point is entered by an independent click (press and release immediately). The advantages of this method are discussed in UM section 1.4. You noticed that, after the first click, the shape of a rectangle was rubber banded. This allowed you to visually inspect the size and shape of your rectangle before finalizing its creation with the second click. Rubber banding is a dynamic process that is not possible to show in the static images of a printed document. It is a standard feature of form Z and is part of the execution of most of its operations. All the shapes you will be drawing will first be rubber banded before they are created by the last click of the mouse. The first rectangle you drew was restricted to a position parallel to the orthogonal axes. The 3 Point Rectangle (2nd tool on the 2nd palette) does not have such a restriction and can take any position. However, it requires one additional input point (total of 3 points). You will use it next. Select Edit: Clear to clear the screen. The 2D Surface modifier should still be selected. 3 Select the 3 Point Rectangle tool (2nd tool on 3rd row left). Click on point 1. A line is rubber banded as you move the mouse. Click on point 2. A rectangle is rubber banded. Click on point 3. A rectangle is created and is displayed. 1 2 26
3.2 Drawing polygons, simple and patterned Next, you will draw a polygon. Select Edit: Clear to clear the screen. When a warning dialog appears, click OK and proceed. The 2D Surface modifier should still be selected. 1 2 Select the Polygon tool. Click on point 1. This is the center of your polygon. A hexagon is rubber banded. As you move the mouse the size of your shape changes, and you can also rotate it. Click on point 2. A hexagon is created and displayed. The Polygon tool defaults to six sides (hexagon). You can change this and create polygons with any number of sides. You select a different number for sides either in the Polygon Options dialog, which you have to invoke, or in the Tool Options palette to the right of the window, which displays the options of the Polygon tool as soon as you select it. In this exercise we shall use them both. Double click on the Polygon tool to invoke the Polygon Options dialog, which appears as shown to the left, below. The Tool Options palette is also shown below right. The Edges tab in both the dialog and the tool palette contains six icons for selecting a triangle (3-sided), diamond (4), pentagon (5), hexagon (6), octagon (8), or decagon (10). Click on one of these icons to select it. The number of sides that appears in the numeric field above them changes. For example, selecting the pentagon displays the number 5. To draw a polygon for which there is no icon, enter the number of sides you need. You notice that the options palette and dialog contain quite a few more options. Those in the upper part allow you to select a different method for drawing polygons. The default Center & Radius you already used interprets the first input point as the center and the second as a point on the perimeter. This is the default. The Diameter option interprets both points as points on the perimeter of the polygon. 27
All polygons are shapes inscribed in a circle. The two options labeled Construct Through control how a polygon is inscribed in the circle. Point is the option you used above. It places a point at the position of the second click. Segment places a segment at the position of the second click. Try all these options to observe the differences in the drawing behavior. The icons that determine the number of sides in a polygon are in a tab labeled Edges. This is open by default. Next to it is the Pattern tab. Click on it to open it. It contains another group of icons, which allow you to draw variations of the polygons, called patterned polygons. Select Edit: Clear. From within the Edges tab of the tool options palette (or the dialog) select the lower right icon (with 10 sides). Then open the Pattern tab, turn on the Pattern check box, and select the upper left icon under it. 1 2 3 The 2D Surface modifier is still selected. Select the Polygon tool and click on points 1, 2, and 3. The star shape shown to the top right is drawn. Undo. 1 4 2 With Polygon still active, click on points 1, 2, and 4. The lower star shape on the right is drawn. These star-like polygonal shapes are patterned polygons and they are just two examples of the shapes that can be drawn with the Polygon tool. Try the other options on your own and draw additional patterned polygons. Also try the options under them. While the Polygon is the first tool you encountered that is affected by optional parameters and settings, this is also true for the vast majority of the form Z tools. In all cases you may either invoke the dialog of the tool and select the desired options from there, or you can do so in the tool options palette. The latter is content sensitive, which means that the options of a tool are displayed as soon as the tool is selected. Which of the two ways for selecting options is preferable is a matter of personal choice. The advantage of the dialogs is that they use larger and more distinct fonts to display their options. Their disadvantage is that they need to be specifically invoked. On the other hand, while the relevant options appear in the tool options palette automatically each time we select a tool, they frequently do not fit in the space provided for the tool options palette. You can see the options that do not initially fit either by enlarging the palette or by scrolling its content. You do the latter by clicking on some empty space in the palette and dragging the mouse. 28
3.3 Drawing circles and ellipses Next you will draw three circles, using different methods. Select Edit: Clear. The 2D Surface modifier should still be selected. 1 2 Select the Circle by Center and Radius tool (4th on 3rd row left). In its tool palette, the default Smooth should currently be on. 4 5 Select Facetted for Model Type. We shall explain later why this is desirable, even though the change will make no visible difference to the shapes you will be drawing here. 3 Click on point 1. This is the center of your circle. A circle is rubber banded. Click on point 2. A circle is created and displayed in the graphics window. This circle was drawn exactly as the polygon with the Center & Radius option. You can also draw a circle as you draw a polygon with the Diameter option. It is drawn with the Circle by Diameter tool (5th on 3rd row left). Try it. The third method for drawing circles requires three points. 10 Select the Circle by 3 Points on Circumference tool. Click on points 3 and 4. These are points on the circumference of the circle. A circle is rubber banded as you move the mouse after the second click. Click on point 5. A circle is created and displayed in the graphics window. There are two tools for drawing ellipses. You will use them next. Select Edit: Clear. 8 7 9 6 11 Select the Ellipse by Major and Minor Radius tool. Click on point 6. This is a point on the circumference. Click on point 7. This is the center of the ellipse. An ellipse is rubber banded as you move the mouse away. Click on point 8. An ellipse is created and displayed. Select the Ellipse by Diameter and Radius tool. Click on points 9 and 10. These are points on the circumference. An ellipse is rubber banded after the second click. Click on point 11. An ellipse is created and displayed. Select Edit: Clear to clear the screen before the next exercise. 29
3.4 Generating line drawings Next, you will draw lines, arcs, and splines. You will also turn on Grid Snap, which will cause the points you enter with the mouse to be locked or snapped to the nearest grid point. You will first draw shapes A through E, one at a time. A B C D E A a2 Select the Grid Snap tool to turn grid snapping on. It is the fourth window tool. 2D Surface should still be selected. a1 Select the Segment tool and click on point a1, then click again on point a2. The single line object A is created and displayed. You will next draw shape B. Select the Vector Line tool (3rd on 3rd row right). In its tool palette, Facetted should currently be on, for Model Type. b2 B b3 With the Vector Line tool active, click on points b1, b2, and b3, in this order. After each click, a new line is rubber banded that is anchored on the previous point. Double click on point b4. Object B is created and displayed. The double click of the mouse signals completion of the drawing process and creates an open shape. A triple click creates a closed shape, as you will see shortly. b1 b4 2D Surface Object and Vector Line are still selected. Click the mouse on points c1, c2, and c3, in this order. Triple click on point c4. Object C, which is closed, is created and displayed. c2 C c3 The triple click signals the end of the drawing sequence, and it also closes the shape by connecting the point where the mouse was triple clicked (c4) with the first point entered (c1). A shape can also be closed by positioning the mouse on the first point and double clicking. To close the shape, the system should be able to recognize that the first and the last points are the same. Consequently, grid snapping should be on when using the second method for closing a shape. c1 c4 30
3.5 Drawing arcs You will next draw the arc of shape D. Note that this is an open shape whose endpoints lie on the Y axis. The 2D Surface tool is still selected. Select the Arc, Clockwise, Endpoint Last tool (next to last in the palette or left most of Arc tools). Note that this is a long name. You should also recall that there are six Arc tools, four of which you have turned off. Each of these draws an arc in a different manner, and their names describe how they are drawn. In most cases it will suffice to indicate clockwise and counterclockwise. Click on point d1. This sets the beginning point of the arc. As the mouse starts to move away from that point, a circle is rubber banded with its center at the cursor position. D d3 d2 d1 Click on point d2. This sets the center of the arc, and the rubber banded circle transforms to an open arc that is drawn in a clockwise direction. Double click on point d3. This completes the drawing of the arc and creates object D. Had you triple clicked on the last point, a closed shape would have been constructed. You can also draw the arc of shape D in a counterclockwise direction, as follows: From the Edit menu, select Undo to erase the previous arc. Select the Arc, Counterclockwise, Endpoint Last tool (last in palette). Click on points d3 and d2, and double click on d1, in this order. When an arc is by itself, such as shape D, either one of the arc drawing tools can be used. The direction of the arc is significant when the arc is part of a continuous drawing, such as object E, which you will draw next. The arcs in this section and in section 3.3 were drawn with 23 segments. This is determined by the default settings in the Display Resolution tab, shown to the right, which can be opened from the Circle/Ellipse Options and Spline/ArcOptions dialogs (or tool options palette). Currently the default Simple method is on and the resolution of circles is set by the sliding rule. There are also additional methods for setting resolutions with more accuracy. We discuss the resolution of objects in section 3.9. You may be noticing that the difference in arc resolution is hardly visible. While it is always more visible when drawings are printed, you can also make it more visible by instructing the program to show you the points. You do this by turning on the Show Points option in the Interactive tab of the Wire Frame Options dialog, which you invoke by clicking on Wire Frame* (Display menu) while pressing option (Macintosh) or shft+ctrl (Windows). 31
3.6 Mixing straight lines and arcs You will next draw shape E by switching icons as the drawing is in progress. 2D Surface should still be on. e2 e3 e4 Select the Vector Line tool. Click on e1, e2, e3. e1 E e5 e6 e7 e8 While at e3, switch icons and select the Arc, Clockwise, Endpoint Last tool. Do not worry about the rubber band following the mouse as you go to select the new tool. It will fall in place as soon as you return to the graphics window. Click on point e4 (the center of the first arc) and then e5. While at e5, select the Arc, Counterclockwise, Endpoint Last tool. Click on point e6 (the center of the second arc), then on point e7. While at e7, select the Vector Line tool again. Triple click on point e8. The shape is closed, the drawing process is completed, and object E is generated. If you make a mistake as you draw, you can undo the last line you drew by pressing on the Macintosh or ctrl+z on Windows. Or you can achieve the same result by selecting Edit: Undo on both platforms. This way, you can undo a sequence of drawing steps in reverse order from the order in which you drew them. If you mix drawing tools as you draw, then the tool active at the time the Undo is executed will remain active, regardless of the tool used to draw the segment you are undoing. We recommend that you redraw the last shape and as you do, apply Undos to get a feel of how they behave. At the end, make certain that you have the shape drawn as we show it since you will save it so that it can be used in another exercise a bit later. You should have noted by now that if you select the Undo command after you have completed the generation of an object, it erases the complete object. If you select Undo while you are still drawing, it only cancels the most recent drawing step. Before you leave this section, save the shapes you have drawn. You will need them again later. From the File menu select Save As... In the dialog that appears type Shapes (or any other name) and press return/enter. 32
3.7 Drawing spline curves You will next generate splines. Clear (Edit menu). 2D Surface is still selected. Select the Spline, Quadratic Bezier tool. Click on points 1 through 12, and double click on 13. After the first click a straight line is rubber banded, which becomes a curve after the second click. A curve continues to be rubber banded until the double click, which completes the drawing. You will next draw another spline of the same kind. Undo. 2 3 7 11 4 8 12 10 6 9 13 1 5 2 3 7 11 4 6 8 10 1 5 9 12 a b With the Spline, Quadratic Bezier tool still selected, click on points 1 through 11 and double click on 12 (as shown in b). Next you will draw three splines of a different type. Undo. Select Spline, Cubic Bezier (second spline tool). Click on points 1 through 12, and double click on 13. (as shown in c). Repeat the above steps and draw the splines by clicking on the points, roughly as shown in d and e on the right. You notice that the Quadratic and Cubic Bezier behave differently when you draw with them. Quadratic means of second and Cubic of third degree. That is, these curves need two and three control points respectively to be generated. The Cubic Bezier, after the second click and every other click from there on, rubber bands a straight line, which is tangent to the curve and rotates about the tangency point. This allows you to manipulate the shape of the curve. The method used is the same with that found in popular illustration programs. The smoothness of the curves is controlled by the settings in the Display Resolution tab that can be opened from the Spline/ Arc Options dialog or tool options palette. We discuss more details in section 3.9. Also note that smooth splines can be generated as derivative shapes from vector lines that are drawn first. You will learn how this is done in chapter 18. 2 3 7 6 11 10 12 13 8 9 1 4 5 2 3 6 7 10 11 1 4 5 8 9 12 3 4 5 11 12 13 19 20 21 2 6 10 14 18 22 1 7 8 9 15 16 17 23 33 c d e
3.8 Drawing sketches and stream lines Two tools at the end of the splines group let you draw continuous types of lines by clicking and dragging, rather than a click-click process, as the previous examples did. The resulting splines have a sketching quality. You will next do an example of each. Clear (Edit menu). Deselect the Grid Snap switch. 2D Surface is still selected. Select the Spline Sketch tool. Click to begin, then drag the mouse to draw some shape, possibly something like the one we show in a to the right. Release the mouse and double click to stop drawing. The shown shape is generated. We also show it with its points displayed. You will learn how to do this a bit later. With the Spline Sketch tool you draw little line segments, which are generated by the program automatically each time the mouse travels a certain distance. Then these segments are used to generate a curve. The distance can be set in the Display Resolution tab that can be opened from the Spline/Arc Options dialog (or tool options palette), as for the other splines. This tool can also be used in a click-click manner, in which case it draws a Quadratic Bezier similar to that you did in the previous section. Next you will draw a stream line. Undo (Edit menu). Grid Snap is off and 2D Surface Object is still selected. 24 a b Select the Stream Line tool. Click to begin, then drag the mouse to draw some shape, possibly something like the one we show in c, or you may want to repeat that in a. Place the cursor on point 24, press the button, and drag along the shown shape. At the end, release the mouse and double click to complete the drawing. Again, while the Stream Line tool is typically used in a click and drag manner as above, it can also be used in a click-click manner. When clicking and dragging, streams of segments are generated as you drag the mouse. These segments, shown in d on the right, are automatically created by the system when the mouse travels a certain distance. That distance can be set in the Stream Distance field of the Stream Input Options dialog or tool options palette. 34 c d
3.9 Facetted versus smooth objects We have already noted earlier that, in form Z, there are two types of models: facetted and smooth. The former approximate curved lines with straight line segments and curved surfaces with flat bounded surfaces called faces. In contrast, the smooth lines and surfaces are continuous and there is typically no need to subdivided them. How is it decided whether a newly generated object will be facetted or smooth? In most cases there is a model type option associated with a drawing tool, as follows: The rectangle, polygon, single point, and single segment drawing tools draw facetted shapes only. The circle, ellipse, spline, and arc drawing tools can generate either facetted or smooth shapes, which is determined by selecting either option for model type in their dialogs or option palettes. Note that these options are globally set. That is, the way it is set for, say a circle, will also apply to a spline drawn during the same session, without changing the option. The vector line shapes, in their pure form, can only be facetted shapes. Yet, the Facetted/ Smooth options are available in their dialog. This is because of the possibility to mix the vector lines with arcs and splines. If a vector line is by itself, it can only be facetted, even when Smooth is on. However, if it is mixed with arcs and splines, it will be whatever the model type setting is. According to the above, the model type is set when a shape is drawn. This type will then be carried by whatever object is generated, which can be a 2D surface or a solid, such as an extrusion or a 3D enclosure. We discuss how the model type is decided for types of objects such as primitives and derivatives when these objects are discussed later in this Tutorial. An implication of the facetted/smooth distinction is that similar forms consist of significantly more faces in their facetted than in their smooth version. For example, a facetted cylinder's curved surface consists of a number of faces approximating its curved side. In its smooth version, the curved side of a cylinder is a single face. Similarly, a smooth sphere consists of a single face, but its curved surface is approximated by many flat faces in its facetted reincarnation. Exactly how many depends on the level at which its resolution is set. When objects are generated their resolution is set in the Display Resolution tab that can be found in most of the dialogs associated with drawing and object generating tools, as we have already seen in section 3.5. Interestingly, the options in this tab affect both the facetted and the smooth objects, even though the latter are by definition "resolution independent." Even smooth shapes and forms need to be approximated with straight segments and flat facets in order to be displayed on a computer screen or plotted on paper. Thus the options in the Display Resolution tab also control this display approximation, but have no effect on the internal representation of the smooth objects. In contrast, they affect how facetted objects are stored internally. These are displayed as they are stored. 35
3.10 Drawing 2D enclosures The 2D enclosures are double line ( wall ) shapes that are created from the single line drawings you draw. They are appropriate for the representation of architectural floor plans. They are created by the system when you select the respective modifier from the Object Type palette and use one of the drawing tools to draw a shape. In this section, you will redraw the shapes you drew in sections 3.4, 3.5, and 3.6 with the 2D Enclosure modifier active. Open the Shapes project you saved at the end of section 3.6, and draw under the previous shapes. Turn on the Grid Snap. Select 2D Enclosure. Draw shapes A through E, as in 3.4, 3.5, and 3.6. a1 a2 A b2 b3 c2 B C c3 b1 b4 c1 c4 D d3 d2 d1 +z e2 e1 E e3 e5 e8 e4 e6 e7 Each single line you drew was transformed into a double line by generating parallel lines to the left and to the right at a distance of 1'. The program used the default parameters, which can be changed in the 2D Enclosure Options dialog or tool palette options. You can enter different values in the Wall Width field and you can select Left or Right Justification, instead of the default Center. While you have been drawing on a 2D projection, your shapes actually exist in 3D space. From View menu, select z=30 x=60. You can now see your shapes in a 3D view. You will need them again in section 8.1 to derive other objects from them. From File menu, select Save. Your project has been saved under the name Shapes you entered earlier. 36 -x -y +z -z +y +x
3.11 Drawing with numeric input Objects can be drawn and all the operations of form Z can be executed by typing numbers in the Prompts palette, using the keyboard. In this section you will draw two 2D shapes using numeric input, rather than the mouse. Select Edit: Clear and View: Top. Click on the little box labeled T in the Prompts palette to deselect it. T stands for tracking. When you deselect this box, the numeric fields in the Prompts palette remain blank until you type in a number. We suggested that you deselect it to be able to read your numbers better. This is optional. Select 2D Surface. Select the Vector Line tool. Place the mouse cursor in the Prompts palette. Type: -400, 200 and press return (Macintosh) or enter (Windows). Type: -400, 400, hit return/enter. A line is drawn on your screen. Type: -200, 200, hit return/enter. Type: e. The open shape shown is generated. The system drew to the numbers you typed. You also noticed that each time you pressed return/enter, different numbers appeared where you typed yours. That is, when you typed -400, 200 and pressed return/enter, the numbers -33'-4", 16'-8", 0'-0" appeared in the Prompts palette. The system simply interpreted your numbers as inches and redisplayed them using the format currently selected in the Working Units dialog (invoked from the Options menu). The e told it to terminate the drawing process. This is equivalent to the double click when you draw with the mouse. You could have closed the shape by entering the character c. Note that a comma should be typed between numbers to separate them. Next you will draw a rectangle. Select the Rectangle tool. Press return/enter. This produces zeros. Type: 250, 250 and hit return/enter. A square, with one of its corners at the origin, is created and displayed. 37