Difference between revisions of "LPE stacking"

From Inkscape Wiki
Jump to navigation Jump to search
(LPE stacking comment)
 
(4 intermediate revisions by one other user not shown)
Line 2: Line 2:
  
 
This Project is part of a student project from Ecole Centrale de Lyon.
 
This Project is part of a student project from Ecole Centrale de Lyon.
 +
(SVN : http://svn.eclair.ec-lyon.fr/ )
  
 
----
 
----
Line 8: Line 9:
  
 
Most of the work is on the UI, there is not a lot of work on the code.
 
Most of the work is on the UI, there is not a lot of work on the code.
 +
 +
Here is a mockup for the ui, it is almost coded :
 +
http://steren.giannini.googlepages.com/Stack_mockup.png
 +
 +
Here is a sample of a possible svg implementation :
 +
 +
    <defs>
 +
   
 +
    <inkscape:path-effect
 +
      effect="gears"
 +
      id="path-effect2416"
 +
      teeth="10" />
 +
   
 +
    <inkscape:path-effect
 +
      effect="bend_path"
 +
      id="path-effect2391"
 +
      bendpath="M 62.8571,376.648 C 227.61907,256.19958 392.38103,260.92537        557.143,376.648"
 +
      prop_scale="1"
 +
      bendpath-nodetypes="cc" />
 +
       
 +
    </defs>
 +
 +
And for the path : a list of LPE for "inkscape:path-effect"
 +
 +
    <path
 +
          style="opacity:0.93699993;fill:#00ffff;fill-opacity:0.99685531;fill-rule:nonzero;stroke:#000000;stroke-width:8.60000038;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
 +
      d="M -7.11922,280.927 C 37.9458,247.569 89.2988,218.713 146.607,197.876 C 198.322,179.282 253.844,169.323 310.85,169.515 C 310.85,169.515 310.85,169.515 310.85,169.515 C 367.851,170.198 422.845,180.778 473.748,199.332 C 529.85,219.891 580.42,247.738 625.293,279.618 L 488.993,473.678 C 457.274,451.763 425.352,433.602 393.395,422.447 C 365.1,412.479 336.324,406.573 309.15,406.652 C 282.11,406.242 253.702,411.611 226.251,421.245 C 194.956,432 163.706,450.213 132.833,472.369"
 +
      id="rect2388"
 +
      inkscape:path-effect="#path-effect2391;#path-effect2416"
 +
      inkscape:original-d="M 62.857143,258.07648 L 557.14285,258.07648 L 557.14285,495.21933 L 62.857143,495.21933 L 62.857143,258.07648 z" />
 +
 +
=comment by johan 12 feb 2008=
 +
 +
== enabling/disabling of effects in stack ==
 +
What I think is important is that it should be possible to turn effects off in the stack (by using checkboxes next to the effects in the list):
 +
 +
  enabled    effect
 +
      x        curve stitch
 +
              gears          (disabled)
 +
      x        bend path
 +
 +
== having intermediate result as output ==
 +
Also, it should be possible to get the result in the middle of the stack:
 +
 +
  enabled  output  effect
 +
      x              curve stitch
 +
      x      *      gears          (the output of this effect is shown, so bend path is skipped)
 +
      x              bend path
 +
 +
 +
== svg representation ==
 +
I've been thinking about making some sort of "stack effect" that has effects as parameters:
 +
 +
    <inkscape:path-effect
 +
      effect="stack"
 +
      id="path-effect2391"
 +
      effect1="#path-effect2"
 +
      effect2=" ..."
 +
    </defs>
 +
 +
But I think your solution is simpler and good enough. (complicated structures like is possible with filters is too much I think)
 +
Implementing the enabling/disabling of the effects and selecting the output step could be done like this:
 +
 +
    gear-lpe disabled:
 +
  inkscape:path-effect="#curve-lpe2391;!#gear-lpe416;#bendpath-lpe34"
 +
 +
  gear-lpe selected for output:
 +
  inkscape:path-effect="#curve-lpe2391;@#gear-lpe416;#bendpath-lpe34"
 +
 +
Note that this requires more complicated parsing!

Latest revision as of 20:05, 12 February 2008

LPE stacking

This Project is part of a student project from Ecole Centrale de Lyon. (SVN : http://svn.eclair.ec-lyon.fr/ )


The idea is to allow LPE chaining.

Most of the work is on the UI, there is not a lot of work on the code.

Here is a mockup for the ui, it is almost coded : http://steren.giannini.googlepages.com/Stack_mockup.png

Here is a sample of a possible svg implementation :

   <defs>
   
   <inkscape:path-effect
      effect="gears"
      id="path-effect2416"
      teeth="10" />
   
   <inkscape:path-effect
      effect="bend_path"
      id="path-effect2391"
      bendpath="M 62.8571,376.648 C 227.61907,256.19958 392.38103,260.92537        557.143,376.648"
      prop_scale="1"
      bendpath-nodetypes="cc" />
       
   </defs>

And for the path : a list of LPE for "inkscape:path-effect"

   <path
          style="opacity:0.93699993;fill:#00ffff;fill-opacity:0.99685531;fill-rule:nonzero;stroke:#000000;stroke-width:8.60000038;stroke-linejoin:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
      d="M -7.11922,280.927 C 37.9458,247.569 89.2988,218.713 146.607,197.876 C 198.322,179.282 253.844,169.323 310.85,169.515 C 310.85,169.515 310.85,169.515 310.85,169.515 C 367.851,170.198 422.845,180.778 473.748,199.332 C 529.85,219.891 580.42,247.738 625.293,279.618 L 488.993,473.678 C 457.274,451.763 425.352,433.602 393.395,422.447 C 365.1,412.479 336.324,406.573 309.15,406.652 C 282.11,406.242 253.702,411.611 226.251,421.245 C 194.956,432 163.706,450.213 132.833,472.369"
      id="rect2388"
      inkscape:path-effect="#path-effect2391;#path-effect2416"
      inkscape:original-d="M 62.857143,258.07648 L 557.14285,258.07648 L 557.14285,495.21933 L 62.857143,495.21933 L 62.857143,258.07648 z" />

comment by johan 12 feb 2008

enabling/disabling of effects in stack

What I think is important is that it should be possible to turn effects off in the stack (by using checkboxes next to the effects in the list):

  enabled     effect
     x        curve stitch
              gears          (disabled)
     x        bend path

having intermediate result as output

Also, it should be possible to get the result in the middle of the stack:

  enabled  output   effect
     x              curve stitch
     x       *      gears          (the output of this effect is shown, so bend path is skipped)
     x              bend path


svg representation

I've been thinking about making some sort of "stack effect" that has effects as parameters:

   <inkscape:path-effect
      effect="stack"
      id="path-effect2391"
      effect1="#path-effect2"
      effect2=" ..."
   </defs>

But I think your solution is simpler and good enough. (complicated structures like is possible with filters is too much I think) Implementing the enabling/disabling of the effects and selecting the output step could be done like this:

   gear-lpe disabled:
  inkscape:path-effect="#curve-lpe2391;!#gear-lpe416;#bendpath-lpe34"
  gear-lpe selected for output:
  inkscape:path-effect="#curve-lpe2391;@#gear-lpe416;#bendpath-lpe34"

Note that this requires more complicated parsing!