Working with Objects and Object Points

From Apache OpenOffice Wiki
Jump to: navigation, search




Introduction

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.

Location of handles on the Options toolbar

Selection modes

There are three selection modes:

  1. Moving and changing size
  2. Editing
  3. Rotating points

To set the default mode (1 or 2) for selecting objects, click on the Points button PointsIcon.png on the Drawing toolbar.

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. DrawSelect1.png
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. DrawSelect2.png
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 EffectsIcon.png from the Drawing toolbar and after that on the object.
DrawSelect3.png

Changing the selection mode

To go from one mode to another, you can do one of the following:

  • Choose the Points button PointsIcon.png 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 EffectsIcon.png to activate the Rotation mode for a selected object. To exit Rotation mode, click on the Selection icon SelectionIcon.png.
  • If you often work in Rotation mode, you can choose the Rotation Mode after Clicking Object button RotationIcon.png 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.

Selecting objects

Direct selection

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 SelectionIcon.png icon on the Drawing toolbar must be active.

Only objects that lie entirely within the rectangle will be selected.

Selecting hidden objects

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.


Note
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).
[[Image:]]

Arranging objects

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 [[Image:]] 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

[[Image:|thumb|Figure 2: Left end of status bar during dynamic adjustment]]

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.
[[Image:]]

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

[[Image:]]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.


Note
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 in Figure 3. 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 Figure 3.

[[Image:|thumb|Figure 3: The Information field during dynamic size modification of objects]]

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 (see Figure 3).

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 [[Image:]] 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.

[[Image:|thumb|Figure 4: Editing an arc]]

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 Figure 3.

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.

Rotating

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.


Note
Rotation works in a slightly different way for 3D objects because the rotation occurs in 3D space and not in one plane. See Chapter 7 (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°.

[[Image:|thumb|Figure 5: Rotating an object]]

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 [[Image:]] 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 [[Image:]] icon is showing before dragging).

Figure 6 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.

[[Image:|thumb| Figure 6: Shearing an object]]


Note
The triangle in Figure 6 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 series of pictures in Figure 7 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.

[[Image:|thumb|Figure 7: 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 (see Figure 8) and click on the first tab to set the appropriate values.

[[Image:|thumb|Figure 8: Position and size of an object]]

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.


Tip
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.


Tip
You cannot move an object? Check to see if the position is protected!

Rotating objects

Click on the Rotation tab of the Position and Size dialog (see Figure 7). Here you can define the rotation angle, as well as the location of the pivot point.

[[Image:|thumb|
Figure 9: Rotating an object]]

Slant and corner radius

With some Draw objects the slant angle (inclination or shearing) and corner radius can be set in this dialog (Figure 10).

[[Image:|thumb|Figure 10: Setting rounded corners and slant angle]]

Corner radius

[[Image:|thumb|Figure 11: 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 in Figure 11. 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.

Slant

You can shear the older, classic Draw objects, but not the newer Shape objects. Enter the slant angle in the box marked Slant Angle.


[[Image:]] [[Image:]] [[Image:]]
 :
Figure 12: 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 as shown in Figure 13. 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.

[[Image:|thumb|Figure 13: Some basic shapes with yellow “handles”]]

How curves work

The editing of curves depends on the mathematics of Bézier curves[1]. The complete study of such curves goes beyond this scope of this guide, and only the basics are covered here. Chapter 10 (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. Figure 14 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.

[[Image:|thumb|Figure 14: Creating different shapes by changing 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, shown in Figure 15. 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.

[[Image:|thumb|<center>
1 Points5 Split Curve 9 Symmetric Transition 2 Move Points6 Convert to Curve10 Close Bézier 3 Insert Points7 Corner Point11 Eliminate Points 4 Delete Points8 Smooth Transition Figure 15: Edit Points toolbar]]</center>

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.


[[Image:|thumb|[[Image:|thumb|Figure 16: Symmetric tangent]]]] Choose the Symmetric Transition button [[Image:]] to work with a symmetrical tangent (Figure 16). Any movement of one or the other of the handles is carried over symmetrically to the other handle.
[[Image:|thumb|Figure 17: Asymmetric tangent]]
Choose the Smooth Transition button [[Image:]] to separately adjust the lengths of the two parts of a tangent and so make the curve flatter or steeper. In Figure 17, you can clearly see that the curve is flatter on the longest side of the tangent. The tangent remains as a single straight line. This kind of tangent is known as a smooth junction.
[[Image:|thumb|Figure 18: Inflexion point]] It is also possible to completely detach both sides of the tangent. In this case, the central point is known as the inflexion point. Using this technique, you can draw spikes and troughs in objects. Choose the Corner Point button [[Image:]] to create an inflexion point around the selected point.

Examples

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.


[[Image:|thumb|
Figure 19: Moving a junction point]]
The Move Points button [[Image:]] is the default mode when editing points. If it has not been activated, click on its button. When this mode is active, the mouse pointer has the following shape when it is hovered over an edit point:
[[Image:]]

Movement of a point is one of the easiest manipulations to do. Figure 19 illustrates how you can draw an egg very easily by starting from a circle and dragging the the top point upwards.

[[Image:|thumb|
Figure 20: Rotating a tangent]]
To change the direction or location of the tangents, move the circular handles at each end. The mouse pointer then looks like this:
[[Image:]]
[[Image:|thumb|Figure 21: Adding an edit point to a curve]] Use the Add Points button [[Image:]] to add an extra edit point to an existing curve. Click on the curve at the spot where you want to insert a point and then move the mouse slightly in any direction while holding down the button. Watch out! If you just click, the new point will not be added.

The tangent attributes associated with the new point depend on the buttons that are selected on the toolbar.

[[Image:]]
[[Image:|thumb|➊ Figure 22: Deleting points from a curve]]
The Delete Points button [[Image:]] has the opposite effect: it subtracts one or more points from the curve. The resulting curve stretches itself automatically around the remaining points after subtraction.

Select one or more points to delete. You can select several points by holding down the Shift key (➊).

When you have selected the points you want to delete, click the Delete Points [[Image:]] button. The selected points disappear from the curve, which then reforms around the remaining points (➋).

You can also delete the selected points by pressing the Del key on the keyboard.

➊[[Image:]]

➋[[Image:]]

[[Image:|thumb|
Figure 23: Cutting a curve]]
Use the Split Curve button [[Image:]] to split or cut a curve at the location of the selected handle. If the object is filled, it will be emptied because the curve that represented the edge is no longer closed.

Check that you have selected the correct handle (➊), click the Split Curve button [[Image:]] (➋) and notice that the object is no longer filled. You can then check, by moving the point, that the curve has indeed been separated (➌).

If you have an open curve, the start point of the curve is larger than the others.

[[Image:|thumb|Figure 24: Moving a segment]] You can also separate a curve at several points simultaneously. Keep the Shift key pressed down and select all of the points at which the cut should occur.

Drag and drop segments with the mouse to move them from the original curve.

[[Image:|thumb|Figure 25: Closing an open curve]] To close an existing curve, select an open curve and click on the Close Bézier button [[Image:]].


The opening point is identified by a slightly larger handle (Figure 25).

➊[[Image:|thumb|➋Figure 26: Using the “select points” switch]] The Select button [[Image:]] on the Drawing toolbar functions as a switch. It works as follows.

If you have two points linked together by a straight line (you do not need to have a curve between the points) and you insert a new point between them that is set at an angle to the initial straight line (and hence the two endpoints), then:

  • If the Select button is active, you will have a drawing similar to that illustrated in ➊.
  • If the Select button is not active, and you move the point you have just inserted to bring it back close to its initial position in the straight line, you will have a drawing similar to that illustrated in ➋.


[[Image:|thumb|1. Select object and set Edit points mode]]
[[Image:|thumb|2. Draw virtual lines]]

[[Image:|thumb|3. Release mouse button]]


[[Image:|thumb|Figure 27: Reducing a line by one point]]

The Eliminate Points button [[Image:]] button only functions with lines with multiple points.

If the button is active, click on a point, hold the mouse button down and move the mouse to draw virtual straight lines between the neighboring left and right points.

When the two lines are more or less straight and you release the mouse button, the point is deleted and a line between the above mentioned two neighboring points replaces the previous two lines, thus eliminating one point.

Note that this only works when the angle between the two lines shown dashed in the figure at left is less than a certain amount.

In the Tools > Options > OpenOffice.org Draw > Grid window there are options for snap settings relating to editing points when rotating and in point reduction mode.

➊
[[Image:|thumb|Figure 28: Moving a point on a curve]][[Image:]]
The Rotate function from the Effects drop-down button [[Image:]] on the Drawing toolbar and the Rotation Mode after Clicking Object button [[Image:]] on the Options toolbar can be used in Edit Point mode. In this case, it can be used to move single points around the contour of an object.

Switch into rotation mode by clicking on either of the rotation buttons. Notice that in rotation mode, all of the tangent points become red dots.

Select the point to be moved and then drag it around the contour while keeping the left mouse button pressed down (➊). When you release the mouse button, the point will be moved to the new position (➋).

If you move one of the handles located at the end of the tangents during rotation, you will make the object rotate in exactly the same way as with the usual rotation operations.

Important: To exit the effects mode, do not just click on the Effects button; click the Select button [[Image:]] on the Drawing toolbar.



  1. 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).
Personal tools