Difference between revisions of "LivePathEffects Discussion"

From Inkscape Wiki
Jump to navigation Jump to search
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Discussion page for Johan's Live Path Effects project for GSoC2007.
Discussion page for Johan's Live Path Effects project for GSoC2007.


= What is a Live Path Effect? =


* Spiral/star tool?
* Skeletal strokes


= What's it look like in SVG? =
= What's it look like in SVG? =
(all ideas have an inkscape:original-d = "..." added to the path)
At the moment "defs2" is implemented.


==Simple idea==
==Simple idea==
<pre>
<pre>
     <path
     <path
       original-d = "..." (the original path that now has an applied effect)
       inkscape:original-d = "..." (the original path that now has an applied effect)
       d="..."  (the output of the live-effect)
       d="..."  (the output of the live-effect)
       inkscape:path-effect="..." (string with the name of the applied effect)
       inkscape:path-effect="..." (string with the name of the applied effect)
Line 19: Line 20:
</pre>
</pre>


== Nested idea ==
* No chaining possible
work in progress...
* Difficult to determine path-effect-param type from SVG.
* not extendable (8 params max at the moment by copy-paste coding)
 
==Like style atribute==
<pre>
<path
  inkscape:original-d = "..."
  d="..."
  inkscape:path-effect="sample1(param1:0.0;param2:loopy;) sample2(paramA:45;)"
/>
</pre>
 
* Parser needed
* LPE class that stores its own params
 
==<inkscape:patheffect>==
<pre>
<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>
  <inkscape:patheffect effect="org.inkscape.patheffect.b">
    <inkscape:param name="zort" type="bool" value="true" />
  </inkscape:patheffect>
  <inkscape:patheffect effect="org.inkscape.patheffect.a">
    <inkscape:param name="foo" type=".." value="alvin" />
    <inkscape:param name="bar" type=".." value="jack" />
  </inkscape:patheffect>
</svg:path>
</pre>
 
==defs section==
<pre>
<pre>
    <path
<svg:svg>
      d="..."  (the output of the live-effect)
...
      <inkscape:path-effect  
<defs>
          effect="..." (string with the name of the applied effect)
...
          <inkscape:path-effect-param
<inkscape:path-effect xlink:href="x-inkscape-plugin:org.inkscape.effect.foo" id="path-effect2">
            nr="1"
  <inkscape:param name="blah" type=".." value="foo" />
            <path
</inkscape:path-effect>
                d = "..." (the original path that now has an applied effect)
...
            />
</defs>
          />
...
          <inkscape:path-effect-param
<svg:path ... inkscape:path-effects="#path-effect2 ..." />
            name="param1"
...
            <path
</svg:svg>
                d = "..." (the output of the effect below!)
</pre>
                <inkscape:path-effect
 
                  effect="..." (string with the name of the applied effect)
Looks alot like gradients.
                  <inkscape:path-effect-param
* upside: you can apply the same effect (with equal params) to different objects very easily.
                      nr="1"
* 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...
                      d=".."
 
                  />
==defs2==
                />
<pre>
            />
<svg:svg>
          />
...
      />
<defs>
    />
...
<inkscape:path-effect  
    id="path-effect2"
    effect="skeletal"  
    blah="foo"  
    blah2="arf"/>
...
</defs>
...
<svg:path ... inkscape:path-effects="url(#path-effect2) ..." />
...
</svg:svg>
</pre>
</pre>
=Effect Wishlist=
Add your wishes here! Note that they should be *path* effects, meaning that they can only take the original path and transform that with the parameters provided. There is not really a limit to the parameter types, so if you need special parameters, list them here aswell. But keep in mind that only a path is outputed; for example, a style cannot be outputed.
== Skeletal Strokes ==
== Fillet & Chamfer ==
== Fractalize ==
== Interpolate ==
== Effect Lines ==
(sorry about the japanese, but it should make visual sense - http://www.wa.commufa.jp/~ksg/p_pfwp5_cgf.htm )
== Mesh Distort ==
(with variable mesh resolution) - Like gradient meshes but for distorting the object itself, not color

Latest revision as of 00:09, 4 June 2007

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


What's it look like in SVG?

(all ideas have an inkscape:original-d = "..." added to the path)

At the moment "defs2" is implemented.

Simple idea

    <path
       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
    />
  • 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

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

<inkscape:patheffect>

<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>
  <inkscape:patheffect effect="org.inkscape.patheffect.b">
    <inkscape:param name="zort" type="bool" value="true" />
  </inkscape:patheffect>
  <inkscape:patheffect effect="org.inkscape.patheffect.a">
    <inkscape:param name="foo" type=".." value="alvin" />
    <inkscape:param name="bar" type=".." value="jack" />
  </inkscape:patheffect>
</svg:path>

defs section

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

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...

defs2

<svg:svg>
...
<defs>
...
<inkscape:path-effect 
     id="path-effect2"
     effect="skeletal" 
     blah="foo" 
     blah2="arf"/>
...
</defs>
...
<svg:path ... inkscape:path-effects="url(#path-effect2) ..." />
...
</svg:svg>

Effect Wishlist

Add your wishes here! Note that they should be *path* effects, meaning that they can only take the original path and transform that with the parameters provided. There is not really a limit to the parameter types, so if you need special parameters, list them here aswell. But keep in mind that only a path is outputed; for example, a style cannot be outputed.

Skeletal Strokes

Fillet & Chamfer

Fractalize

Interpolate

Effect Lines

(sorry about the japanese, but it should make visual sense - http://www.wa.commufa.jp/~ksg/p_pfwp5_cgf.htm )

Mesh Distort

(with variable mesh resolution) - Like gradient meshes but for distorting the object itself, not color