LivePathEffects Discussion

From Inkscape Wiki
Revision as of 19:08, 16 May 2007 by ScislaC (talk | contribs) (added Mesh Distort to wishlist)
Jump to navigation Jump to search

Discussion page for Johan's Live Path Effects project for GSoC2007.

What's it look like in SVG?

Simple idea

       inkscape:original-d = "..." (the original path that now has an applied effect)
       d="..."  (the output of the live-effect)
       inkscape:path-effect="..." (string with the name of the applied effect)
       inkscape:path-effect-param1= ...   (can be anything)
       inkscape:path-effect-param2 , etc

This is what is implemented at this moment.

  • No chaining possible
  • Difficult to determine path-effect-param type from SVG.
  • not extendable (8 params max at the moment by copy-paste coding)

Like style atribute

   inkscape:original-d = "..."
   inkscape:path-effect="sample1(param1:0.0;param2:loopy;) sample2(paramA:45;)"
  • Parser needed
  • LPE class that stores its own params


<svg:path d="M 1 2 L 3 4">
  <inkscape:patheffect effect="org.inkscape.patheffect.a">
    <inkscape:param name="foo" type=".." value="bob" />
    <inkscape:param name="bar" type=".." value="jack" />
  <inkscape:patheffect effect="org.inkscape.patheffect.b">
    <inkscape:param name="zort" type="bool" value="true" />
  <inkscape:patheffect effect="org.inkscape.patheffect.a">
    <inkscape:param name="foo" type=".." value="alvin" />
    <inkscape:param name="bar" type=".." value="jack" />

defs section

<inkscape:path-effect xlink:href=""  id="path-effect2">
  <inkscape:param name="blah" type=".." value="foo" />
<svg:path ... inkscape:path-effects="#path-effect2 ..." />

Looks alot like gradients.

  • upside: you can apply the same effect (with equal params) to different objects very easily.
  • downside: same as with gradients, might become a problem with parameters changing for only one object of all the objects referring to a certain effect, which then needs forking etc etc...

Effect Wishlist

  • Skeletal Strokes
  • Fillet & Chamfer
  • Fractalize
  • Interpolate
  • Effect Lines (sorry about the japanese, but it should make visual sense - )
  • Mesh Distort (with variable mesh resolution) - Like gradient meshes but for distorting the object itself, not color