Live Path Effects (LPE)

New in v0.46.

Live Path Effects, or LPE for short, is a system for applying some kind of effect to a path. Inkscape stores the path so that it can be modified at a later time with the effect automatically updating. The original path and attached data are stored in the SVG file in the Inkscape name space so it doesn't display in other SVG renderers. The result will display.

Inkscape v0.46 only includes a few LPEs. With a solid framework in place, it is planned to migrate most of the path effects found under the Effects menu to LPEs. This has two advantages: The effects will be faster to render and the original path is stored for future editing.

To use an LPE, select a path (the “skeleton” path), call up the Path Effects dialog (Trayecto Path Effects... (Mayús.+Ctrl+7)), select the desired effect from the drop-down menu in the dialog, and then click the Apply button.

Path Effects dialog.
Path Effects dialog with a path selected.

When an object is selected that was generated by an LPE and the Node Tool is enabled, the original skeleton path is shown in red. This path can be edited like any other path.

Several of the effects require an additional path. In this case, a path is automatically generated (a straight green line). To see this path, either click on the node editing icon ( ) in the dialog or press 7 while the object is selected and the Node Tool is active. The path is fully editable like any other path. The path can be replaced by another through pasting from the clipboard using the paste icon ( ) in the dialog. It can also be copied to the clipboard by using the copy icon ( ) in the dialog.

An LPE can be converted to regular paths by using the Trayecto Object to Path (Mayús.+Ctrl+C) command.

Bend Path

This effect takes an existing path and allows one to “bend” it in a well defined way via a second control path. The control path is automatically created. The style of the original path is used for the style of the bent path.

To apply the effect, with the source path selected, select the Bend Path option from the drop-down menu in the Path Effects dialog. Click on the Apply button. The path will turn red. A red path always corresponds to the original source or skeleton path. Next, click on the node icon ( ) in the Path Effects dialog. A green, horizontal path will appear in place of the red path. This path controls the bending. It can be manipulated in all the ways that a regular path can be including adding new nodes and dragging the path.

[Aviso]Aviso

It is easy to apply this Path Effect multiple times... leading to bizarre behavior. Check the SVG tree with the XML Editor dialog if strange things are happening.

The effect assumes that the path to distort is orientated in the horizontal direction. If it is in the vertical orientation, one can check the Original path is vertical box. This distorts the aspect ratio. Restore the aspect ratio by checking the Width in units of length box. The size of the bent path can be changed by changing the size of the control path.

Bend path effect.
Demonstration of the Bend Path effect. Top: Source path. Middle: After applying the effect and enabling editing of the control path. Bottom: After adding a node and adjusting the control path.

The width of the bent path can be altered with the Width entry box.

Pattern Along Path

This effect puts one or more copies of one path (“pattern”) along a second, control or skeleton path. The resulting object takes the attributes (Fill, etc.) of the skeleton path.

This LPE duplicates much of the functionality of the Pattern along Path effect. The advantage of using the LPE version is that both the pattern and the skeleton path can be edited at a later time. The disadvantages are that only paths can be used for the pattern and that there are fewer options. One subtle difference is that the LPE version will bend straight lines drawn with two nodes while the other version leaves them straight.

[Nota]Nota

Only a path can be used as a pattern. Many objects such as Rectangles, Ellipses and text must first be converted to a path (Trayecto Object to Path (Mayús.+Ctrl+C)).

To put a pattern on a path:

  1. Copy the pattern:  Select the pattern and copy it to the clipboard (Edición Copiar (Ctrl+C)). The pattern must be a single path.

  2. Select the skeleton path:  Only one can be selected.

  3. Apply the effect to skeleton path:  In the Path Effects dialog, select Pattern Along Path and click on the Apply button.

  4. Paste pattern:  Click on the Paste ( ) icon in dialog.

The bounding box of the pattern is used for placing the pattern along the path, with the bounding box of one pattern copy touching the bounding box of the next copy (if no additional spacing is specified).

Bend Along Path effect.
Demonstration of the Pattern Along Path effect. Top: Pattern path. Middle: Skeleton or control path. Bottom: After pasting pattern to skeleton path and enabling editing of the skeleton path. Note that the created object takes the attributes of the skeleton path.

To edit the pattern, click on the node editing icon ( ) in the dialog. A temporary green copy of the pattern will appear at the pattern's original location. Any edit to this copy will be reflected in the final object.

To edit the skeleton path, select the object with the Node Tool. A temporary red copy of the skeleton path will appear. This can be edited as any other path.

A different pattern can be applied to the skeleton path by copying the pattern to the clipboard ((Edición Cortar (Ctrl+X) or Edición Copiar (Ctrl+C)) and then clicking on the Paste ( ) button in the dialog.

A copy of the original pattern can be placed on the clipboard by clicking on the Copy ( ) button in the dialog. The copy will have all attributes unset.

The Pattern copies drop-down menu has options to stretch the pattern to the path length and/or to put multiple copies along the skeleton path.

Bend Along Path effect: Repeat.
A small lizard is put on a path with Pattern copies set to, from top to bottom: Single; Single, stretched; Repeated; Repeated, stretched.

The LPE assumes that the pattern is drawn horizontally. This can be changed to vertical by checking the Pattern is vertical box.

Bend Along Path effect: Vertical pattern.
A small lizard is put on a path with the Pattern is vertical box checked.

Gears

This effect draws a series of intermeshed gears. It is more of a toy effect, designed to demonstrate the possibilities of LPEs. The Gear Effect can also be used to draw gears with a bit more control.

The effect uses the nodes of a path to determine how the gears are drawn. At least three nodes are needed to specify the first gear. Additional gears require one additional node each. Some nodes may be skipped if they would result in impractical gears.

Gear effect.
An example of using the Gear LPE. The original path is shown in red. Point 1 defines the orientation of the first gear. Point 2 defines the center of the first gear. Point 3 defines the radius of the first gear. Points 4, 5, and 6 determine the centers of additional gears. The radius of the second gear is determined by subtracting the radius of the first gear from the distance between the centers of the first and second gears.

Two parameters are available: Teeth determines the number of teeth on the first gear. Phi determines the Pressure Angle of the gears. For real gears the Pressure Angle is typically 14.5, 20, or 25 degrees. Note: The default angle is 5 degrees, not a very realistic value.

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 Trayecto Combine (Ctrl+K). The two sub-paths should be drawn in the same direction. If not, use the Trayecto Reverse (Mayús.+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 Effects dialog, select Stitch Sub-Paths from the Apply new effect menu and click on the Apply button.

  3. Adjust Stroke path Click on the node editing 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 (Trayecto 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 Effect could be used to created some of the shadings, it can not create the horizontal shadings on the cylinder below (likewise, the Stitch Sub-Paths effect can not 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 Effect.

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 Capítulo 10, 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 ( ) 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 below.

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 (Trayecto Stitch path effect: Decagons. Object to Path (Mayús.+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 LPE Stitch Sub-Paths 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).