lot of inx refactorings - changed menu logic

This commit is contained in:
Mario Voigt 2021-11-03 03:52:37 +01:00
parent 2ea449bfb6
commit c28164f0fd
112 changed files with 484 additions and 458 deletions

View File

@ -13,9 +13,9 @@
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Shape/Pattern from Generator"/>
</submenu>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Puzzles/Mazes/Nests"/>
</submenu>
</effects-menu>
</effect>
<script>

View File

@ -54,7 +54,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Nesting/Cut Optimization"/>
<submenu name="Animation"/>
</submenu>
</effects-menu>
</effect>

View File

@ -6,7 +6,7 @@
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Transformations"/>
</submenu>
</effects-menu>
</effect>

View File

@ -23,9 +23,9 @@ c1,c2,c3 = curvatures of first 3 osculating circles</label>
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Shape/Pattern from Generator"/>
</submenu>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Puzzles/Mazes/Nests"/>
</submenu>
</effects-menu>
</effect>
<script>

View File

@ -6,7 +6,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Transformations"/>
</submenu>
</effects-menu>
</effect>

View File

@ -7,7 +7,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Transformations"/>
</submenu>
</effects-menu>
</effect>

View File

@ -6,7 +6,7 @@
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Transformations"/>
</submenu>
</effects-menu>
</effect>

View File

@ -21,8 +21,8 @@
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Shape/Pattern from Generator"/>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Streaks And Blobs" />
</submenu>
</effects-menu>
</effect>

View File

@ -17,9 +17,9 @@ You can paste Bouwkamp codes with or without various formatting characters (like
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Shape/Pattern from Generator"/>
</submenu>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Puzzles/Mazes/Nests"/>
</submenu>
</effects-menu>
</effect>
<script>

View File

@ -19,7 +19,7 @@
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Paths - Join/Order" />
</submenu>
</effects-menu>
</effect>

View File

@ -39,8 +39,8 @@
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Shape/Pattern from Generator"/>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Streaks And Blobs" />
</submenu>
</effects-menu>
</effect>

View File

@ -16,7 +16,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Legacy Tools"/>
<submenu name="Paths - Join/Order"/>
</submenu>
</effects-menu>
</effect>

View File

@ -59,7 +59,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Nesting/Cut Optimization"/>
<submenu name="Colors/Gradients/Filters"/>
</submenu>
</effects-menu>
</effect>

View File

@ -76,7 +76,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Various"/>
<submenu name="Colors/Gradients/Filters"/>
</submenu>
</effects-menu>
<menu-tip>Generate color harmonies and save as palette file</menu-tip>

View File

@ -18,7 +18,7 @@
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Tracing/Edge Detection"/>
<submenu name="Dimensioning/Measuring"/>
</submenu>
</effects-menu>
</effect>

View File

@ -178,7 +178,7 @@ Tips:
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Paths - Cut/Intersect/Purge" />
</submenu>
</effects-menu>
</effect>

View File

@ -90,7 +90,7 @@
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Paths - Cut/Intersect/Purge"/>
</submenu>
</effects-menu>
</effect>

View File

@ -28,7 +28,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Nesting/Cut Optimization"/>
<submenu name="Transformations"/>
</submenu>
</effects-menu>
</effect>

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<name>Destructive Clip</name>
<id>fablabchemnitz.de.destructive_clip</id>
<effect>
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
</submenu>
</effects-menu>
<menu-tip>"Destructively" clip selected paths using the topmost as clipping path</menu-tip>
</effect>
<script>
<command location="inx" interpreter="python">destructive_clip.py</command>
</script>
<name>Destructive Clip</name>
<id>fablabchemnitz.de.destructive_clip</id>
<effect>
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Paths - Cut/Intersect/Purge" />
</submenu>
</effects-menu>
<menu-tip>"Destructively" clip selected paths using the topmost as clipping path</menu-tip>
</effect>
<script>
<command location="inx" interpreter="python">destructive_clip.py</command>
</script>
</inkscape-extension>

View File

@ -48,7 +48,7 @@
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Legacy Tools"/>
<submenu name="Dimensioning/Measuring"/>
</submenu>
</effects-menu>
</effect>

View File

@ -5,9 +5,9 @@
<effect>
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
</submenu>
<submenu name="FabLab Chemnitz">
<submenu name="Paths - Join/Order" />
</submenu>
</effects-menu>
</effect>
<script>

View File

@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<name>Eggmazing</name>
<id>fablabchemnitz.de.eggmazing</id>
<param name="mazeSize" type="optiongroup" appearance="combo" gui-text="Maze dimensions (w x h):">
<option value="SMALL">Small (32 x 6)</option>
<option value="MEDIUM">Medium (64 x 12)</option>
<option value="LARGE">Large (96 x 18)</option>
<option value="XLARGE">Extra large (128 x 24)</option>
</param>
<effect needs-live-preview="true">
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Shape/Pattern from Generator"/>
</submenu>
</effects-menu>
</effect>
<script>
<command location="inx" interpreter="python">eggmazing.py</command>
</script>
<name>Eggmazing</name>
<id>fablabchemnitz.de.eggmazing</id>
<param name="mazeSize" type="optiongroup" appearance="combo" gui-text="Maze dimensions (w x h):">
<option value="SMALL">Small (32 x 6)</option>
<option value="MEDIUM">Medium (64 x 12)</option>
<option value="LARGE">Large (96 x 18)</option>
<option value="XLARGE">Extra large (128 x 24)</option>
</param>
<effect needs-live-preview="true">
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Puzzles/Mazes/Nests" />
</submenu>
</effects-menu>
</effect>
<script>
<command location="inx" interpreter="python">eggmazing.py</command>
</script>
</inkscape-extension>

View File

@ -6,7 +6,7 @@
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Legacy Tools"/>
<submenu name="Modify existing Path(s)"/>
</submenu>
</effects-menu>
</effect>

View File

@ -53,7 +53,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Various"/>
<submenu name="Transformations" />
</submenu>
</effects-menu>
<menu-tip>Widen the document to send all lines properly to Epilog Dashboard</menu-tip>

View File

@ -9,7 +9,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)" />
<submenu name="Transformations" />
</submenu>
</effects-menu>
</effect>

View File

@ -18,7 +18,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Legacy Tools"/>
<submenu name="Modify existing Path(s)"/>
</submenu>
</effects-menu>
</effect>

View File

@ -32,7 +32,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Nesting/Cut Optimization"/>
<submenu name="Paths - Cut/Intersect/Purge"/>
</submenu>
</effects-menu>
</effect>

View File

@ -4,21 +4,21 @@
<id>fablabchemnitz.de.flash_burst</id>
<param name="r1" type="int" min="1" max="20" gui-text="Radius - inner (min)">10</param>
<param name="r2" type="int" min="1" max="20" gui-text="Radius - inner (max)">10</param>
<separator/>
<separator />
<param name="R1" type="int" min="200" max="500" gui-text="Radius - outer (min)">350</param>
<param name="R2" type="int" min="200" max="500" gui-text="Radius - outer (max)">350</param>
<separator/>
<separator />
<param name="a1" type="int" min="1" max="45" gui-text="Angle (min)">5</param>
<param name="a2" type="int" min="1" max="45" gui-text="Angle (max)">10</param>
<separator/>
<separator />
<param name="ad1" type="int" min="1" max="10" gui-text="Angle delta (min)">3</param>
<param name="ad2" type="int" min="1" max="10" gui-text="Angle delta (max)">5</param>
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Shape/Pattern from Generator"/>
</submenu>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Streaks And Blobs" />
</submenu>
</effects-menu>
</effect>
<script>

View File

@ -6,7 +6,7 @@
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Transformations"/>
</submenu>
</effects-menu>
</effect>

View File

@ -9,7 +9,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Various"/>
<submenu name="Animation"/>
</submenu>
</effects-menu>
</effect>

View File

@ -165,7 +165,7 @@ Typical ruler set: 7.25, 9.5, 10, 12, 14, 15, 16, 20
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Dimensioning/Measuring"/>
<submenu name="Music"/>
</submenu>
</effects-menu>
</effect>

View File

@ -5,9 +5,9 @@
<effect implements-custom-gui="true">
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Shape/Pattern from Generator"/>
</submenu>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Streaks And Blobs" />
</submenu>
</effects-menu>
</effect>
<script>

View File

@ -83,9 +83,9 @@ Caution: Undercut is currently not generated. E.g. a gear at pressure angle 20 d
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Gear Generators"/>
</submenu>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Gears" />
</submenu>
</effects-menu>
</effect>
<script>

View File

@ -1,25 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<name>Gears2</name>
<id>fablabchemnitz.de.gears2</id>
<param name="tab" type="notebook">
<page name="Options" gui-text="Options">
<param name="teeth" type="int" min="6" max="500" gui-text="Number of teeth">24</param>
<param name="pressure_angle" type="float" min="1" max="40" gui-text="Pressure angle">20</param>
<param name="size_type" type="optiongroup" appearance="combo" gui-text="Size type">
<option value="1">Module (mm)</option>
<option value="2">Pitch diameter (inches)</option>
<option value="3">Diametral pitch (inches)</option>
</param>
<param name="size" type="float" min="0.01" max="500" gui-text="Size">5</param>
<param name="orientation" type="optiongroup" appearance="combo" gui-text="Gear orientation">
<option value="1">External</option>
<option value="2">Internal</option>
</param>
</page>
<page name="Help" gui-text="Help">
<label xml:space="preserve">
<name>Gears2</name>
<id>fablabchemnitz.de.gears2</id>
<param name="tab" type="notebook">
<page name="Options" gui-text="Options">
<param name="teeth" type="int" min="6" max="500" gui-text="Number of teeth">24</param>
<param name="pressure_angle" type="float" min="1" max="40" gui-text="Pressure angle">20</param>
<param name="size_type" type="optiongroup" appearance="combo" gui-text="Size type">
<option value="1">Module (mm)</option>
<option value="2">Pitch diameter (inches)</option>
<option value="3">Diametral pitch (inches)</option>
</param>
<param name="size" type="float" min="0.01" max="500" gui-text="Size">5</param>
<param name="orientation" type="optiongroup" appearance="combo" gui-text="Gear orientation">
<option value="1">External</option>
<option value="2">Internal</option>
</param>
</page>
<page name="Help" gui-text="Help">
<label xml:space="preserve">
Number of teeth: Exactly what it sounds like.
Pressure angle: The angle in degrees of pressure between teeth in contact. The higher this is, the wider and more triangular the teeth will be. This can make them stronger but also less tolerant of manufacturing errors and misalignment. Common values are 14.5, 20 and 25.
@ -33,17 +32,17 @@ Orientation: External or internal. (Probably external.)
This extension is based on gearUtils-03.js by Dr A.R.Collins.
Latest version: www.arc.id.au/gearDrawing.html
</label>
</page>
</param>
<effect needs-live-preview="true">
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Gear Generators"/>
</submenu>
</effects-menu>
</effect>
<script>
<command location="inx" interpreter="python">gears2.py</command>
</script>
</inkscape-extension>
</page>
</param>
<effect needs-live-preview="true">
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Gears" />
</submenu>
</effects-menu>
</effect>
<script>
<command location="inx" interpreter="python">gears2.py</command>
</script>
</inkscape-extension>

View File

@ -31,7 +31,9 @@
<effect needs-live-preview="false">
<object-type>all</object-type>
<effects-menu>
<submenu name="Palette" />
<submenu name="FabLab Chemnitz">
<submenu name="Colors/Gradients/Filters"/>
</submenu>
</effects-menu>
</effect>
<script>

View File

@ -6,7 +6,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Various"/>
<submenu name="Colors/Gradients/Filters"/>
</submenu>
</effects-menu>
</effect>

View File

@ -38,7 +38,7 @@
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Various"/>
<submenu name="Colors/Gradients/Filters"/>
</submenu>
</effects-menu>
</effect>

View File

@ -12,7 +12,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Dimensioning/Measuring"/></submenu>
<submenu name="Music"/></submenu>
</effects-menu>
</effect>
<script>

View File

@ -34,7 +34,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Various"/>
<submenu name="Text"/>
</submenu>
</effects-menu>
</effect>

View File

@ -16,7 +16,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Tracing/Edge Detection"/>
<submenu name="Tracing/Images/Edge Detection"/>
</submenu>
</effects-menu>
</effect>

View File

@ -83,7 +83,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Tracing/Edge Detection"/>
<submenu name="Tracing/Images/Edge Detection"/>
</submenu>
</effects-menu>
</effect>

View File

@ -6,7 +6,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Paths - Cut/Intersect/Purge" />/>
</submenu>
</effects-menu>
<menu-tip>Apply successive difference operations on superimposed paths. Useful for plotter addicts.</menu-tip>

View File

@ -23,7 +23,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Various"/>
<submenu name="Transformations"/>
</submenu>
</effects-menu>
</effect>

View File

@ -51,7 +51,9 @@
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz"/>
<submenu name="FabLab Chemnitz">
<submenu name="Cutting/Plotting/Printing"/>
</submenu>
</effects-menu>
</effect>
<script>

View File

@ -12,7 +12,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Transformations"/>
</submenu>
</effects-menu>
</effect>

View File

@ -7,7 +7,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Various"/>
<submenu name="Colors/Gradients/Filters"/>
</submenu>
</effects-menu>
</effect>

View File

@ -99,7 +99,7 @@ This extension is originally based on 'Join Paths Optimized' by Shriinivas.</lab
<object-type>path</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Modify existing Path(s)"/>
<submenu name="Paths - Join/Order" />
</submenu>
</effects-menu>
</effect>

View File

@ -20,8 +20,8 @@ This extension requires that imagemagick is installed, more info and download at
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Legacy Tools"/>
</submenu>
<submenu name="Import/Export/Transfer"/>
</submenu>
</effects-menu>
</effect>
<script>

View File

@ -1,51 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<name>Knob Scale</name>
<id>fablabchemnitz.de.knob_scale</id>
<param name="tab" type="notebook">
<page name="general_settings" gui-text="General">
<param name="x" type="float" min="-1000" max="10000" precision="3" gui-text="Center X:">0</param>
<param name="y" type="float" min="-1000" max="10000" precision="3" gui-text="Center Y:">0</param>
<param name="radius" type="float" min="0.001" max="10000" precision="3" gui-text="Knob radius:">100</param>
<param name="angle" type="float" min="90.0" max="360.0" precision="3" gui-text="Angle">300</param>
<param name="linewidth" type="float" min="0.001" max="100" precision="3" gui-text="Line width">1</param>
<param name="draw_arc" type="bool" gui-text="Draw Arc">true</param>
<param name="draw_centering_circle" type="bool" gui-text="Draw Centering Circle">false</param>
<param name="logarithmic_scale" type="bool" gui-text="Logarithmic Scale">false</param>
<param name="units" type="optiongroup" gui-text="Units" appearance="combo">
<option value="px">px</option>
<option value="mm">mm</option>
</param>
</page>
<page name="ticks_settings" gui-text="Marks">
<param name="n_ticks" type="int" min="2" max="100" gui-text="Number of tick marks:">2</param>
<param name="ticksize" type="float" min="0.001" max="1000" precision="3" gui-text="Tick size: ">10</param>
<param name="n_subticks" type="int" min="0" max="100" gui-text="Number of subticks:">1</param>
<param name="subticksize" type="float" min="0.001" max="1000" precision="3" gui-text="Subtick size: ">5</param>
<param name="style" type="optiongroup" gui-text="Scale style" appearance="combo">
<option value="marks_inwards">Marks inwards</option>
<option value="marks_outwards">Marks outwards</option>
<option value="marks_circles">Dots</option>
</param>
</page>
<page name="labels_settings" gui-text="Labels">
<param name="labels_enabled" type="bool" gui-text="Enable labels">false</param>
<param name="rounding_level" type="int" min="0" max="100" gui-text="Rounding Float to">0</param>
<param name="text_size" type="float" min="0.001" max="1000" precision="3" gui-text="Labels size">10</param>
<param name="text_offset" type="float" min="-1000" max="1000" precision="3" gui-text="Offset">20</param>
<param name="start_value" type="float" min="-10000" max="10000" precision="3" gui-text="Start Value">0</param>
<param name="stop_value" type="float" min="-10000" max="10000" precision="3" gui-text="Stop Value">10</param>
</page>
</param>
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Shape/Pattern from Generator"/>
</submenu>
</effects-menu>
</effect>
<script>
<command location="inx" interpreter="python">knob_scale.py</command>
</script>
<name>Knob Scale</name>
<id>fablabchemnitz.de.knob_scale</id>
<param name="tab" type="notebook">
<page name="general_settings" gui-text="General">
<param name="x" type="float" min="-1000" max="10000" precision="3" gui-text="Center X:">0</param>
<param name="y" type="float" min="-1000" max="10000" precision="3" gui-text="Center Y:">0</param>
<param name="radius" type="float" min="0.001" max="10000" precision="3" gui-text="Knob radius:">100</param>
<param name="angle" type="float" min="90.0" max="360.0" precision="3" gui-text="Angle">300</param>
<param name="linewidth" type="float" min="0.001" max="100" precision="3" gui-text="Line width">1</param>
<param name="draw_arc" type="bool" gui-text="Draw Arc">true</param>
<param name="draw_centering_circle" type="bool" gui-text="Draw Centering Circle">false</param>
<param name="logarithmic_scale" type="bool" gui-text="Logarithmic Scale">false</param>
<param name="units" type="optiongroup" gui-text="Units" appearance="combo">
<option value="px">px</option>
<option value="mm">mm</option>
</param>
</page>
<page name="ticks_settings" gui-text="Marks">
<param name="n_ticks" type="int" min="2" max="100" gui-text="Number of tick marks:">2</param>
<param name="ticksize" type="float" min="0.001" max="1000" precision="3" gui-text="Tick size: ">10</param>
<param name="n_subticks" type="int" min="0" max="100" gui-text="Number of subticks:">1</param>
<param name="subticksize" type="float" min="0.001" max="1000" precision="3" gui-text="Subtick size: ">5</param>
<param name="style" type="optiongroup" gui-text="Scale style" appearance="combo">
<option value="marks_inwards">Marks inwards</option>
<option value="marks_outwards">Marks outwards</option>
<option value="marks_circles">Dots</option>
</param>
</page>
<page name="labels_settings" gui-text="Labels">
<param name="labels_enabled" type="bool" gui-text="Enable labels">false</param>
<param name="rounding_level" type="int" min="0" max="100" gui-text="Rounding Float to">0</param>
<param name="text_size" type="float" min="0.001" max="1000" precision="3" gui-text="Labels size">10</param>
<param name="text_offset" type="float" min="-1000" max="1000" precision="3" gui-text="Offset">20</param>
<param name="start_value" type="float" min="-10000" max="10000" precision="3" gui-text="Start Value">0</param>
<param name="stop_value" type="float" min="-10000" max="10000" precision="3" gui-text="Stop Value">10</param>
</page>
</param>
<effect>
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz Shape Generators">
<submenu name="Scales" />
</submenu>
</effects-menu>
</effect>
<script>
<command location="inx" interpreter="python">knob_scale.py</command>
</script>
</inkscape-extension>

View File

@ -6,7 +6,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Various"/>
<submenu name="Text"/>
</submenu>
</effects-menu>
</effect>

View File

@ -3,20 +3,9 @@
<name>Laser Check</name>
<id>fablabchemnitz.de.laser_check</id>
<param name="tab" type="notebook">
<page name="tab_settings" gui-text="Laser Check">
<label appearance="header">General</label>
<page name="tab_checks" gui-text="Checks">
<param name="show_issues_only" type="bool" gui-text="Show potential issues only" gui-description="Shortens the report a little bit">false</param>
<separator/>
<label appearance="header">Machine Settings</label>
<param name="machine_size" gui-text="Machine/Size (mm)" type="optiongroup" appearance="combo">
<option value="406x305">406 x 305 mm (Zing 16)</option>
<option value="610x305">610 x 305 mm (Zing 24 / Fusion Edge 12)</option>
<option value="812x508">812 x 508 mm (Fusion Pro 32 / Fusion M2 32)</option>
<option value="1016x711">1016 x 711 mm (Fusion M2 40)</option>
<option value="1219x914">1219 x 914 mm (Fusion Pro 48)</option>
</param>
<param name="max_cutting_speed" type="float" min="0.000" max="9999.000" gui-text="Max. cutting speed (mm/s)">100</param>
<label appearance="header">Checks</label>
<param name="checks" type="optiongroup" appearance="combo" gui-text="Select checks">
<option value="check_all">Check all</option>
<option value="check_section">Check selection</option>
@ -61,6 +50,21 @@
</vbox>
</hbox>
</page>
<page name="tab_setup" gui-text="Machine Setup">
<label appearance="header">Machine Settings</label>
<param name="machine_size" gui-text="Machine/Size (mm)" type="optiongroup" appearance="combo">
<option value="406x305">406 x 305 mm (Zing 16)</option>
<option value="610x305">610 x 305 mm (Zing 24 / Fusion Edge 12)</option>
<option value="812x508">812 x 508 mm (Fusion Pro 32 / Fusion M2 32)</option>
<option value="1016x711">1016 x 711 mm (Fusion M2 40)</option>
<option value="1219x914">1219 x 914 mm (Fusion Pro 48)</option>
</param>
<param name="max_cutting_speed" type="float" min="0.000" max="9999.000" precision="2" gui-text="Max. cutting speed (mm/s)">500</param>
<param name="max_travel_speed" type="float" min="0.000" max="9999.000" precision="2" gui-text="Max. travel speed (mm/s)">150</param>
<param name="cut_travel_factor" type="float" min="0.1" max="1.0" precision="2" gui-text="Factor between cutting/travel moves" gui-description="Usually ~60-80% are cutting time, rest is travel time">0.60</param>
<param name="price_per_minute_gross" type="float" min="0.0" max="9999.0" precision="2" gui-text="Price/minute € (gross)">2.0</param>
<param name="vector_grid_xy" type="float" min="0.0" max="9999.0" precision="2" gui-text="Vector grid (mm)">12.0</param>
</page>
<page name="tab_about" gui-text="About">
<label appearance="header">Laser Check</label>
<label>A utility to check for common issue potencials in vector graphics, especially regarding to laser cutting jobs.</label>
@ -92,7 +96,7 @@
<object-type>all</object-type>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Nesting/Cut Optimization"/>
<submenu name="Cutting/Plotting/Printing"/>
</submenu>
</effects-menu>
</effect>

View File

@ -5,25 +5,34 @@ from inkex.bezier import csplength, csparea
from lxml import etree
import re
import math
import datetime
class LaserCheck(inkex.EffectExtension):
'''
ToDos:
- check for old styles which should be upgraded
- self-intersecting paths
- number of parts to weed in total; number of parts which are smaller than vector grid
- add some inkex.Desc to all elements which were checked and which have some issue. use special syntax to remove old stuff each time the check is applied again
- this code is horrible ugly stuff
'''
def add_arguments(self, pars):
pars.add_argument('--tab')
pars.add_argument('--machine_size', default="812x508")
pars.add_argument('--max_cutting_speed', type=float, default=500)
pars.add_argument('--max_travel_speed', type=float, default=150)
pars.add_argument('--cut_travel_factor', type=float, default=0.60)
pars.add_argument('--price_per_minute_gross', type=float, default=2.0)
pars.add_argument('--vector_grid_xy', type=float, default=12.0) #TODO
pars.add_argument('--show_issues_only', type=inkex.Boolean, default=False)
pars.add_argument('--checks', default="check_all")
pars.add_argument('--max_cutting_speed', type=float, default=100)
pars.add_argument('--bbox', type=inkex.Boolean, default=False)
pars.add_argument('--bbox_offset', type=float, default=5.000)
pars.add_argument('--cutting_estimation', type=inkex.Boolean, default=False)
pars.add_argument('--machine_size', default="812x508")
pars.add_argument('--elements_outside_canvas', type=inkex.Boolean, default=False)
pars.add_argument('--groups_and_layers', type=inkex.Boolean, default=False)
pars.add_argument('--clones', type=inkex.Boolean, default=False)
@ -50,7 +59,10 @@ class LaserCheck(inkex.EffectExtension):
def effect(self):
so = self.options
machineWidth = self.svg.unittouu(so.machine_size.split('x')[0] + "mm")
machineHeight = self.svg.unittouu(so.machine_size.split('x')[1] + "mm")
selected = [] #total list of elements to parse
def parseChildren(element):
if element not in selected:
@ -92,7 +104,7 @@ class LaserCheck(inkex.EffectExtension):
nonShapes.append(element)
else:
shapes.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} shape elements in total".format(len(shapes)))
inkex.utils.debug("{} non-shape elements in total".format(len(nonShapes)))
for nonShape in nonShapes:
@ -144,38 +156,35 @@ class LaserCheck(inkex.EffectExtension):
bb_width = round(bbox.width, 3)
bb_height = round(bbox.height, 3)
if bb_left >= fmm:
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("left border... ok")
else:
inkex.utils.debug("left border... fail: {:0.3f} mm".format(self.svg.uutounit(bb_left, "mm")))
if bb_top >= fmm:
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("top border... ok")
else:
inkex.utils.debug("top border... fail: {:0.3f} mm".format(self.svg.uutounit(bb_top, "mm")))
if bb_right + fmm <= page_width:
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("right border... ok")
else:
inkex.utils.debug("right border... fail: {:0.3f} mm".format(self.svg.uutounit(bb_right, "mm")))
if bb_bottom + fmm <= width_height:
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("bottom border... ok")
else:
inkex.utils.debug("bottom border... fail: {:0.3f} mm".format(self.svg.uutounit(bb_bottom, "mm")))
machineWidth = self.svg.unittouu(self.options.machine_size.split('x')[0] + "mm")
if bb_width <= machineWidth:
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("page width... ok")
else:
inkex.utils.debug("page width... fail: {:0.3f} mm".format(bb_width))
machineHeight = self.svg.unittouu(self.options.machine_size.split('x')[1] + "mm")
if bb_height <= machineHeight:
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("page height... ok")
else:
inkex.utils.debug("page height... fail: {:0.3f} mm".format(bb_height))
@ -192,7 +201,7 @@ class LaserCheck(inkex.EffectExtension):
for child in element:
maxDepth(child, level + 1)
maxDepth(self.document.getroot(), -1)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("Maximum group depth={}".format(md - 1))
if md - 1 > 2:
self.msg("Warning: this group depth might cause issues!")
@ -204,7 +213,7 @@ class LaserCheck(inkex.EffectExtension):
layers.append(element)
else:
groups.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} groups in total".format(len(groups)))
inkex.utils.debug("{} layers in total".format(len(layers)))
@ -227,7 +236,7 @@ class LaserCheck(inkex.EffectExtension):
for element in selected:
if element.tag == inkex.addNS('use','svg'):
uses.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} svg:use clones in total".format(len(uses)))
for use in uses:
inkex.utils.debug("id={}".format(use.get('id')))
@ -243,7 +252,7 @@ class LaserCheck(inkex.EffectExtension):
for element in selected:
if element.tag == inkex.addNS('clipPath','svg'):
clipPaths.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} svg:clipPath in total".format(len(clipPaths)))
for clipPath in clipPaths:
inkex.utils.debug("id={}".format(clipPath.get('id')))
@ -259,7 +268,7 @@ class LaserCheck(inkex.EffectExtension):
for element in selected:
if element.tag == inkex.addNS('image','svg'):
images.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} svg:image in total".format(len(images)))
for image in images:
inkex.utils.debug("image id={}".format(image.get('id')))
@ -274,7 +283,7 @@ class LaserCheck(inkex.EffectExtension):
for element in selected:
if element.tag in (inkex.addNS('line','svg'), inkex.addNS('polyline','svg'), inkex.addNS('polygon','svg')):
lowlevels.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} low level strokes in total".format(len(lowlevels)))
for lowlevel in lowlevels:
inkex.utils.debug("id={}".format(lowlevel.get('id')))
@ -291,7 +300,7 @@ class LaserCheck(inkex.EffectExtension):
for element in selected:
if element.tag == inkex.addNS('text','svg'):
texts.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} svg:text in total".format(len(texts)))
for text in texts:
inkex.utils.debug("id={}".format(text.get('id')))
@ -313,7 +322,7 @@ class LaserCheck(inkex.EffectExtension):
strokeColor = stroke[0].split("stroke:")[1].split(";")[0]
if strokeColor not in strokeColors:
strokeColors.append(strokeColor)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} different stroke colors in total".format(len(strokeColors)))
if len(strokeColors) > so.stroke_colors_max:
for strokeColor in strokeColors:
@ -335,7 +344,7 @@ class LaserCheck(inkex.EffectExtension):
strokeWidth = stroke_width[0].split("stroke-width:")[1].split(";")[0] #possibly w/o units. could contain units from css
if strokeWidth not in strokeWidths:
strokeWidths.append(strokeWidth)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} different stroke widths in total".format(len(strokeWidths)))
if len(strokeWidths) > so.stroke_widths_max:
for strokeWidth in strokeWidths:
@ -362,7 +371,7 @@ class LaserCheck(inkex.EffectExtension):
strokeDasharray = stroke_dasharray[0].split("stroke-dasharray:")[1].split(";")[0]
if strokeDasharray not in strokeDasharrays:
strokeDasharrays.append(strokeDasharray)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} different stroke dash arrays in total".format(len(strokeDasharrays)))
for strokeDasharray in strokeDasharrays:
inkex.utils.debug("stroke dash array {}".format(strokeDasharray))
@ -432,7 +441,7 @@ class LaserCheck(inkex.EffectExtension):
if (strokeVis == 0 or widthVis == 0 or strokeOpacityVis == 0) and (fillVis == 0 or fillOpacityVis == 0):
if element not in invisibles:
invisibles.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} invisible shapes in total".format(len(invisibles)))
for invisible in invisibles:
inkex.utils.debug("id={}".format(invisible.get('id')))
@ -453,7 +462,7 @@ class LaserCheck(inkex.EffectExtension):
if float(stroke_opacity[0].split("stroke-opacity:")[1].split(";")[0]) < 1.0:
if element not in transparencies:
transparencies.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} objects with stroke transparencies < 1.0 in total".format(len(transparencies)))
for transparency in transparencies:
inkex.utils.debug("id={}".format(transparency.get('id')))
@ -474,7 +483,7 @@ class LaserCheck(inkex.EffectExtension):
(len(commandsCoords) == 2 and commandsCoords[-1][0] == 'Z') or \
(len(commandsCoords) == 3 and commandsCoords[0][1] == commandsCoords[1][1] and commandsCoords[2][1] == 'Z'):
pointyPaths.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} pointy paths in total".format(len(pointyPaths)))
for pointyPath in pointyPaths:
inkex.utils.debug("id={}".format(pointyPath.get('id')))
@ -491,7 +500,7 @@ class LaserCheck(inkex.EffectExtension):
for element in shapes:
if element.get('transform') is not None:
transformations.append(element)
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} transformation in total".format(len(transformations)))
for transformation in transformations:
inkex.utils.debug("transformation in id={}".format(transformation.get('id')))
@ -512,7 +521,7 @@ class LaserCheck(inkex.EffectExtension):
if stotal < self.svg.unittouu(str(so.short_paths_min) + "mm"):
shortPaths.append([element, stotal])
totalDropLength += stotal
if self.options.show_issues_only is False:
if so.show_issues_only is False:
inkex.utils.debug("{} short paths in total".format(len(shortPaths)))
if totalDropLength > 0:
inkex.utils.debug("{:0.2f}% of total ({:0.2f} mm /{:0.2f} mm)".format(totalDropLength / totalLength, self.svg.uutounit(str(totalDropLength), "mm"), self.svg.uutounit(str(totalLength), "mm")))
@ -525,18 +534,27 @@ class LaserCheck(inkex.EffectExtension):
'''
if so.checks == "check_all" or so.cutting_estimation is True:
inkex.utils.debug("\n---------- Cutting time estimation")
totalLength = 0
totalCuttingLength = 0
for element in shapes:
if isinstance(element, inkex.PathElement):
slengths, stotal = csplength(element.path.transform(element.composed_transform()).to_superpath())
totalLength += stotal
inkex.utils.debug("cutting length (mm) = {:0.2f} mm".format(self.svg.uutounit(str(totalLength), "mm"), self.svg.uutounit(str(totalLength), "mm")))
for f in range(100, 0, -10):
v = so.max_cutting_speed * f/100.0
tsec = totalLength / v
tmin = tsec / 60
inkex.utils.debug("cutting time @{:0.0f}% (={}mm/s): {:0.2f}min (={:0.1f}s)".format(f, v, tmin, tsec))
totalCuttingLength += stotal
extraTraveLength = (machineWidth / 3 + machineHeight / 3) * 2.0 #from top-left to the ~1/3 of the bed and back again
totalTravelLength = totalCuttingLength * (1.0 - so