Advanced Draw Techniques
This is Chapter 10 of the OpenOffice.org 3 Draw Guide, produced by the OOoAuthors group. A PDF of this chapter is available from this wiki page.
- 1 Drawing to scale
- 2 Dimensioning a drawing
- 3 Working with text in Draw
- 4 Guide to Bézier curves
- 4.1 Bézier curves — what are they?
- 4.2 Direct drawing of a Bézier curve
- 4.3 Point mode of the Bézier curve
- 4.4 Drawing a succession of Bézier curves
- 4.5 Transition points
- 4.6 Closing the curve
- 4.7 Transformation between straight line and Bézier curve
- 4.8 Transform complete curves, polylines and polygons
- 4.9 Freehand lines
- 4.10 Combining closed curves
- 4.11 Connecting curves
- 5 Adding comments to a drawing
- 6 Connecting and breaking lines
Drawing to scale
Draw is not a CAD (computer-aided design) program but a graphics program with which you can produce drawings to a scale. The example used for this chapter is a drawing of a Logic Circuit Diagram. The exact meaning of the individual symbols is not described here as we are only interested in the drawing techniques used to produce the diagram.
The logic symbols shown below form the building block library for our scale drawing.
Working with the Position and Size dialog
So that the edges of the building block symbols do not coincide with the wiring, they should be 8 mm wide and 8 mm high. The connections to the symbols should have a length and separation of at least 5 mm. These values are all random values and you would normally substitute values that suit your own needs.
For the drawing we used a measurement unit of millimeters, a grid spacing of 5 mm, and a grid subdivision of 4 points. In addition you should probably activate Display grid and Guides when moving as well as Snap to grid (see Positioning objects with snap functions). This drawing will serve later as a collection of available symbols and you should not only draw the symbols but fully detail them as well.
The first step is to draw a base element, an AND gate block. You can then dimension and detail this element (use the Position and Size dialog, as shown below; double-click on the status bar or context menu to help with dimensioning). For this example, the left upper corner of the block is at x=10 mm and y=5 mm.
Draw the first connection lead by eye and dimension and position it using the Position and Size dialog.
Use the same method to draw the remaining two leads. For positioning the input leads, fix the right end points; for the output lead, fix the left one. The first wire lies 1.5 mm below the upper edge of the block. The leads have a 5 mm spacing between them. The following table shows the relevant coordinates of the upper corner points and the leads.
|left (X/Y) [mm]||right (X/Y) [mm]||Input 1 (X/Y) [mm]||Output (X/Y) [mm]|
|10 / 5||18 / 5||10 / 6.5 (right EP.)||18 / 6.5 (left EP.)|
For the lower input lead, increase the Y coordinate of Input 1 by 5 mm to 11.5.
The AND gate block is almost finished. We can use it as the basis for all the other gates. So that the drawing gives a good visual impression, use Edit > Duplicate to ensure uniformity of shape and size.
Because we want to copy the block vertically downwards, use a Placement on the X Axis of 0 mm and on the Y Axis 15 mm.
With the same method, copy both blocks twice more to the right. Select both blocks, call up the Duplicate dialog, and use placement values of 30 mm (X) and 0 mm (Y). Your drawing should look similar to the one below.
For the INVERTER or NOT gate the connection leads must be amended. Move one input and one output lead to the middle of the block and delete the superfluous input lead.
Draw the missing circle for negation with a diameter of 2 mm, place it by eye in the center and then position it and dimension the connections from the Position and Size dialog as described above.
You can copy the circle to the Clipboard and then paste it as many times as you need, positioning it and adjusting the lead lengths as above.
A wiring diagram also needs a symbol to show a connection point. Draw a filled circle for this.
Next add text to the symbols (&, =1 etc.). Activate the icon on the Options Toolbar. Double-clicking a symbol will now put you in a special text input mode. This integrates the text as an element in the object (see also Chapter 2 of this guide). You will find the OR symbol (≤) in the list of special characters (Insert > Special Characters).
It is probably a good idea to create a group for each type of gate. This will make it easier to use them in a diagram. Your diagram should now resemble the logic symbol library at the beginning of this section; save it to disk.
If you want you can add a name to each of the gate symbols (AND, OR ..), use a separate layer to add this text so that you can switch it off when necessary.
You can place glue points at the end of each connection lead. This will simplify the actual "wiring up" later when you add in the connectors.
Setting glue points
|If objects are included in a group it is not possible to add glue points to them. Glue points must be set before any grouping is done.|
The glue points on the connection leads must be placed exactly at the ends of the lines (otherwise the wires will not be properly aligned).Unfortunately you cannot set the position of glue points using numerical values. It is necessary to do it by hand.
The best solution is to use the Zoom toolbar to enlarge the diagrams. You can find this as a tearoff toolbar on the standard Drawing toolbar. It contains (among others) tools for zooming in and for zooming out (enlarging the view/making the view smaller) of the current view. If you click on the Zoom In tool and then click on the page, the scale is doubled and the view is centered on the place where you clicked.
As the ends of the connection leads in this example do not lie on grid points, you must switch off Snap to Grid and activate Snap to Object Points.
Select the block on which you want to insert a glue point. Click the Insert Glue Point icon . It is now activated and appears with a different background. The mouse cursor changes to a small cross and you can set the first glue point. Click the mouse at the desired location. If the point is not exactly where you want it, move it by dragging with the mouse.
When you are satisfied with the location, click on the Glue Points toolbar the icon with the exit direction you want (left, right, top or bottom). The selected icon now has a different (lighter or darker) background. Set the exit direction of the input connection leads to the left and the output leads to the right.
When you have set a glue point at the end of each gate's connection lead, you can copy it into the Gallery.
Copying individual pictures to the Gallery
The Gallery is a very convenient way of controlling building blocks for drawings. It also functions as a symbol library.
The Gallery appears above the drawing page. The left pane shows the folders available for use and the right pane shows the images contained in the current folder. Choose an image by clicking on it; additional information about the image appears in the header bar.
In the left pane, click the New Theme button to create a new folder. A new window opens. Click on the General tab and give the new theme a meaningful name (for example Logic) to replace the default of New Theme. You can rename a theme by right-clicking it in the folders pane on the left.
To import existing images into the Gallery, click on the Files tab and then on the Find Files... button. It is possible to bring in complete folders or individual files; the procedure is self-evident from the dialog windows that open, or see Chapter 14 (Working with the Gallery) in the Getting Started guide.
You can drag and drop Draw objects straight into the Gallery. (The Properties window can be closed after typing in the name.) First select the destination folder, then click on the first symbol that you wish to add to the Gallery. Position the mouse cursor inside the selection frame of the symbol. When the crossed arrows are visible, click on the symbol and keep the mouse button pressed. After about 1 or 2 seconds the cursor will briefly blink and change to the drag symbol. Drag the object into the Gallery and release the mouse button. When you move the mouse into the Gallery field, the cursor shape changes once more.
|Zoom in on very small graphics before you try to move them so that the crossed arrow symbol can be clearly seen.|
When you have placed all the symbols in the Gallery they can be titled. Right-click on a symbol, choose Title from the menu and type the symbol name (AND, OR).
The symbol library is available to all OOo modules, at least for users who have the permission/rights to access it. Making available the drawing collection as a Draw file is the simplest way to distribute a symbol library to other users. After opening the drawing, other users can easily transfer the drawing objects into their own Gallery, as described above.
Drawing a logic circuit diagram using the Gallery
The use of the symbol library which you have created and placed in the Gallery can be illustrated by using the blocks to draw a half adder (see http://en.wikipedia.org/wiki/Half_adder#Half_adder). You can precisely place all the drawing objects with the help of Draw's snap functions. The following instructions are only one way to achieve this objective.
Begin with a new drawing. Set the unit of measurement to centimeter, a grid point spacing of 0.5 cm and subdivision of 4 points. Activate the grid, guiding lines, and associated snap functions.
In the first part of the exercise you should draw only the two signal leads a and b, the two INVERTER gates and the two AND gates.
Begin by drawing the two signal leads. To make it a bit easier, you can use the values in the following table.
|Signal wire a||X = 2 cm / Y = 3.0 cm||5.5 cm|
|Signal wire b||X = 3 cm / Y = 3.0 cm||5.5 cm|
After drawing the two signal leads, you begin the hardest part. With grouped objects the snap function works only on points on the outside contours. The only way to work with these blocks as a unit, however, is as a grouped object. The input and output leads must lie right on grid points if the connecting lines are to be exactly horizontal or vertical.
Position two horizontal guiding lines (A, B) on the grid with Y=4.0 cm and Y=6.0 cm. With Snap to Grid active, this should be no problem. With an INVERTER gate the input and output leads lie in the middle of the block, 4 mm below the upper edge. In order that the input and output are docked to the guiding line, the upper edges of the INVERTER gate must be positioned (for a 5 mm grid spacing) at Y=4.1 cm and Y=6.1 cm. Right-click on the guiding line, select Edit guiding line from the context menu and set the guiding lines to 4.1 cm and 6.1 cm.
In order that the blocks lie exactly underneath each other, insert vertical guiding lines at X=5.0 cm (INVERTER gate) and X=8.0 cm (AND gate).
Now open the Gallery and drag the Inverter gate into approximately 0.64, the position desired. If the function Snap to guiding line is still active, you will be able to accurately position both blocks in the correct location. Your diagram should now look like the figure below and you can save it.
The input and output leads of the INVERTER lie at Y=4.5 cm and Y=6.5 cm. Move the mouse over a guiding line. When the mouse cursor changes to a double arrow, drag the guiding line (with the left mouse button pressed) onto the input and output leads of the block. If the grid snap is still active, this should be exactly positioned without much effort.
The leads of the AND gate lie 1.5 mm below the upper edges of the two horizontal guiding lines. They must be moved up for the next step. The Y coordinates are reduced to 4.35 cm and 6.35 cm (the top edges of the AND gates). When you have moved the lines, you can drag both AND gates from the Gallery and position them. Your drawing should now resemble that in the next figure.
Next drag the horizontal guiding lines again over the input and output of the gates (Y=4.5/6.5 cm), so that when you position the connection point of the leads (a small black circle) it will sit exactly on top of the leads from the gates.
To position the two last gates, you need to set the following additional guiding lines: a vertical line with X=11 cm and two horizontal lines (C,D) at Y=5.5 cm and Y=7.5 cm respectively. Shift the horizontal lines C and D each 1.5mm upwards (so that Y=5.35 cm and Y=7.35 cm).
Drag the OR and the last AND gate from the gallery and position them as shown below.
Since the OR gate will be connected to the two previously positioned AND gates, you can delete the guiding line of the OR gate. Drag the0.64 horizontal guiding line C and D over the inputs of the AND gates (Y=7.0 and 7.5 cm) and put two other lines (E,F) on the remaining connections (Y=5.0 and 8.0 cm) as shown in Step 4 below.
Deactivate all snap functions except snap to grid. It is a good idea to zoom in so that you can place the lead connections exactly over the intersection points. Drag the connections singly from the Gallery to where you want to position them. You will need to adjust their position with the mouse. The easiest way is to move the connection diagonally to the desired location (See the "Setting connections" figure at the bottom of this section).
The guiding lines are no longer needed and can be hidden (it is better to wait until you have finished the drawing before you delete them). Your drawing should now start to look like this and can be again saved.
The individual blocks must now be joined up so that the gates function as a half adder system. To do this, you use connectors. Open the Connector toolbar. Use the standard connector to join the OR to the two AND gates. All the other leads run horizontally and you can use the direct connector .
When all six lead connections have been positioned, both signal wires should have a small black circle added to their connection points. You can use the symbol for NOT from the Gallery as the basis for this.
If you have correctly positioned the symbols in the drawing, all the connection leads will be straight lines. At this time you can delete all the guiding lines, add text to the drawing and your finished drawing should resemble Step 4 above.
Dimensioning a drawing
Configuring the dimensioning style
As is usual with OOo, you configure dimensioning using its own style.
After opening a drawing, press F11 to access the Styles and Formatting window. In the Graphic Styles list, right-click on the style Dimension Line and select Modify. The dialog that opens contains the current settings. Click the Dimensioning tab.
You can configure all the properties you see in this window to suit your own needs. The left section includes the basic settings for dimension lines and dimension guide lines (these indicate where on the object the dimension is referenced):
- Line distance: the distance of the dimension arrow from the object edge
- Guide overhang: the distance the guide line extends past the arrow
- Guide distance: the distance of the guide line from the object edge
You can individually set the line lengths of the right and left guide lines and use positive or negative values to have the line above or below the reference point. The direction of the line with positive or negative distances depends on the setting of the Measure below object option (box checked or not), but this is easy to check by referring to the example dimension line in the bottom window of the dialog. For this current exercise click the box and activate this option.
In the right section you can change the settings for the Legend, the text of the dimension line. You can use the Text position choices to change the location of the text — but only if one or both of the AutoVertical and AutoHorizontal checkboxes are unchecked. Use the various options on the Text and Alignment tabs to further change the text format.
Calculation of dimensions always takes into account the scale and 0.64 dimension units contained in Tools > Options > Draw > General. If you set a scale of 1:10 and a unit of centimeter, then a 6 cm long object in the drawing will be shown with a dimension of 60 cm when the option Show meas. unit is activated and the selection window is set to Automatic. Deselecting this option turns off the display of units. You can change the units displayed from Centimeters to (for example) Millimeters by choosing Millimeter instead of Automatic in the selection window.
Adjust the font type and size for the text of a dimension line by means of the Text tab.
The Standard button at the bottom of the dialog sets all the properties of the dimension line to the (inherited) standard properties of the style.
In this exercise you will dimension some logic blocks. They are used here to demonstrate the technique; you can use your own drawing or fetch a picture from the Gallery.
So that Draw can clearly recognize the edges to be measured, you should set a number of guide lines delineating the edges. The previous sections explain how to do this. To place the guide lines exactly and easily, change the resolution of the Grid. Suitable values for this work are a resolution of 5 mm and a subdivision of 4 points. With this setting you should have a snap to grid function with 1 mm point separation.
We will begin by dimensioning the NOT gate. For this block we want the total width (18 mm) and the width of the block itself (8 mm) to have dimension lines. The first step is to add guide lines to delimit the dimension lines. With Snap to grid activated, you can position these quite accurately as in "a)" below. Watch that the function Snap to guide lines is active and zoom in to the part of the block to be dimensioned. The block should not be selected.
Start the dimensioning command by clicking the Dimension Line icon on the Lines and Arrows dialog. The dimension line is placed automatically on the Dimension Lines layer so you can hide the dimension lines if you wish.
After clicking the Dimension Line icon, the mouse cursor changes into a small cross. As we activated the option Dimension Line — Measure below Object, the dimensioning should be made in a counterclockwise direction. Place the mouse cursor at the left dimensioning point. Press the left mouse button and drag the mouse to the right dimensioning point. Release the mouse button. If you press the Shift key while dragging the mouse, you will restrain the dimensioning line in a horizontal (or vertical) direction as in "b)".
In the same way you can draw a vertical dimension line on the AND gate. The dimensioning of the NEGATION symbol should also be simple to accomplish, but it is important that for such small components you zoom in enough to accurately position the lines.
Editing dimension lines
Dimension lines can be subsequently edited. You can select single dimension lines which are displayed with four handles, located at the end of the dimension lines.
With the upper handles you can (only) change the length of the guide lines. With the lower handles you can move the points that are being dimensioned. If you select the dimension text, you can edit the font type and size as well as changing the dimension units of the text.
If you only want to edit the text of the dimension, double-click on an unselected dimension line to enter text edit mode.
All the changes that you make relate only to the selected dimension line. They are stored and persistent, but do not affect the settings of the Dimension Line style. If you insert other dimension lines, they will have the settings contained in the style.
If you want to make general setting changes to the Dimension Lines style, change the appropriate style. As soon as you confirm the changes with OK, the new settings will be applied to all dimension lines.
Working with text in Draw
You can use text in Draw in various ways:
- as a text element
- as text associated with a picture
- as an element out of the Fontwork gallery
- as a Writer OLE object
Configuring text elements with styles
Text, like all drawing objects, can be associated with styles. The text settings in styles always affect the whole text element. You can format individual parts of a text element, but only by using manual formatting, which does not relate at all to styles and templates. Styles for characters and paragraphs do not exist in Draw.
Open the Styles and Formatting dialog by pressing F11. Access the formatting dialogs using the toolbar icons, the context menu, or the Format menu.
The Indents and Spacing, Text, Text effects, Tabs and Alignment tabs of the style dialog function the same as in text documents, although some options are not available in Draw. Specific to drawing objects are the tabs Text and Text Animation.
On the Text Animation tab, you can set how the text moves within the object frame. Such effects are interesting mainly for documents that are to be shown on the screen. They are therefore more commonly used in the Impress module. For printed text they do not make any real sense and are not dealt with further in this guide.
On the Text tab, you can determine the behavior of the text block in relation to the border of the drawing object. The same settings can be altered — as manual formatting — under the Text... command in the Format menu or in the context menu.
The type of drawing object determines which settings are active and what effect they have on the text. Shapes behave differently to other drawing objects. To experiment with the settings, use objects with rounded edges so that differences in spacing and alignment show up better.
To try out the different settings possible for text anchors, start by drawing an ellipse from the Basic Shapes toolbar , change into Text edit mode by double-clicking on the ellipse and write several, not too long lines of text. Repeat with an ellipse from the Circles and Ovals toolbar (a classical drawing object).
|In the Text tab of the Edit Style dialog, set the values of the Spacing to Borders to 0 cm for all four directions.|
|Set Options as Left in the tab Alignment.|
Now we can try out some of the different possibilities of text anchoring.
If you checked the option Full width, the text block is always centered horizontally. The area of the text block is as great as possible; here it extends either to the edge of the figure or object frame or (when not that wide) the width that is necessary to fit the length of the longest line. The difference becomes clear if you position the text on the left, but you set single lines through hand formatting to be aligned on the right.
In the examples below, the first line of text was shortened to "First line with", spacings were set to 0 and text anchor to middle left.
|Shapes||Classical drawing objects|
|Without option "Full width"|
|With option "Full width"|
Fitting text in frames
Here you find that shapes and classic Draw objects behave completely differently.
For shapes the options on the right are active.
These have the following effects.
|Word wrap text in shape:||No automatic hyphenation is available and you cannot insert a fixed hyphen.
If the text does not fit in the shape it hangs over or under the outside of the shape.
|Resize shape to fit text:||Watch out! If you turn on this option it is not possible to undo the size changes — neither using the Undo function on the menu nor by switching off the option in the dialog.|
For the classic drawing objects, both lower left options in the dialog are active.
These options have the following effects.
|Fit to frame:||The text is widened and compressed so that it fills out to the object frames.|
|Adjust to contour:||All the text is contained within the figure. It is split over several lines if necessary. Any text which does not fit in the figure is not shown, but is still retained.
Note that even if you have activated hyphenation, words will be split without regard to the hyphenation rules.
Distance from frame
Spacing settings are added to the text. In this way the text block is invisibly reduced or (with negative values) made bigger.
In the examples below, the text (M) is centered horizontally and the text block is anchored in the upper middle part of the frame.
|Value for spacing "Above"||-2 cm||-1 cm||0 cm||1 cm||2 cm||3 cm|
|The behavior is the same for classic drawing objects and shapes.|
If you anchor the text above, below, right or left, a positive spacing value positions the text in such a way that it sits close to the outside of the object frame at the anchoring point. Anchoring in the middle does not result in this movement.
It is easier to add text to a straight line if the line is created as a very thin rectangle. Choose an anchor point in the middle of the rectangle and then determine the exact position of the text by setting the spacing accordingly.
Text added to open line types such as Bézier curves (curves and freehand lines), Polylines (polygon and polygon 45°), and Arcs is also positioned in relation to the enclosing object frame. If you want to see the extent of this frame, just click on the object. To add text along one of these lines, you can use the Fontwork tool described in the Fontwork Gallery section.
Text added as described above is rotated when the object is rotated. The property settings, particularly those dealing with spacing relative to the frame, relate only to situations where the object is not rotated.
Text frames and callouts
To test the range of setting possibilities, use a text frame or a callout with rounded corners. For text frames, as for rectangles, you can set the rounding in the Position and Size dialog (Slant & Corner radius) or in Points mode. The latter makes sense only if you have a visible outline. With callouts (as with text frames in Points mode), drag the larger marker in the left upper corner with the mouse to give the desired amount of rounding. An example of this is shown below.
|Legend with rounded corners
Unlike drawing objects, text frames and callouts support automatic line breaks and you can switch on automatic hyphenation under Tools > Language > Hyphenation.
Non-breaking dashes and protected separators are however not available. For a manual line break use, as elsewhere, the key combination Shift+Enter.
With the text and callout icons ( and ) you can create text frames and callouts with vertical text. You need to activate Enhanced language support > Enabled for Asian languages in Tools > Options > Language Settings > Languages. Text frames can be rotated like drawing objects, but it is not possible to rotate callouts.
Text frames and callouts do not have a separate text element, but you still use the Text dialog to set formatting properties. As soon as you have input text, the upper three settings on the left side become active. The settings for Spacing to Borders and Text anchors in the lower window area function in a similar manner to normal drawing objects and are not dealt with further here.
Pictures and text
Pictures also possess a text element. You can use this text element to place lettering over the picture or to give the picture a caption. To format this text, proceed in the same way as for a normal rectangle. Usually you produce text as a separate object and then group it with the picture, because this gives you more flexibility.
Here are two examples showing what is technically possible with text elements.
The construction of each example was carried out using a graphics style. Right-click on the picture and choose Edit Style to open the Graphics Styles dialog. You may first wish to choose a different style to edit for the picture, or create a new style for a special purpose. For more about styles, see Changing Object Attributes.
If you store the picture using File > Export, the text is exported along with the graphic. If you use the context menu option Save as graphic, then the text is not exported.
Click the icon to open the Fontwork Gallery which you can use to insert an eye-catching caption to an image. Fontwork drawing objects belong to the shape category. The Gallery contains a selection of popular text forms.
You are not limited to these samples; you can subsequently edit and customize the chosen caption type. Proceed as follows.
If you want to give the text a 3D appearance, refer to the relevant section in Working with 3D Objects.
Writer OLE object
In some cases, text frames are not flexible enough to meet your needs and offer too few possibilities for adjustment. For example, you may want to show a figure in Draw in exactly the form it was created in Writer. The best solution might be to insert an OLE object. This means that the object is linked or connected to the application that created it. Draw makes available to other applications (only) one viewing window. The object itself is not edited in Draw but in the other application.
Use Insert > Object > OLE Object to open the dialog as shown below. Use the Create new option to embed the OLE object in the Draw document. With the Create from file option, you can choose whether the object should be embedded or linked. With a linked file any change in the stored file will be shown in Draw and vice versa: any change you make in Draw will be stored in the file on disk.
If you have decided to embed the object you can still create an independent text document from the OLE object. For this use the Save Copy as command from the context menu.
As soon as you click on OK, the object is created and opens in editing mode. You can recognize this mode by the gray frame around the object and the small black handles.
Take special note of the toolbars. These are no longer those of the Draw module but of the Writer module. You input your text and format it almost the same as if you were in Writer itself. In particular you now have available all the format styles from Writer.
With the handles of the gray frame you can determine which section of the entire text document is visible. You should switch off the ruler view.
Click outside the object to leave editing mode. Double-click on the object or use Edit > Object > Edit to change again into editing mode.
In an embedded Writer OLE object, you can connect to further "sub" OLE objects. You cannot edit a linked Writer "sub" OLE object directly in Draw; you must open it as a text document in Writer. This limitation can be illustrated by the use of formulas. Such formulas are technically OLE objects that belong to the Math module. To use mathematical formulas inside flowing text, save the text in a separate text document and insert it as a linked OLE object in Draw.
Click on an object to enter object mode, recognizable by the presence of the green handles. In object mode you remain in the Draw module.
Possibly you noticed that in edit mode there is no Zoom. Set the size of the OLE object on the Draw page in Object mode from the Position and Size dialog. In the left image below, the object was inserted at the original size, at right the size was reduced. If you change the size, take care that the option Keep ratio is checked or else the object will become distorted. Line and Area properties are not available for OLE objects, nor is it possible to rotate objects as with text frames.
OLE objects can be overlaid just like other drawing objects. In the next figure, a drawing object from the basic shapes menu has been placed behind the OLE object.
The page with the text document has the background property set to transparent. If you change the background color of the OLE object in Edit mode, it will also show in the Draw document.
The Format menu has the entries Area and Line grayed out because they are not usable, but the menu entries Paragraph, Character, Text, and Bullets and Numbering are all available. These relate not to the text object which you are currently editing but rather to a text element within the object, which you can open by pressing F2. (This is similar to the way that pictures are linked with an OLE object.) The double-click, which opens the text element in images, does not work here because it puts you into the OLE object's edit mode. Whether it makes sense to use a text element within text like this is questionable!
Guide to Bézier curves
Bézier curves — what are they?
Bézier curves are very useful for experimenting with the shape and form of curves. In point mode you can change the curve alignment by dragging the points with the mouse. The curve leaves the start point P0 in the direction of the control point P1 and arrives at the end point P3 from the direction of the control point P2. These directions are shown in Draw by blue lines. The more distant a control is from its start or end point the smaller the curvature at that point. If a control point lies directly on one of these points, it has no influence on the curve.
Direct drawing of a Bézier curve
Point mode of the Bézier curve
After drawing a curve using the icon from the Draw toolbar or with the Edit points command from the context menu, you can bring the curve into a point mode from which you edit individual points on the curve. Points on the curve are shown with a square handle ; the control points with a round handle . The starting point of a curve appears somewhat larger than the other points. When you hover the mouse over a curve point the mouse cursor changes to - over a control point it changes to . In point mode the toolbar Edit Points should appear. If not, turn it on from View > Toolbars > Edit Points.
Drawing a succession of Bézier curves
Several lines or Bézier curves can be linked together. The single parts are referred to as segments. Technically such a succession of Bézier curves and lines is known as a path.
Begin the drawing as with a simple Bézier curve. At the end position of the first segment, end not with a double-click but with one of the following:
You can either end the drawing here with a double-click or continue and link in further segments.
For the transition from one segment to the next, there are three different types of points, each with its own properties.
This is the only common point between two segments which are otherwise independent of each other. It is likely that the curve has a kink at this point (depending on the angle of the tangents, the lines from the corner point to each control point.
Smooth transition points
The tangent lines to the common point have the same angle and form a straight line. If you change the position of one of the control points the other also moves, so that the tangents remain in a straight line. This also applies to the case where a Bézier curve meets a straight line: the tangent line lies on the straight line and cannot be moved sideways.
Symmetric transition points
In this case the tangents not only lie on a straight line but the distance of the control points from the curve point is the same. The segments have the same direction and the same curvature at the transition point.
Changing point types
When a point is selected, the Edit Points toolbar activates the three corner point icons.
The circled icons are, from left to right, Corner point, Smooth transition, and Symmetric transition. The latter two icons appear the same but you can identify them by looking at the tooltip. At any time only one of the three icons will be active. To change the type of point, click on one of the other two icons.
Closing the curve
To close an open curve, use Close object from the context menu or the Close Bézier icon from the Edit Points toolbar. A straight line is drawn between the start and end points if these points are Corner points.
If the start and end points are Smooth points or Symmetric points and the control point does not lie directly on the curve point, it changes position so it is in a straight line with the line segment and the closing line will be a curve.
To prevent this happening, change the curve point type before closing to a corner point.
Transformation between straight line and Bézier curve
Transform a straight segment into a Bézier curve
Select the larger of the two handles at the ends of the straight line; this will be the starting point of the curve. After a short time the Convert to curve icon on the Edit Points toolbar becomes active. It starts in the "out" position. Click the icon to turn on the function. The straight line is transformed into a Bézier curve. The type of the segment end point remains as it was. Using this function you can convert one side of a polygon or a part of a polyline into a Bézier curve.
Transform a Bézier curve into a straight segment
Select the larger of the two handles at the ends of the curve; this will be the starting point of the straight segment. After a short time the Convert to curve icon [[Image:]] on the Edit Points toolbar becomes active. It starts in the "in" position. Click the icon to turn off the function. The Bézier curve segment is transformed into a straight line. The type of the segment end point remains as it was. If all segments are straight lines, Draw converts the object to a polygon or a polyline.
Transform complete curves, polylines and polygons
Transform a polygon or a polyline into a curve
Select the whole polygon or polyline. The object does not need to be in point mode. Choose Convert to curve from the context menu or the Modify menu. The points in the resulting curve are all of the type Corner point and the control points lie on the curve segments. All the segments thus appear as straight lines.
Transform a curve into a polygon or a polyline
Select the whole curve. Choose Convert to polygon from the context menu or the Modify menu. The curve does not need to be in point mode to do this. The individual segments are not replaced by straight lines. Instead additional points are generated on the curve so that the line of the polygon/polyline matches that of the curve as closely as possible. These points are placed closer together as the curvature increases.
You can also produce a curved line from a Bézier curve using the freehand line tool . This tool automatically inserts anchor points and control points to render the curve as close as possible to the original Bézier curve.
Place the mouse cursor at the beginning point and keep the mouse button pressed until you reach the end of the curve. As soon as you release the mouse button, the curve is complete.
Combining closed curves
If you draw a Bézier curve segment and, at the end point of the segment, click and hold the mouse button, followed by a single press of the Alt key, the curve is closed with a straight line and you are placed in Combining mode. You can now begin a second curve at an arbitrary point. Ending the drawing with a double-click also closes this curve. If you end it with an Alt-click as described above, you can draw further curves. The curves that you have just drawn form a common object, a so-called Combination. You can use this (for example) to place holes in filled curves.
If you want to bind two curves together into a Combination at some stage, select both curves and use Modify > Combine.
Even if you use a Combination, the individual curves are still available as objects. You can use Modify > Split to convert the Combination back to single objects.
You can create Combinations only from closed curves. Other objects, such as rectangles or polygons, will be automatically transformed into curves, and curves that are not closed will be closed with a straight line.
To join curves together, select them and use Modify > Connect. A connection is only possible with open curves. If you use this tool on closed curves, they are first opened and an additional end point inserted at the starting point. A straight line is used to connect the curves.
The behavior of connected curves cannot (at present) be modified. It is not obvious in advance how the transition properties of the connected curves are calculated, nor which end points will be connected. It is therefore a good idea to work on a copy and try out the effect with different positions of the end points of the individual curves. To avoid changes to a shape, first set the property of the new connection point to the type Corner point.
Adding comments to a drawing
Starting with OOo 3.2, Draw supports comments (formerly called notes) similar to those in Writer and Calc.
Choose Insert > Comment from the menu bar. A small box containing your initials appears in the upper left-hand corner of the Draw page, with a larger text box beside it. Draw has automatically added your name and the date at the bottom of this text box.
Type or paste your comment into the text box. You can optionally apply some basic formatting to parts of the text by selecting it, right-clicking, and choosing from the pop-up menu. From this menu, you can also delete the current comment, all the comments from the same author, or all the comments in the document.
You can move the small comment markers to anywhere you wish on the page. Typically you might place it on or near an object you refer to in the comment.
To show or hide the comment markers, choose View > Comments.
Select Tools > Options > User Data to configure the name you want to appear in the Author field of the comment, or to change it.
If more than one person edits the document, each author is automatically allocated a different background color.
Connecting and breaking lines
It is possible in Draw to join separate line elements into one line. Select a number of lines and choose Modify > Connect. The lines are converted to curves and adjacent end points are joined together. The resulting shape is a polyline, not a closed shape.
To add text to the polyline, press F2 and type the text. To make a closed shape from the polyline, right-click the polyline and choose Close Object. You can add text and also change area properties and edit the object as with any polygon object. Note that you can only use the Close Object command on connected lines, freehand lines and unfilled curves.
If you select a shape and choose Modify > Break, this does not reverse the Connect process but simply converts the polygon into a collection of individual lines. Text added to the shape will be associated with one of the lines (often the last one). You cannot apply a fill to a closed shape made up of lines resulting from the Break command.