
Creating a stylized flower using Snapping
This recipe is a little exercise in snapping. We'll try out different snapping options while arranging objects into a composite image of a stylized flower.
How to do it...
The following steps show you how to use the snapping option to create a flower:
- Create a 300 x 300 pixel square, having rounded corners with a radius of 100 px. Set its fill to Purple (#800080) and its opacity to 50.
- Convert it to a path (Shift + Ctrl + C).
- Create three more copies by stamping with Space three times while holding it with your mouse.
- Make sure that Enable Snapping is on. You can toggle it using the % key. Snap nodes or handles, Snap to cusp nodes, and Snap to smooth nodes on the Snapping toolbar.
- Move the squares one by one so they overlap a bit and make their nodes snap so they form a flowery shape:
- Select the Star tool (Shift + F9 or *) and set the options on the toolbar to: Star, Corners: 4 , Spoke ratio: 0.95, Rounded: 0.1, and Randomized: to 0.
- Click near the center of the "flower", hold Ctrl, and drag away to create the star object, release when the star is larger than the "flower".
- Lower the star to the bottom using Page Down four times or End, set its fill to #FFB380, and make sure the opacity is 50.
- Select the Ellipse tool (F5 or E) and draw a circle by clicking at the "flower" center to snap to it and holding Ctrl and Shift while dragging outwards to create a circle around the "flower" center. Set the circle fill to #D40000 and make sure the opacity is set to 50.
- Select the Star tool (Shift + F9 or *) and set the options on the toolbar to: Star, Corners: 7, Spoke ratio: 0.4, Rounded: 0, and Randomized: to 0.
- Create a small star somewhere on canvas, set its fill to Yellow (#FFFF00), stroke to Fuchsia (#FF00FF), stroke width to 1, and opacity to 100.
- Stamp the star seven times using the Selector tool (Space or F1 or S) to get eight stars in total.
- On the Snapping toolbar enable Snap bounding box corners
and Snap to bounding box corners
- Move each star towards a corner of the rectangles until their bounding box corners snap together:

How it works...
With snapping enabled moving an object across Canvas or moving the mouse pointer triggers snapping indicators to appear and enables us to snap to the registered point.
The trick is to activate appropriate snapping settings for each situation and disable the rest so they don't interfere. Sometimes it's necessary to zoom in for snapping to be precise.
There's more...
Snapping occurs with a slight delay that can be adjusted in the Inkscape Preferences (Shift + Ctrl + P) under Snapping. If you prefer to make the snap immediate set the Delay (in ms): to 0.
Enabling the Only snap the node closest to the pointer option can help us to be more precise when snapping by grabbing the object close to the point we want to snap.
Under Document Properties (Shift + Ctrl + D) there is the Snap tab where we can change the option as to whether snapping should always occur or only when within a certain distance.
Snapping can sometimes get in the way; for example, we might want to disable it temporarily so we can move a particular object with precision, and this can be done by holding Shift while moving the object. The % key toggles snapping on or off so we can use this too as a quick snapping switch.
See also
For more information, refer to Geometric illusions using Grids and Creating a stylized fower using Snapping, in this chapter.