Working with Objects and Object Points
This is Chapter 3 of the OpenOffice.org 3 Draw Guide, produced by the OOoAuthors group. A PDF of this chapter is available from this wiki page.
- 1 Introduction
- 2 Moving and dynamically adjusting an object's size
- 3 Rotating and shearing an object using the mouse
- 4 Setting size and position exactly
- 5 Editing object points
- 6 An alternative way to change the form of basic shapes
- 7 How curves work
This chapter looks at the tools and functions that let you modify existing drawings. All of the functions apply to a selected object or group of objects, which can be distinguished by small colored squares or circles located around it. These points are called handles.
The handles form a rectangular frame that is just big enough to contain the object. Where several objects are selected, the frame around them corresponds to the smallest rectangle that can contain all of the objects. This frame is called the selection rectangle.
If the Options bar is displayed (select View > Toolbars > Options to turn it on, if it is not displayed), you can change the size of the handles using two buttons: Simple Handles shows the handles as flat squares; otherwise they are shown in 3D. Large Handles increases the size of the handles. You can combine the two effects. The figure below shows the location of the handles and other buttons.
There are three selection modes:
- Moving and changing size
- Rotating points
|In standard mode (when you begin a new drawing), the Points button is not active, and the default mode is for selections to be moved or changed in size; these selections are indicated by small green squares.|
|When the Points button is active, the default mode is for selections to be edited; these selections are indicated by blue squares. Some objects will have one or more extra handles, which are larger or colored differently. This is explained in more detail in Editing object points.|
|Selections for rotating objects are indicated by small red circles and a symbol representing the center of rotation. To choose these selections, click on the Effects drop-down button from the Drawing toolbar and after that on the object.|
Changing the selection mode
To go from one mode to another, you can do one of the following:
- Choose the Points button from the Drawing toolbar to switch from simple selection mode to Points mode. You can also use the keyboard shortcut F8 (Points). See Editing object points for details on using Points mode.
- Choose the Effects drop-down button from the Drawing Toolbar to activate the Rotation mode for a selected object. To exit Rotation mode, click on the Selection icon .
- If you often work in Rotation mode, you can choose the Rotation Mode after Clicking Object button from the Options bar and cycle through normal and rotation modes just by clicking on the object. This can be more convenient than repeatedly clicking the selected object, then clicking the Rotate button from the Drawing toolbar.
The easiest way to select an object is to click directly on it. For objects that are not filled, click on the object's outline to select it. One click selects; a second click deselects. To select or deselect more than one object, hold the shift button down while clicking.
Selection by framing
You can also select several objects at once by using the mouse to drag a large rectangle around the objects with the Select button, as shown. For this to work, the icon on the Drawing toolbar must be active.
Only objects that lie entirely within the rectangle will be selected.
Even if objects are located behind others and not visible, they can still be selected. Hold down the Alt key and click where the object is located. If there are several overlapping objects, hold down the Alt key and click until you reach the object you want. To cycle through the objects in reverse order, hold down the Alt+Shift keys and click. The number and type of the selected objects is shown at the left of the status bar to help you to select the correct object.
|This method generally works in Windows, but on a Linux system it usually does not. If the Alt key on your system does not operate as described above, use the Tab key method described below.|
To select an object that is covered by another object using the keyboard, use the Tab key to cycle through the objects, stopping at the object you wish to select. To cycle through the objects in reverse order, press Shift+Tab. This is a very quick way to reach the object you want, but it may not be practical if you have a large number of objects in your drawing.
When you click on the selected object, its outline will appear briefly through the objects covering it.
In the illustration to the right, the square located beneath the circle was selected in this way (the circle has been made semi-transparent in order to show the square).
In a complex drawing, several objects may be stacked on top of one another. To rearrange the stacking order (move an object to the front or to the back of the stack), select the object, click Modify > Arrange and choose Bring Forward or Send Backward. Or right-click the object, choose Arrange from the context menu, then choose Bring Forward or Send Backward.
These options are also available from the Arrange tear-off toolbar accessible from the icon on the Drawing toolbar. A keyboard shortcut is Shift+Ctrl+plus sign to bring an object to the top, and Shift+Ctrl+minus sign to send an object to the bottom.
Note, however, that an object located on the Controls layer always lies above all other objects.
Moving and dynamically adjusting an object's size
There are several ways of moving or changing the size of an object. The dynamic method described here uses the mouse.
When you dynamically change an object, remember to check the left-hand area of the status bar at the bottom of the Draw window. This area shows detailed information about the ongoing manipulation
For example, when you are resizing an object, the object information fields show which object is selected, the current position in X/Y coordinates, and object dimensions (width x height). The information changes as the mouse is moved. The units of measurement are those selected under Tools > Options > OpenOffice.org Draw > General.
Dynamic movement of objects
To move an object, select it and then click within the object's border and hold down the left mouse button while dragging the mouse. During movement, the shape of the object appears as dotted lines to help with repositioning.
To drop the object at its new location, release the mouse button. The new position appears immediately in the Status Bar.
Dynamic size modification of objects
To change the size of a selected object (or a group of selected objects) with the mouse, move one of the handles located around the selection. As shown in the illustration, the outline of the resulting new object appears as a dotted line while the mouse button is pressed.
The results depend on which handle you use. To resize an object along one axis, use the appropriate side handle. To resize along both axes, use a corner handle. The new size appears immediately in the status bar.
|If you press the Shift key while resizing an object, the change in size will be carried out symmetrically with respect to the two axes, so that the aspect ratio of the object remains the same.|
Dynamic size modification of objects with the help of the status bar
If you select an object and modify it using the mouse, the changes are immediately reflected in the information field of the status bar. With geometric shapes (such as basic shapes, symbol shapes, block arrows), the only information shown in the status bar is that the shape is being resized, as shown in the top-left image below. With geometric elements (rectangles, circles, and so on), the changes to the attributes of the element (either relative or absolute) are also shown, as in the top-right image.
In the case of a rectangle, the new size is shown as percentages of the original x and y dimensions. For a line, much more information is given: the absolute change in x and y coordinates of the end point being moved, together with the current length and bearing of the modified line. These are updated dynamically as the end point is moved.
This is the only place where the exact start and end angles of an arc or the length and bearing of a sloping line are shown. This information enables you to size the object with considerable accuracy.
Modifying an arc
The beginning and end points of an arc can be modified. Select the arc and click on the Points icon on the Drawing toolbar to enter the Edit points mode (described later in this chapter). In this mode, the handles on the selection frame change — two larger blue handles appear at the beginning and end points of the arc. When the mouse hovers over one of these points the cursor will change to a hand.
If you click and hold the mouse button when the hand cursor appears, moving the mouse will change the location of the start or end point of the arc. The actual coordinates are shown in the Status Bar (see lower left graphic in previous paragraph).
Rotating and shearing an object using the mouse
Use the red rotation handles to either rotate an object around an axis or slant or shear the object.
To rotate an object (or a group of objects), drag a red corner handle point of the selection with the mouse. The mouse cursor takes the shape of an arc of a circle with an arrow at each end. A dotted outline of the object being rotated appears and the current angle of rotation is dynamically shown in the status bar.
|Rotation works in a slightly different way for 3D objects because the rotation occurs in 3D space and not in one plane. See Working with 3D Objects regarding rotation when the Edit Points mode is active.|
Rotations are made about an axis which is displayed as a small symbol. This is normally located at the midpoint of the object, but you can move the axis of rotation with the mouse to any location you like, even outside the object.
If you hold down the Shift key during the rotation, the operation will be carried out in increments of 15°.
Changing inclination or perspective
To slant or shear objects, use the red handles located at the midpoint of an edge of the selected objects. The mouse pointer changes to a when the pointer hovers over one of these midpoint handles. Not every object can be slanted — basic shapes can be rotated but not slanted.
The slant axis is the point directly opposite the midpoint handle to be used for shearing the object. This point stays fixed in location; the other sides and edges move in relation to it as the mouse is dragged (make sure that the icon is showing before dragging).
The figure below shows how the vertices move in relation to each other during the shearing process. The circles represent the path of the vertices. The inclination axis is the bottom vertex of the triangle (the slanting handle used is the midpoint of the upper enclosing frame). All points on the figure will move through the same angle irrespective of the final shape. The actual angle is shown in the status bar.
|The triangle in shown above was produced with the (unfilled) polygon tool and then Close Object was selected from the context menu.|
This tool can be used to produce perspective drawings. The following series of pictures shows the method of constructing a cuboid or rectangular prism. To shorten the edges leading from front to back, reduce the length before you distort the height or width of the surface.
|Perspective production of a cuboid|
As with rotation, you can make the slanting occur in steps of 15° by pressing the Shift key while moving the handle.
Setting size and position exactly
You can position and resize objects with the mouse, but this method is not very exact. If you need accurate positioning of objects, use Format > Position and Size from the menu bar, or right-click the object and select Position and Size from the context menu, or press F4.
Position and Size
Open the Position and Size dialog and click on the first tab to set the appropriate values.
Position is defined as an X,Y coordinate relative to a fixed point (the base point), typically located at the upper left of the drawing area. If desired, you can temporarily change this base point to make positioning or dimensioning simpler (click on the radio button corresponding to the location of the base point in either of the two selection windows on the right side of the dialog — upper for positioning or lower for dimensioning). The possible base point positions correspond to the handles on the selection frame plus a central point. The change in position lasts only as long as you have the dialog open; when you close this dialog, Draw resets the base point to the standard position.
|The Keep ratio checkbox is very useful. Click it to keep the ratio of width to height fixed while you change the size of an object.|
Either or both the size and position can be protected so that they cannot be inadvertently changed. Check the appropriate boxes to achieve this.
Click on the Rotation tab of the Position and Size dialog. Here you can define the rotation angle, as well as the location of the pivot point.
Slant and corner radius
With some Draw objects the slant angle (inclination or shearing) and corner radius can be set in this dialog.
|Example of setting rounded corners|
You can use this dialog to round the corners of the usual Draw objects — text boxes, legends, rectangles, and squares, as shown above. The same effect can be achieved when you are in the points mode (by clicking the Points icon on the Drawing toolbar), by dragging the large handle with the mouse. The larger the value for the corner radius, the more round will be the object.
You can shear the older, classic Draw objects, but not the newer Shape objects. Enter the slant angle in the box marked Slant Angle.
|Example of setting the slant angle in a classic Draw object|
Editing object points
For polygons and Bézier curves, Draw offers a complete set of tools that let you accurately edit the contour of an object. To edit other objects in the same way, you must first convert them into curves. To do this, select the object, then right-click and choose Convert > To Curve or choose Modify > Convert > To Curve from the menu bar.
You can also convert the shapes to a polygon (Convert > To Polygon). With polygons, the edge points are always connected with straight lines and not with curves. Some of the techniques described work equally with polygons as with curves.
An alternative way to change the form of basic shapes
In current versions of Draw, many of the new shapes can be directly edited without having to convert them to curves first. You can recognize these objects by the presence of one (or more) circular yellow handles. The mouse pointer changes shape when hovered over a yellow handle.
If you drag one of these handles, you can modify the shape of the object; the type of change is dependent on the shape itself. For example, you can round the corners of a rectangle or square, change the angles of an arc or ellipse, or alter the control points of a circular or elliptical segment.
How curves work
The editing of curves depends on the mathematics of Bézier curves. The complete study of such curves goes beyond this scope of this guide, and only the basics are covered here. Advanced Draw Techniques provides more information on drawing and manipulating Bézier curves.
The editing of a Bézier curve consists in principle of moving points or tangents passing through these points. Each tangent has two control points — one at each end — and a junction point where it meets the curve. The relative angle and distance between the control points determine the shape of the curve. The figure shows several variations starting from a basic circle and changing only one point on the circle.
You can create many different shapes by moving either the junction point itself, or one or both of the round handle points at either end of the tangent.
Draw offers even more possibilities when you use the functions on the Bézier curve toolbar.
The Edit Points toolbar
When you work in Edit Points mode, use the Edit Points toolbar. To activate this toolbar, choose View > Toolbars > Edit Points. It will then appear whenever you select a curve and the Edit Points icon on the Drawing toolbar is active.
On this toolbar, icons may be active or inactive depending on the selected object and object point. With the Convert to Curve icon, you can determine for individual points whether their connection will be made with straight lines or with curves.
Only with curves are the icons for tangents activated. An object that contains no curves is treated as a polygon.
The three kinds of tangent
Three buttons in the Edit Points Toolbar let you select the type of tangent and convert from one type to another. Only one of these buttons can be active at any given time. Their use is described in the following chapter.
The other buttons in the Edit Points Toolbar are described here in relation to working examples. The following examples start from a filled circle. As mentioned earlier, in order to use Edit Points mode, you first need to convert the object to a curve.
You will notice that after the conversion, the handles located in the corners of the rectangle have disappeared. This behavior is normal in that the handles which are used in the Edit Points mode are located along the outline or trace of the drawn object.
- Bézier curves were invented by Pierre Bézier, an engineer working with the Renault car manufacturer, who developed the technique in the 1960s. The technology was intended to make modeling the surface of vehicles easier.
|Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).|