Stitch Sub-Paths

This effect draws a series of Stroke paths between points on sub-paths. Some of the things it is useful for are drawing hatched shading and for drawing hair.

To stitch a sub-path:

  1. Draw the sub-paths:  Draw two simple paths. Combine into a compound path consisting of two sub-paths using Path icon Combine (Ctrl+K). The two sub-paths should be drawn in the same direction. If not, use the Path icon Reverse (Shift+R) command on one of the sub-paths (prior to combining) to reverse its direction.

  2. Apply the effect to compound path:  In the Path Effect Editor dialog, select Stitch Sub-Paths from the Apply new effect menu and click on the Add button.

  3. Adjust Stroke path Click on the node editing icon ( icon ) to edit the Stroke path.

Stitch path effect: basics.
A basic example of using the Stitch Sub-Paths LPE. Left: A simple path was drawn and duplicated. The two paths were then combined into a compound path (Path Stitch path effect: basics. Combine (Ctrl+K)). The effect was then applied. The red lines are shown when the LPE object is selected with the Node Tool enabled. Right: The Stroke path (green) has been enabled via clicking on the node-editing icon ( Stitch path effect: basics. ) and the path adjusted. The original sub-paths (not normally visible) are shown by blue-dashed lines. Note how the ends of the Stroke path are no longer on the original sub-paths. This is because Inkscape uses the center on the left and right of the bounding box to place the Stroke path.

The Stitch Sub-Paths effect can be used to create the hatchings typically used in engravings as shown in the following example. While the Interpolate Extensions could be used to created some of the shadings, it cannot create the horizontal shadings on the cylinder below (likewise, the Stitch Sub-Paths effect cannot easily create the precise circular hatching inside the cylinder).

Stitch path effect: hatchings.
A simple example of using the effect for hatchings. Left: The Box Tool was used to draw a box. Then the Bezier Tool was used with snapping to draw paths on both sides of a box face. The paths were combined and the effect applied. For the right side of the box, the effect was used twice, once for the horizontal lines and once for the vertical lines. Right: Two ovals were drawn to fit in two opposite side of a box. The ovals were converted to paths and split into two sections. The left sections were used for the inside hatching and the right sections for the outside. The circular hatching inside the cylinder was done by using the Interpolate extension.

By varying both the sub-paths and the Stroke path quite complicated hatchings can be created. The hatchings can be clipped to limit their range. The Tweak Tool could also be used to refine the hatchings if the hatchings are converted to stroked paths (see Chapter 11, Tweak Tool).

Stitch path effect: hatchings 3.
Hatching created by: 1. Copying the bottom half of the object's path. 2. Duplicating the copy with an offset to the upper left. 3. Applying the Stitch Sub-Paths LPE with 50 paths. 4. Adjusting the sub-paths and Stroke path. 5. Repeating with the duplicate offset to the upper right. 6. Grouping the hatchings and clipping with a copy of the original path.

The Stroke Sub-Paths LPE has options that add random shifts to the start and end of each stitching path. The variance options can be used to draw hair as shown below. Each variance has a dice icon ( icon ) next to it which, if clicked, sets a new starting random number seed. This will change the random shifts but keep the average shift the same.

Stitch path effect: hair.
Drawing hair: The sub-paths are shown in red. The number of paths was set to 200 and the following variances were used: Start edge: 0.02, Start spacing: 0.10, End edge: 0.10, End spacing: 0.10.

Interesting geometric patterns can be created with this effect as shown next.

Stitch path effect: Circles.
For these designs, a circle was converted to a path and then duplicated. The path copy was rotated and then the two paths combined into a compound path. Left: The duplicate path was rotated 45° and the Number of paths was set to 37 (the first and last path are on top of each other). Right: The duplicate path was rotated 150° and the Number of paths set to 25. The Stroke path was bent until the path ends joined new paths.

What if multiple sub-paths are used? Each sub-path will be connected to every other sub-path by the specified Number of paths. This can be used to created some interesting patterns.

Stitch path effect: Decagons.
An example of using the multiple sub-paths. A decagon was drawn with the Star Tool tool. The decagon was converted to a path (Path Stitch path effect: Decagons. Object to Path (Shift+Ctrl+C)). The path was broken into 10 sub-paths by using the Node Tool (select node, click on Stitch path effect: Decagons. in Tool Controls). Finally, the Stitch Sub-Paths LPE was applied. Left: Number of paths set to two. Right: Number of paths was set to three. Higher numbers yield rendering errors in Inkscape (but display correctly in Firefox 3 and Opera 9.26).