Jump to content

Documentation/Set in circle perspective

From The Document Foundation Wiki


General

The tool Set in Circle (perspective) is only briefly explained in the LibreOffice Help and in the guides. In particular, there are no examples where the tool is used for several shapes at the same time. This article provides more details.

The Set in Circle (perspective) tool is located in the Transformations toolbar. That one is included as subtoolbar in the Standard toolbar by default. However, it can also be opened as a separate toolbar via View ▸ Toolbars ▸ Transformations. The Set in Circle (perspective) tool can also be accessed via Shape ▸ Transformations. No keyboard shortcut is preset for the tool.

The Set in Circle (perspective) tool is internally assigned the .uno:crookRotate command. The term crook is also used in the file names of icons, e.g. lc_crookrotate.svg icon crookrotate from icon-theme colibre_svg.

The way the tool works is controlled by the option Do not distort objects in curve. It can be found in Tools ▸ Options ▸ LibreOffice Draw ▸ General. In Impress, this option is always off.

The mode of operation is also controlled by the type of shapes to be transformed. A distinction is made between polygons, Bézier curves and other objects.

The tool will only work as described in this article, if the Constrain Objects option When creating or moving objects is off. That option is in Tools ▸ Options ▸ LibreOffice Draw ▸ Grid.

The tool is available in LibreOffice Draw and Impress.

Operations on a single shape

Distorting a Bézier curve

Make sure that the option Do not distort objects in curve is switched off.

Draw a single shape, for example a Rectangle from the Basic Shapes category. Use a width of 6cm and a height of 2cm, for example. Convert the shape into a Bézier curve. For that use e.g. Shape ▸ Convert ▸ To Curve.

Select this shape. Activate the distortion tool in the Transformations toolbar. Click on its icon. Now move the mouse pointer to the bottom-right handle. The mouse pointer changes to the Crook pointer crook mouse pointer. This cursor is defined in https://opengrok.libreoffice.org/xref/core/vcl/win/src/crook.cur. Its image can be found in an icon theme as crook.png or crook.svg in the folder vcl/res.

Grab the bottom-right handle, and move the mouse down and left while holding down the mouse button. The rectangle deforms so that the long sides become arcs. The angle currently being used is displayed in the status bar. The status bar also shows Curve Bézier curve in circle.

While dragging, you will see a grid overlay for the deformation.

distort to ring, with overlay
distort to ring, with overlay

Try dragging so that the inner circle has a diameter of about 4cm (radius 2cm) and the angle is 90°. Then release the mouse button. You will have created a quarter circle block arc.

You have created a quarter circle block arc.
You have created a quarter circle block arc.

There is no inverse operation for this deformation. If you are not satisfied with the result, you must use the Undo feature immediately. It is therefore advisable to make a backup copy of the file before using the tool.

Repeat the deformation with a new rectangle. Do not forget to convert it into a Bézier curve. Now grab the handle in the middle of the bottom edge. The deformation is performed differently this time.

distort to sector, with overlay
distort to sector, with overlay

Now you have got a 90° circle sector.

Now you have got a 90° circle sector.
Now you have got a 90° circle sector.

Start with a new portrait format rectangular Bézier curve with a width of 2cm and a height of 6cm. Try out different handles. The deformation of this rectangle also depends on the handle.

One edge of the shape serves as anchor in the distortion and thus is fixed. The left edge is an anchor to the top-right, middle-right and bottom-right handles. The right edge is an anchor to the top-left, middle-left and bottom-left handles. The top edge is anchor to the middle-bottom handle and the bottom edge is anchor to the top-middle handle. To put it bluntly, the anchored edge is opposite to the handle you drag.

Start with a new rectangular Bézier curve. Now try to create an arc with a larger angle. You will notice that as the angle increases, the deformation no longer follows the overlay grid. I don't know whether such distortion is needed for some special perspective use cases.

A deformation with a 360° angle is not possible at all.

Distorting a polygon

Make sure that the option Do not distort objects in curve is switched off.

Draw a single polygon that looks like a rectangle. Or use the Rectangle from the Basic Shapes category with 6cm width and 2cm height and convert it into a polygon. For that use e.g. Shape ▸ Convert ▸ To Polygon.

Use the Set in Circle (perspective) tool now the same way as described above for curves. The overlay is the same, but now no arcs are generated. Instead you get straight lines.

Distorting other shape types

Make sure that the option Do not distort objects in curve is switched off.

Draw a single shape - for example a Rectangle from the Basic Shapes category with a width of 6cm and a height of 2cm. Do not convert the shape.

Select the shape and click on the Set in Circle (perspective) tool. You get a conformation dialog. It ask you whether you want to convert the shape into a curve.

confirmation dialog for convert to curve
confirmation dialog for convert to curve

Click No. If you click on Yes, the shape is converted into a Bézier curve and that case has already been examined above.

Again, drag the bottom right handle. In the status bar, you will now see the text Arrange Shape in circle instead of the text Curve … in Circle. The shape is rotated but not distorted.

distort a shape, that is neither curve nor polygon
distort a shape, that is neither curve nor polygon

The overlay does not match the manipulated shape at all and neither does the angle in the status bar. Bug?

Disabled distortion

Make sure that the Do not distort objects in curve option is switched on. This automatically means that you can only work in Draw, not in Impress.

Test the behavior with a Bézier curve, a polygon, and another shape type. You will see that the behavior is always as described above in the Distorting other shape types section. Conversely, this means that shape types other than Bézier curves and polygons always behave as if distortion is disabled.

The behavior is strange on a single object. However, we will see later that disabled distortion is useful when the Set in Circle (perspective) tool is applied to multiple shapes at the same time.

Remarks

The mouse movement responds to the snap options. Snapping refers to the handle you are dragging. You can use snapping to achieve better accuracy when transforming shapes. Both, snapping to the grid and snapping to snap points or snap lines are suitable for this purpose. To make snapping easier to see, increase the snap range to 25 pixels. You can find this setting in Tools ▸ Options ▸ LibreOffice Draw ▸ Grid.

If you convert a shape with text into a Bézier curve, letters are also converted into lines and then also transformed when the shape is distorted. However, the result is of poorer quality than if you use the Text along path tool or work with Fontwork shapes. In addition, the text is no longer editable.

Transformations always refer to the geometry. Fills with hatching, color gradients or images are not transformed but are reapplied to the transformed shape after the transformation.

Operations on multiple shapes at the same time

The following examples use several similar shapes that are directly adjacent to each other. The tool works as well, if the shapes are not similar or have a distance to each other.

With multiple shapes too, the transformation is different depending on which handle is used. From a row of shapes a single block arc can be created that is divided into different sectors, or a sector is created that is divided into rings, or you get two opposite sectors with rings, for example. Play around with the tool to explore its possibilities.

You can easily create several similar shapes using the Duplicate tool. Its use is described in the LibreOffice Help under Duplication Objects and in the Duplication section in the Draw Guide book.

Do not group the shapes in case you use the Set in Circle (perspective) tool in non-distorting mode, i.e. you have Arrange … in Circle in the status bar. A group will be treated as single object. Instead mark all shapes together and then apply the tool to this selection.

In case the Set in Circle (perspective) tool works in distortion mode (Curve … to Circle in status bar), then you can group the shapes. In that case, the result is the same as for a selection of individual shapes.

The handling of the tool is essentially the same as when applying it to a single object. Therefore, only examples are shown here.

Block arc

Create a row of square, equal-sized Bézier curves and mark them together. The example has a snap line at its right edge to later produce a 180° arc. Start the Set in Circle (perspecitve) tool and drag the bottom left handle to the right until it snaps at this line. Move the mouse up and down to vary the radius. The example uses a horizontal snap line to determine the inner diameter. To get specific angle and radius for the arc, you can use a snap point as well.

while dragging
while dragging

You get a block arc with sectors.

finished block arc
finished block arc

Sector

Create a row of square, equal sized Bézier curves and mark them together. The example has a snap point to mark the position that is needed to get a 60° sector with its center in the top right corner of the row. Its coordinates were calculated as
x = right − width/2 ∙ cos(60°)
y = top + width/2 ∙ sin(60°)

Start the Set in Circle (perspective) tool and drag the bottom center handle to this snap point.

while dragging
while dragging

You get a sector with concentric rings. The rings are not really circular, but the difference is small in a 60° sector.

finished sector with rings
finished sector with rings

Artistic shape

Create a row of square, equal sized Bézier curves and mark them. Start the Set in Circle (perspective) tool and drag the top center point back and forth. You can get a lot of interesting shapes by such moving.

preview with overlay while dragging
preview with overlay while dragging

The result in the example explains, why this tool has perspective in its name. The distance between the yellow rings decreases from the bottom left to the top right, as if the top right were further away.

finished result with perspective
finished result with perspective

Polygon

Create a column of square, equal sized polygons. Start the Set in Circle (perspective) tool and drag a top handle. You can get a lot of interesting shapes. The example uses the top center handle to generate a 180° distortion curve.

preview with overlay while dragging
preview with overlay while dragging

You cannot use a 360° distortion curve. We work around this problem by first performing a 180° distortion. Then we copy and paste the result, mirror the copy vertically, and finally attach it to the original result. We have got an octagon-ring. Tip: Use the snap tools for a perfect fit.

To obtain a 360° distortion, you can also create a second 180° distortion, this time moving the opposite handle. Then join the two halves together.

Arrange in circle

For this example you must switch the Do not distort objects in curve option on or you need to respond to the confirmation dialog with No each time.

Create a column of Star shapes. Select all shapes together. Do not group them. The selection has eight handles, however they have a different color than the handles of a selected group. Start the Set in Circle (perspecitive) tool and drag the top center handle to the right and down. The selection of the stars will bend down to an arc. Only the overlay is not distorted but only moved and rotated.

The example has a snap line at the bottom of the selection to help in creating a 180° movement. Drag the handle until it snaps to this line. Move the handle to the right and to the left. This changes the radius of the arc.

Release the mouse when you have got the desired transformation. The example in the following screenshots uses a 5cm diameter.

Dragging a sequence of stars to an 180° arc
Dragging a sequence of stars to an 180° arc

Now you can group the result to better handle it, e.g. to copy it to a presentation. Then you get the usual handles for resizing an object.

Group created from selection
Group created from selection

Of cause you can add further formatting to the shapes. In the example a blur shadow is applied to the stars in the group, for example.

Apply a blur shadow to the elements in the group
Apply a blur shadow to the elements in the group

Tip: do not forget to switch the Do not distort objects in curve option back to the default off. You will likely forget that you had changed it to on and you would then wonder about the behavior, next time you use the distortion tool.

Adding text to the transformed shapes

When you use the Set in Circle (perspective) tool in distortion mode, then the generated distorted shapes were not rotated. They only look as if they are rotated. If you add text to the resulting shapes, the text will be upright.

When you use the Set in Circle (perspective) tool in non-distorting mode, the transformed shapes were really rotated. When you add text to the transformed shapes, it will follow the rotation.