
Creating a simple flashlight using Guides
Guides are helper lines that aren't part of the drawing but help with creating and aligning objects. In this recipe we'll create a simple flashlight drawing to illustrate common options when using guides.
How to do it...
The following steps will show you how to create a flashlight using guides:
- Click on the left ruler and drag to the canvas to create a vertical guide, double-click on the guide to get the options pop-up, and set X: to 280.
- Click on the left ruler and drag to the canvas to create another vertical guide, double-click on the guide to get the options pop-up, and set X: to 480.
- Click on the top ruler and drag it to the canvas to create a horizontal guide, double-click on the guide to get the options pop-up, and set Y: to 130.
- Click on the top ruler and drag it to the canvas to create another horizontal guide, double-click on the guide to get the options pop-up, and set Y: to 470.
- Create a rectangle by snapping to the guides intersections (the Snap to guides
toolbar button must be selected). Set its fill to a gray linear gradient for a slight 3D effect, set the stroke to 70% Gray.
- Click near the top of the left rule and drag to the canvas to create an angled guide, snap it to the top-right corner of the rectangle. Double-click on the guide to get the options pop-up, set Angle (degrees): to 70.
- Click near the top of the left rule and drag to the canvas to create another angled guide, snap it to the top-left corner of the rectangle, set Angle (degrees): to 110.
- With the Pen tool (Shift + F6 or B), draw a four-point object by snapping to the top rectangle corners and angled guides near the top of the page.
- Set its fill to Yellow (#FFFF00) and remove stroke.
- Use the Gradient tool (Ctrl + F1 or G) to create a yellow radial gradient inside the four-point object.
- Use the |key to turn off the guides and see your drawing:

How it works...
If we click on a ruler and drag the pointer to the Canvas, we can conveniently create and deploy horizontal and vertical guides. If we need an angle of 45°, we can click and drag from the ruler corners. Dragging a guide back to the ruler deletes it. All guides can be angled at arbitrary angles and moved to different positions either using the options pop-up window or simply by selecting and dragging them with the Selector tool.
Using guides is most effective when Snap to guides is active. Every guide has a special point called the origin represented with a small circle on the guide. The origin can be used to snap to other guides or objects while dragging and the guide can be rotated around it. Guide information as well as available keyboard shortcuts are displayed in the Status bar when hovering over a guide.
There's more...
If the guides aren't easily visiblein their background context, we can change their color in the in the Document Properties (Shift + Ctrl + D), Guides tab.
The Relative change in the options pop-up can be useful when we need to make a new guide with an offset from an existing guide. The offset can be a shift in any specified direction or rotation.
Creating guides from objects
Guides can also be created from objects, by using using the Menu | Objects | Object to Guides command (Shift + G). The object is deleted in the process unless set otherwise in Inkscape Preferences | Tools. To get predictable results it's best to use objects with straight lines and convert shapes and text to paths. Here are a couple of examples (the object was duplicated before converting to guides so you can see the original):

See also
For more information, refer to the recipe on Geometric illusions using Grids, seen earlier in this chapter. Also, in the last chapter of this book, we will create an extension that will split any object in sections using Python generated guides.