Here are two extensions for Inkscape:
- The first one bends a path according to another (notice that this feature is now availbale right in inkscape via "live path effects"!!!; however, groups are not handled yet, so this script might still be usefull for complex or color full patterns...)
- The second is similar, but the path is not deformed: it is just stamped along the second path.
Pattern along path is now part of Inkscape (0.46).
Scatter arrived too late for 0.46... You'll have to add it by hand.
Copy the following files to the "Extensions" folder of inkscape (0.46 needed):
Below is my somewhat outdated presentation page of pattern along path effect: I guess all this information can be found in the inkscape manual now...
Pattern along path presentation:
For instance, you can draw a straight snake, or piece of rope, and then use this extension to give it its final wavy shape. It is pretty much like you had defined a new "stroke pattern".
- Select the (group of) path(s) you want to deform (call it the pattern). [bring it to front]
- Select some more (group of) path(s) (Maj-Click): they will control the deformation (call them "skeletons")
- Choose the menu Effect>Modify Path>Path Deform and fill in the different options!
Notice: Due to a minor bug in the interaction of scripts with inkscape, the object interpreted as the pattern is the top most object in the z-order. This is not very handy, and will be modified when possible.
To obtain better results, here is an insight about what is going on:
consider the horizontal going through the middle of the bounding box of the pattern,
and its "normal bundle": the collection of all the
vertical lines meeting it.
Think of this as the initial state of the plane. In particular, think of the pattern as painted on these vertical lines.
Now move and bend the horizontal line to make it fit a "skeleton", and see what happens to the normals: they move and rotate, and might even cross... If your pattern was painted on them, it would end in a new, eventually very distorted position: this is what this extension is supposed to do.
Notice that you might have to subdivide the pattern paths in in the distorted regions to obtain more accurate results.
The extension comes with several more or less self explanatory options...
Here is an SVG file containing the examples shown on this page.
You can contact me at: firstname.lastname@example.org where myname should be replaced by jf.barraud.
Of course, this extension can be emproved in many ways:
- It should work on any kind of shape (not only paths) (DONE!)
- It would be nice to have it compatible with the greeeeat new features of 0.45 like mesh gradient fill and so.
- It could also automatically subdivide the paths where needed, to deform them more accurately.
- But the best thing would be to have it coded right in inkscape and see every thing update dynamically!...
Splitted the code into two pieces and changed the name:
- 'pathmodifier.py': a general class for path deforming effects. It provides methods to easily handle groups, clones, object to path conversion...
- 'pathalongpath.py': a subclass actually responsible for the deformation
Added support of Rect, Ellipses, Stars... are now supported.
- Changed the UI a bit: "pattern" is the first selected object while all the other are skeletons now.
Accept groups for both "pattern" and "control path".
Duplicate the pattern before deformation.
Shapes are moved onto the deformer by default. Added tangential and normal offsets.
These parameters were determined by relative position of objects before, but it turned out not to be very intuitive... With this new behaviour, it works a bit like applying a generalized stroke style.
- Hello world!