From adfacd8b2adf327e3f91a0e2afc7f66ebfdb5004 Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Mon, 19 Apr 2021 20:54:38 +0200 Subject: [PATCH] updated some inx files --- .gitignore | 1 + .pydevproject | 5 + .../fablabchemnitz/archimedesspiral.inx | 59 +++--- extensions/fablabchemnitz/archimedesspiral.py | 1 + .../{cleanup.inx => cleanup_styles.inx} | 41 +++-- .../{cleanup.py => cleanup_styles.py} | 4 +- .../contourscanner/contour_scanner.inx | 45 +++-- extensions/fablabchemnitz/create_links.inx | 37 ++-- extensions/fablabchemnitz/create_links.py | 39 ++-- .../dxf2papercraft/dxf2papercraft.inx | 5 +- .../dxfdwgimporter/dxfdwgimporter.inx | 51 ++++-- .../imagetracer.js/imagetracerjs.inx | 124 ++++++++----- .../imagetracer.js/imagetracerjs.py | 2 +- .../fablabchemnitz/inventory_sticker.inx | 39 ++-- .../fablabchemnitz/inventory_sticker.py | 2 +- extensions/fablabchemnitz/migrategroups.inx | 169 ++++++++++-------- extensions/fablabchemnitz/migrategroups.py | 135 +++++++------- .../papercraft_unfold/papercraft_unfold.inx | 44 +++-- .../papercraft_unfold/papercraft_unfold.py | 3 +- extensions/fablabchemnitz/paperfold.inx | 69 ++++--- extensions/fablabchemnitz/paperfold.py | 1 + .../fablabchemnitz/primitive/primitive.inx | 84 ++++++--- .../fablabchemnitz/primitive/primitive.py | 1 + .../fablabchemnitz/styles_to_layers.inx | 75 +++++--- extensions/fablabchemnitz/styles_to_layers.py | 1 + .../vpypetools/vpypetools_filter.inx | 41 +++-- .../vpypetools/vpypetools_freemode.inx | 46 +++-- .../vpypetools/vpypetools_linemerge.inx | 41 +++-- .../vpypetools/vpypetools_linesort.inx | 41 +++-- .../vpypetools/vpypetools_multipass.inx | 41 +++-- .../vpypetools/vpypetools_occult.inx | 41 +++-- .../vpypetools/vpypetools_relooping.inx | 41 +++-- .../vpypetools/vpypetools_splitall.inx | 41 +++-- .../vpypetools/vpypetools_trim.inx | 41 +++-- 34 files changed, 934 insertions(+), 477 deletions(-) create mode 100644 .pydevproject rename extensions/fablabchemnitz/{cleanup.inx => cleanup_styles.inx} (58%) rename extensions/fablabchemnitz/{cleanup.py => cleanup_styles.py} (98%) diff --git a/.gitignore b/.gitignore index e2270029..eabaffd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.pyc /.project +/.pydevproject diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 00000000..2b045655 --- /dev/null +++ b/.pydevproject @@ -0,0 +1,5 @@ + + + Default + python interpreter + diff --git a/extensions/fablabchemnitz/archimedesspiral.inx b/extensions/fablabchemnitz/archimedesspiral.inx index f9489fab..e01ee4bb 100644 --- a/extensions/fablabchemnitz/archimedesspiral.inx +++ b/extensions/fablabchemnitz/archimedesspiral.inx @@ -2,26 +2,45 @@ The Spiral Of Archimedes fablabchemnitz.de.archimedesspiral - R = r + aθ - 50 - 3 - 50 - - - - - 0 - 5 - Notes - -The option "turns" only works if you set "length (mm)" to 0.0. -Otherwise the length value will be used to calculate the -spiral for given length. The higher the "step" value is -set the better the accuracy is. If you set the step value -really low the resulting length will not be precise and -the curve is maybe not drawn at all. You can validate the -length by using the extension "Visualize Path> Measure Path" - + + + R = r + aθ + 50 + 3 + 50 + + + + + 0 + 5 + + + + + + + + + + + + + + + + + + + + + + + + + 000_about_fablabchemnitz.svg + + all diff --git a/extensions/fablabchemnitz/archimedesspiral.py b/extensions/fablabchemnitz/archimedesspiral.py index 6e77921f..62b7bcc9 100644 --- a/extensions/fablabchemnitz/archimedesspiral.py +++ b/extensions/fablabchemnitz/archimedesspiral.py @@ -20,6 +20,7 @@ from math import cos, sin, pi, log, sqrt class Archimedes(inkex.EffectExtension): def add_arguments(self, pars): + pars.add_argument('--tab') pars.add_argument('--r', type = int, default = '50') pars.add_argument('--a', type = float, default = '3') pars.add_argument('--step', type = int, default = '50') diff --git a/extensions/fablabchemnitz/cleanup.inx b/extensions/fablabchemnitz/cleanup_styles.inx similarity index 58% rename from extensions/fablabchemnitz/cleanup.inx rename to extensions/fablabchemnitz/cleanup_styles.inx index 89ea485f..9e2b5136 100644 --- a/extensions/fablabchemnitz/cleanup.inx +++ b/extensions/fablabchemnitz/cleanup_styles.inx @@ -1,9 +1,9 @@ Cleanup Styles - fablabchemnitz.de.cleanup - - + fablabchemnitz.de.cleanup_styles + + @@ -28,15 +28,30 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + 000_about_fablabchemnitz.svg @@ -48,6 +63,6 @@ \ No newline at end of file diff --git a/extensions/fablabchemnitz/cleanup.py b/extensions/fablabchemnitz/cleanup_styles.py similarity index 98% rename from extensions/fablabchemnitz/cleanup.py rename to extensions/fablabchemnitz/cleanup_styles.py index 69426449..5ce29d0a 100644 --- a/extensions/fablabchemnitz/cleanup.py +++ b/extensions/fablabchemnitz/cleanup_styles.py @@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Based on - coloreffect.py by Jos Hirth and Aaron C. Spike -- cleanup.py https://github.com/attoparsec/inkscape-extensions by attoparsec +- cleanup.py (https://github.com/attoparsec/inkscape-extensions) by attoparsec Author: Mario Voigt / FabLab Chemnitz Mail: mario.voigt@stadtfabrikanten.org @@ -37,7 +37,7 @@ class Cleanup(inkex.EffectExtension): groups = [] def add_arguments(self, pars): - pars.add_argument("--main_tabs") + pars.add_argument("--tab") pars.add_argument("--mode", default="Lines", help="Join paths with lines or polygons") pars.add_argument("--dedicated_style_attributes", default="ignore", help="Handling of dedicated style attributes") pars.add_argument("--stroke_width_override", type=inkex.Boolean, default=False, help="Override stroke width") diff --git a/extensions/fablabchemnitz/contourscanner/contour_scanner.inx b/extensions/fablabchemnitz/contourscanner/contour_scanner.inx index 81af520b..557c1350 100644 --- a/extensions/fablabchemnitz/contourscanner/contour_scanner.inx +++ b/extensions/fablabchemnitz/contourscanner/contour_scanner.inx @@ -3,10 +3,10 @@ Contour Scanner fablabchemnitz.de.contour_scanner - + - + true 4012452351 true @@ -21,7 +21,7 @@ - + false false false @@ -35,16 +35,35 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg diff --git a/extensions/fablabchemnitz/create_links.inx b/extensions/fablabchemnitz/create_links.inx index 687a8742..d1e54655 100644 --- a/extensions/fablabchemnitz/create_links.inx +++ b/extensions/fablabchemnitz/create_links.inx @@ -2,8 +2,8 @@ Create Links (Breakaway Connectors) fablabchemnitz.de.create_links - - + + @@ -56,16 +56,33 @@ false false - + - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + 000_about_fablabchemnitz.svg diff --git a/extensions/fablabchemnitz/create_links.py b/extensions/fablabchemnitz/create_links.py index ebaad9ee..65768841 100644 --- a/extensions/fablabchemnitz/create_links.py +++ b/extensions/fablabchemnitz/create_links.py @@ -43,7 +43,7 @@ from inkex.bezier import csplength class LinksCreator(inkex.EffectExtension): def add_arguments(self, pars): - pars.add_argument("--main_tabs") + pars.add_argument("--tab") pars.add_argument("--path_types", default="closed_paths", help="Apply for closed paths, open paths or both") pars.add_argument("--creationunit", default="mm", help="Creation Units") pars.add_argument("--creationtype", default="entered_values", help="Creation") @@ -95,10 +95,9 @@ class LinksCreator(inkex.EffectExtension): nodeParent = node.getparent() pathIsClosed = False - path = node.path.to_superpath() - if path[-1][0] == 'Z' or path[0] == path[-1]: #if first is last point the path is also closed. The "Z" command is not required + path = node.path.to_arrays() #to_arrays() is deprecated. How to make more modern? + if path[-1][0] == 'Z' or path[0][1] == path[-1][1]: #if first is last point the path is also closed. The "Z" command is not required pathIsClosed = True - if self.options.path_types == 'open_paths' and pathIsClosed is True: return #skip this loop iteration elif self.options.path_types == 'closed_paths' and pathIsClosed is False: @@ -119,7 +118,7 @@ class LinksCreator(inkex.EffectExtension): if self.options.length_filter is True: if stotal < self.svg.unittouu(str(self.options.length_filter_value) + self.options.length_filter_unit): - if self.options.show_info is True: inkex.errormsg("node " + node.get('id') + " is shorter than minimum allowed length of {:1.3f} {}. Path length is {:1.3f} {}".format(self.options.length_filter_value, self.options.length_filter_unit, stotal, self.options.creationunit)) + if self.options.show_info is True: self.msg("node " + node.get('id') + " is shorter than minimum allowed length of {:1.3f} {}. Path length is {:1.3f} {}".format(self.options.length_filter_value, self.options.length_filter_unit, stotal, self.options.creationunit)) return #skip this loop iteration if self.options.creationunit == "percent": @@ -142,7 +141,7 @@ class LinksCreator(inkex.EffectExtension): #validate dashes. May not be negative. Otherwise Inkscape will freeze forever. Reason: rendering issue if any(dash <= 0.0 for dash in dashes) == True: - if self.options.show_info is True: inkex.errormsg("node " + node.get('id') + ": Error! Dash array may not contain negative numbers: " + ' '.join(format(dash, "1.3f") for dash in dashes) + ". Path skipped. Maybe it's too short. Adjust your link count, multiplicator and length accordingly, or set to unit '%'") + if self.options.show_info is True: self.msg("node " + node.get('id') + ": Error! Dash array may not contain negative numbers: " + ' '.join(format(dash, "1.3f") for dash in dashes) + ". Path skipped. Maybe it's too short. Adjust your link count, multiplicator and length accordingly, or set to unit '%'") return False if self.options.skip_errors is True else exit(1) if self.options.creationunit == "percent": @@ -155,7 +154,7 @@ class LinksCreator(inkex.EffectExtension): if self.options.creationtype == "use_existing": if self.options.no_convert is True: - if self.options.show_info is True: inkex.errormsg("node " + node.get('id') + ": Nothing to do. Please select another creation method or disable cosmetic style output paths.") + if self.options.show_info is True: self.msg("node " + node.get('id') + ": Nothing to do. Please select another creation method or disable cosmetic style output paths.") return False if self.options.skip_errors is True else exit(1) stroke_dashoffset = 0 style = node.style @@ -168,7 +167,7 @@ class LinksCreator(inkex.EffectExtension): else: raise ValueError except: - if self.options.show_info is True: inkex.errormsg("node " + node.get('id') + ": No dash style to continue with.") + if self.options.show_info is True: self.msg("node " + node.get('id') + ": No dash style to continue with.") return False if self.options.skip_errors is True else exit(1) if self.options.creationtype == "custom_dashpattern": @@ -180,7 +179,7 @@ class LinksCreator(inkex.EffectExtension): else: raise ValueError except: - if self.options.show_info is True: inkex.errormsg("node " + node.get('id') + ": Error in custom dasharray string (might be empty or does not contain any numbers).") + if self.options.show_info is True: self.msg("node " + node.get('id') + ": Error in custom dasharray string (might be empty or does not contain any numbers).") return False if self.options.skip_errors is True else exit(1) #assign stroke dasharray from entered values, existing style or custom dashpattern @@ -234,20 +233,20 @@ class LinksCreator(inkex.EffectExtension): # Print some info about values if self.options.show_info is True: - inkex.errormsg("node " + node.get('id') + ":") + self.msg("node " + node.get('id') + ":") if self.options.creationunit == "percent": - inkex.errormsg(" * total path length = {:1.3f} {}".format(stotal, self.svg.unit)) #show length, converted in selected unit - inkex.errormsg(" * (calculated) offset: {:1.3f} %".format(stroke_dashoffset)) + self.msg(" * total path length = {:1.3f} {}".format(stotal, self.svg.unit)) #show length, converted in selected unit + self.msg(" * (calculated) offset: {:1.3f} %".format(stroke_dashoffset)) if self.options.creationtype == "entered_values": - inkex.errormsg(" * (calculated) gap length: {:1.3f} %".format(length_link)) + self.msg(" * (calculated) gap length: {:1.3f} %".format(length_link)) else: - inkex.errormsg(" * total path length = {:1.3f} {} ({:1.3f} {})".format(self.svg.uutounit(stotal, self.options.creationunit), self.options.creationunit, stotal, self.svg.unit)) #show length, converted in selected unit - inkex.errormsg(" * (calculated) offset: {:1.3f} {}".format(self.svg.uutounit(stroke_dashoffset, self.options.creationunit), self.options.creationunit)) + self.msg(" * total path length = {:1.3f} {} ({:1.3f} {})".format(self.svg.uutounit(stotal, self.options.creationunit), self.options.creationunit, stotal, self.svg.unit)) #show length, converted in selected unit + self.msg(" * (calculated) offset: {:1.3f} {}".format(self.svg.uutounit(stroke_dashoffset, self.options.creationunit), self.options.creationunit)) if self.options.creationtype == "entered_values": - inkex.errormsg(" * (calculated) gap length: {:1.3f} {}".format(length_link, self.options.creationunit)) + self.msg(" * (calculated) gap length: {:1.3f} {}".format(length_link, self.options.creationunit)) if self.options.creationtype == "entered_values": - inkex.errormsg(" * total gaps = {}".format(self.options.link_count)) - inkex.errormsg(" * (calculated) dash/gap pattern: {} ({})".format(stroke_dasharray, self.svg.unit)) + self.msg(" * total gaps = {}".format(self.options.link_count)) + self.msg(" * (calculated) dash/gap pattern: {} ({})".format(stroke_dasharray, self.svg.unit)) # Conversion step (split cosmetic path into real segments) if self.options.no_convert is False: @@ -293,7 +292,7 @@ class LinksCreator(inkex.EffectExtension): breakApartGroup = nodeParent.add(inkex.Group()) for breakOutputNode in breakOutputNodes: breakApartGroup.append(breakOutputNode) - #inkex.errormsg(replacedNode.get('id')) + #self.msg(replacedNode.get('id')) #self.svg.selection.set(replacedNode.get('id')) #update selection to split paths segments (does not work, so commented out) if len(self.svg.selected) > 0: @@ -303,7 +302,7 @@ class LinksCreator(inkex.EffectExtension): for breakInputNode in breakInputNodes: createLinks(breakInputNode) else: - inkex.errormsg('Please select some paths first.') + self.msg('Please select some paths first.') return if __name__ == '__main__': diff --git a/extensions/fablabchemnitz/dxf2papercraft/dxf2papercraft.inx b/extensions/fablabchemnitz/dxf2papercraft/dxf2papercraft.inx index e94c5fca..492882d0 100644 --- a/extensions/fablabchemnitz/dxf2papercraft/dxf2papercraft.inx +++ b/extensions/fablabchemnitz/dxf2papercraft/dxf2papercraft.inx @@ -39,7 +39,7 @@ - + @@ -53,9 +53,8 @@ - + - diff --git a/extensions/fablabchemnitz/dxfdwgimporter/dxfdwgimporter.inx b/extensions/fablabchemnitz/dxfdwgimporter/dxfdwgimporter.inx index de13d4ef..947fef9d 100644 --- a/extensions/fablabchemnitz/dxfdwgimporter/dxfdwgimporter.inx +++ b/extensions/fablabchemnitz/dxfdwgimporter/dxfdwgimporter.inx @@ -1,10 +1,9 @@ DXF/DWG Importer - fablabchemnitz.de.dxfdwgimporter_configure - + fablabchemnitz.de.dxfdwgimporter - + @@ -25,15 +24,8 @@ C:\Users\ true - - - - - - - - + C:\Program Files\ODA\ODAFileConverter_title 21.6.0\ODAFileConverter.exe true @@ -75,7 +67,7 @@ false true - + true @@ -155,7 +147,40 @@ 0.100 false false - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg diff --git a/extensions/fablabchemnitz/imagetracer.js/imagetracerjs.inx b/extensions/fablabchemnitz/imagetracer.js/imagetracerjs.inx index dfe62adb..413c1dd8 100644 --- a/extensions/fablabchemnitz/imagetracer.js/imagetracerjs.inx +++ b/extensions/fablabchemnitz/imagetracer.js/imagetracerjs.inx @@ -2,57 +2,83 @@ Imagetracer.js fablabchemnitz.de.imagetracerjs - - - - - false - 1.0 - 1.0 - 8 - true + + + + + + + false + 1.0 + 1.0 + 8 + true + + + + + + + + + 16 + 0 + 3 + + + + + + + + + + + + 1.0 + false + + 1 + false + false + + + + 0 + 20.0 + + + + + + + - - - - - - - - 16 - 0 - 3 - - - - - - - - - - - - 1.0 - false - - 1 - false - false + + - - - 0 - 20.0 - - - - - - - - - + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg + + image diff --git a/extensions/fablabchemnitz/imagetracer.js/imagetracerjs.py b/extensions/fablabchemnitz/imagetracer.js/imagetracerjs.py index 8e57bcdd..4a0c840a 100644 --- a/extensions/fablabchemnitz/imagetracer.js/imagetracerjs.py +++ b/extensions/fablabchemnitz/imagetracer.js/imagetracerjs.py @@ -49,7 +49,7 @@ class Imagetracerjs (inkex.EffectExtension): return path def add_arguments(self, pars): - pars.add_argument("--tabs") + pars.add_argument("--tab") pars.add_argument("--keeporiginal", type=inkex.Boolean, default=False, help="Keep original image on canvas") pars.add_argument("--ltres", type=float, default=1.0, help="Error treshold straight lines") pars.add_argument("--qtres", type=float, default=1.0, help="Error treshold quadratic splines") diff --git a/extensions/fablabchemnitz/inventory_sticker.inx b/extensions/fablabchemnitz/inventory_sticker.inx index 701d74de..6bfe4b7d 100644 --- a/extensions/fablabchemnitz/inventory_sticker.inx +++ b/extensions/fablabchemnitz/inventory_sticker.inx @@ -2,8 +2,8 @@ Inventory Sticker fablabchemnitz.de.inventory_sticker - - + + https://the.domain.de/items.csv User @@ -21,16 +21,31 @@ 04f9:2044 false - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + 000_about_fablabchemnitz.svg diff --git a/extensions/fablabchemnitz/inventory_sticker.py b/extensions/fablabchemnitz/inventory_sticker.py index db1fb62f..474289a6 100644 --- a/extensions/fablabchemnitz/inventory_sticker.py +++ b/extensions/fablabchemnitz/inventory_sticker.py @@ -358,7 +358,7 @@ def splitAt(string, length): class InventorySticker(inkex.Effect): def add_arguments(self, pars): - pars.add_argument("--main_tabs") + pars.add_argument("--tab") pars.add_argument("--server_address", default="https://the.domain.de/items.csv") pars.add_argument("--htuser", default="user") pars.add_argument("--htpassword", default="password") diff --git a/extensions/fablabchemnitz/migrategroups.inx b/extensions/fablabchemnitz/migrategroups.inx index 828934cb..aa9a28fc 100644 --- a/extensions/fablabchemnitz/migrategroups.inx +++ b/extensions/fablabchemnitz/migrategroups.inx @@ -2,79 +2,104 @@ Ungrouper And Element Migrator/Filter fablabchemnitz.de.migrategroups - - - - - - - - true - true - true - true - true - true - true - - - - - true - true - true - true - true - - - - - true - true - true - true - true - true - - - - - - - - - true - true - true - true - true - true - - - - true - true - true - true - true - - - - - - - - - + + + + + + + true + true + true + true + true + true + true + + + + + true + true + true + true + true + + + + + true + true + true + true + true + true + + + + + + + + + true + true + true + true + true + true + + + + true + true + true + true + true + + + + + + + + + + + true + false + false + false + true + + + + + + + + + + + + + + + + + + + + + + + + + + + 000_about_fablabchemnitz.svg + - true - false - false - true - - - - path diff --git a/extensions/fablabchemnitz/migrategroups.py b/extensions/fablabchemnitz/migrategroups.py index 24ce7aab..6caee6f6 100644 --- a/extensions/fablabchemnitz/migrategroups.py +++ b/extensions/fablabchemnitz/migrategroups.py @@ -16,52 +16,53 @@ import inkex import os from lxml import etree -class MigrateGroups(inkex.Effect): +class MigrateGroups(inkex.EffectExtension): allElements = [] #list of all (sub)elements to process within selection allGroups = [] #list of all groups (svg:g and svg:svg items) to delete for cleanup (for ungrouping) allDrops = [] #list of all other elements except svg:g and svg:svg to drop while migrating (for filtering) - def __init__(self): - inkex.Effect.__init__(self) - self.arg_parser.add_argument("--ignorecustomselection", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--operationmode", default=False) - self.arg_parser.add_argument("--parsechildren", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--cleanup", type=inkex.Boolean, default = True, help = "Decimal tolerance") - self.arg_parser.add_argument("--showdroplist", type=inkex.Boolean, default=False) - self.arg_parser.add_argument("--shownewgroupname", type=inkex.Boolean, default=False) + def add_arguments(self, pars): + pars.add_argument("--tab") - #self.arg_parser.add_argument("--sodipodi", type=inkex.Boolean, default=True) - #self.arg_parser.add_argument("--svg", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--circle", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--clipPath", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--defs", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--ellipse", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--image", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--line", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--path", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--polyline", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--polygon", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--rect", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--text", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--tspan", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--linearGradient", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--radialGradient", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--mask", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--meshGradient", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--meshRow", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--meshPatch", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--metadata", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--script", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--symbol", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--stop", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--switch", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--use", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--flowRoot", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--flowRegion", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--flowPara", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--marker", type=inkex.Boolean, default=True) - self.arg_parser.add_argument("--pattern", type=inkex.Boolean, default=True) + pars.add_argument("--operationmode", default=False, help="Operation mode") + pars.add_argument("--parsechildren", type=inkex.Boolean, default=True, help="Perform operations on children of selection") + pars.add_argument("--showdroplist", type=inkex.Boolean, default=False, help="Show list of dropped items") + pars.add_argument("--shownewgroupname", type=inkex.Boolean, default=False, help="This helps to better identify the generated output.") + pars.add_argument("--apply_transformations", type=inkex.Boolean, default=False, help="Run 'Apply Transformations' extension before running vpype. Helps avoiding geometry shifting") + pars.add_argument("--cleanup", type=inkex.Boolean, default = True, help = "This will call the extension 'Remove Empty Groups' if available") + + #pars.add_argument("--sodipodi", type=inkex.Boolean, default=True) + #pars.add_argument("--svg", type=inkex.Boolean, default=True) + pars.add_argument("--circle", type=inkex.Boolean, default=True) + pars.add_argument("--clipPath", type=inkex.Boolean, default=True) + pars.add_argument("--defs", type=inkex.Boolean, default=True) + pars.add_argument("--ellipse", type=inkex.Boolean, default=True) + pars.add_argument("--image", type=inkex.Boolean, default=True) + pars.add_argument("--line", type=inkex.Boolean, default=True) + pars.add_argument("--path", type=inkex.Boolean, default=True) + pars.add_argument("--polyline", type=inkex.Boolean, default=True) + pars.add_argument("--polygon", type=inkex.Boolean, default=True) + pars.add_argument("--rect", type=inkex.Boolean, default=True) + pars.add_argument("--text", type=inkex.Boolean, default=True) + pars.add_argument("--tspan", type=inkex.Boolean, default=True) + pars.add_argument("--linearGradient", type=inkex.Boolean, default=True) + pars.add_argument("--radialGradient", type=inkex.Boolean, default=True) + pars.add_argument("--mask", type=inkex.Boolean, default=True) + pars.add_argument("--meshGradient", type=inkex.Boolean, default=True) + pars.add_argument("--meshRow", type=inkex.Boolean, default=True) + pars.add_argument("--meshPatch", type=inkex.Boolean, default=True) + pars.add_argument("--metadata", type=inkex.Boolean, default=True) + pars.add_argument("--script", type=inkex.Boolean, default=True) + pars.add_argument("--symbol", type=inkex.Boolean, default=True) + pars.add_argument("--stop", type=inkex.Boolean, default=True) + pars.add_argument("--switch", type=inkex.Boolean, default=True) + pars.add_argument("--use", type=inkex.Boolean, default=True) + pars.add_argument("--flowRoot", type=inkex.Boolean, default=True) + pars.add_argument("--flowRegion", type=inkex.Boolean, default=True) + pars.add_argument("--flowPara", type=inkex.Boolean, default=True) + pars.add_argument("--marker", type=inkex.Boolean, default=True) + pars.add_argument("--pattern", type=inkex.Boolean, default=True) def effect(self): @@ -97,7 +98,7 @@ class MigrateGroups(inkex.Effect): namespace.append("{http://www.w3.org/2000/svg}flowPara") if self.options.flowPara else "" namespace.append("{http://www.w3.org/2000/svg}marker") if self.options.marker else "" namespace.append("{http://www.w3.org/2000/svg}pattern") if self.options.pattern else "" - #inkex.utils.debug(namespace) + #self.msg(namespace) #in case the user made a manual selection instead of whole document parsing, we need to collect all required elements first def parseChildren(element): @@ -120,12 +121,12 @@ class MigrateGroups(inkex.Effect): self.allElements.append(element) #if we dont want to ungroup but filter out elements, or ungroup and filter, we need to divide the elements with respect to the namespace (user selection) elif self.options.operationmode == "filter_only" or self.options.operationmode == "ungroup_and_filter": - #inkex.utils.debug(element.tag) + #self.msg(element.tag) if element.tag in namespace: #if the element is in namespace and no group type we will regroup the item. so we will not remove it if element not in self.allElements: self.allElements.append(element) else: #we add all remaining items (except svg:g and svg:svg) into the list for deletion - #inkex.utils.debug(element.tag) + #self.msg(element.tag) if element.tag != inkex.addNS('g','svg') and element.tag != inkex.addNS('svg','svg') and element.tag != inkex.addNS('namedview','sodipodi'): if element not in self.allDrops: self.allDrops.append(element) @@ -135,14 +136,26 @@ class MigrateGroups(inkex.Effect): if element not in self.allGroups: self.allGroups.append(element) + applyTransformAvailable = False # at first we apply external extension + try: + import applytransform + applyTransformAvailable = True + except Exception as e: + # self.msg(e) + self.msg("Calling 'Apply Transformations' extension failed. Maybe the extension is not installed. You can download it from official InkScape Gallery. Skipping ...") + + if self.options.apply_transformations is True and applyTransformAvailable is True: + applytransform.ApplyTransform().recursiveFuseTransform(self.document.getroot()) + #check if we have selected elements or if we should parse the whole document instead selected = [] #total list of elements to parse if len(self.svg.selected) == 0: for element in self.document.getroot().iter(tag=etree.Element): if element != self.document.getroot(): + selected.append(element) else: - for id, element in self.svg.selected.items(): + for element in self.svg.selected.values(): parseChildren(element) #get all elements from the selection. @@ -151,17 +164,17 @@ class MigrateGroups(inkex.Effect): #some debugging block #check output - #inkex.utils.debug("--- Selected items (with or without children) ---") - #inkex.utils.debug(selected) - #inkex.utils.debug("--- All elements (except groups)---") - #inkex.utils.debug(len(self.allElements)) - #inkex.utils.debug(self.allElements) - #inkex.utils.debug("--- All groups ---") - #inkex.utils.debug(len(self.allGroups)) - #inkex.utils.debug(self.allGroups) - #inkex.utils.debug("--- All dropouts ---") - #inkex.utils.debug(len(self.allDrops)) - #inkex.utils.debug(self.allDrops) + #self.msg("--- Selected items (with or without children) ---") + #self.msg(selected) + #self.msg("--- All elements (except groups)---") + #self.msg(len(self.allElements)) + #self.msg(self.allElements) + #self.msg("--- All groups ---") + #self.msg(len(self.allGroups)) + #self.msg(self.allGroups) + #self.msg("--- All dropouts ---") + #self.msg(len(self.allDrops)) + #self.msg(self.allDrops) migrate_log = "migrategroups.log" @@ -171,12 +184,12 @@ class MigrateGroups(inkex.Effect): try: os.remove(migrate_log) except OSError as e: - inkex.utils.debug("Error while deleting previously generated log file " + migrate_log) + self.msg("Error while deleting previously generated log file " + migrate_log) # show a list with items to delete. For ungroup mode it does not apply because we are not going to remove anything if self.options.operationmode == "filter_only" or self.options.operationmode == "ungroup_and_filter": if self.options.showdroplist: - inkex.utils.debug(str(len(self.allDrops)) + " elements were removed during nodes while migration:") + self.msg(str(len(self.allDrops)) + " elements were removed during nodes while migration.") if len(self.allDrops) > 100: #if we print too much to the output stream we will freeze InkScape forever wihtout any visual error message. So we write to file instead migrate_log_file = open('migrategroups.log', 'w') else: @@ -185,12 +198,12 @@ class MigrateGroups(inkex.Effect): if i.get('id') is not None: migrateString = i.tag.replace("{http://www.w3.org/2000/svg}","svg:") + " id:" + i.get('id') if migrate_log_file is None: - inkex.utils.debug(migrateString) + self.msg(migrateString) else: migrate_log_file.write(migrateString + "\n") if migrate_log_file is not None: migrate_log_file.close() - inkex.utils.debug("Detailed output was dumped into file " + os.path.join(os.getcwd(), migrate_log)) + self.msg("Detailed output was dumped into file " + os.path.join(os.getcwd(), migrate_log)) # remove all groups from the selection and form a new single group of it by copying with old IDs. if self.options.operationmode == "ungroup_only" or self.options.operationmode == "ungroup_and_filter": @@ -198,7 +211,7 @@ class MigrateGroups(inkex.Effect): newGroup = self.document.getroot().add(inkex.Group()) #make a new group at root level newGroup.set('id', self.svg.get_unique_id('migrate-')) #generate some known ID with the prefix 'migrate-' if self.options.shownewgroupname == True: - inkex.utils.debug("The migrated elements are now in group with ID " + str(newGroup.get('id'))) + self.msg("The migrated elements are now in group with ID " + str(newGroup.get('id'))) index = 0 for element in self.allElements: #we have a list of elements which does not cotain any other elements like svg:g or svg:svg newGroup.insert(index, element) #we do not copy any elements. we just rearrange them by moving to another place (group index) @@ -224,7 +237,7 @@ class MigrateGroups(inkex.Effect): import cleangroups cleangroups.CleanGroups.effect(self) except: - inkex.utils.debug("Calling 'Remove Empty Groups' extension failed. Maybe the extension is not installed. You can download it from official InkScape Gallery.") + self.msg("Calling 'Remove Empty Groups' extension failed. Maybe the extension is not installed. You can download it from official InkScape Gallery.") if __name__ == '__main__': MigrateGroups().run() \ No newline at end of file diff --git a/extensions/fablabchemnitz/papercraft_unfold/papercraft_unfold.inx b/extensions/fablabchemnitz/papercraft_unfold/papercraft_unfold.inx index bebcea00..4e056773 100644 --- a/extensions/fablabchemnitz/papercraft_unfold/papercraft_unfold.inx +++ b/extensions/fablabchemnitz/papercraft_unfold/papercraft_unfold.inx @@ -3,9 +3,8 @@ Papercraft Unfold fablabchemnitz.de.papercraft_unfold - - /your/beautiful/3dmodel/file + + /your/beautiful/3dmodel/file true true 0.0 @@ -18,7 +17,7 @@ true - + true true 0.0 @@ -35,11 +34,36 @@ false 1.0 - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg @@ -53,4 +77,4 @@ - + \ No newline at end of file diff --git a/extensions/fablabchemnitz/papercraft_unfold/papercraft_unfold.py b/extensions/fablabchemnitz/papercraft_unfold/papercraft_unfold.py index 537c62fc..30341711 100644 --- a/extensions/fablabchemnitz/papercraft_unfold/papercraft_unfold.py +++ b/extensions/fablabchemnitz/papercraft_unfold/papercraft_unfold.py @@ -72,9 +72,8 @@ admesh is sensible for moving from one dir to another ################################################################# Module licenses - papercraft - 26307b8 (https://github.com/osresearch/papercraft) - GPL v2 License -- model-converter - commit a8d809a (https://github.com/tforgione/model-converter-python) - MIT License - admesh - 0.98.3 (https://github.com/admesh/admesh) - GPL License - +- fstl - (https://github.com/fstl-app/fstl) - MIT License """ class Unfold(inkex.EffectExtension): diff --git a/extensions/fablabchemnitz/paperfold.inx b/extensions/fablabchemnitz/paperfold.inx index 908643cb..e6e6e8fe 100644 --- a/extensions/fablabchemnitz/paperfold.inx +++ b/extensions/fablabchemnitz/paperfold.inx @@ -2,28 +2,55 @@ Paperfold fablabchemnitz.de.paperfold - /your/beautiful/3dmodel/file - true - 1.0 - true - 0.0 - - - - - - + + + /your/beautiful/3dmodel/file + true + 1.0 + true + 0.0 + + + + + + + + 255 + 1968208895 + 3422552319 + 879076607 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 000_about_fablabchemnitz.svg + - 255 - 1968208895 - 3422552319 - 879076607 - - - - - - all diff --git a/extensions/fablabchemnitz/paperfold.py b/extensions/fablabchemnitz/paperfold.py index fa824fb3..b5f6b443 100644 --- a/extensions/fablabchemnitz/paperfold.py +++ b/extensions/fablabchemnitz/paperfold.py @@ -519,6 +519,7 @@ def writeSVG(self, unfolding, size, printNumbers): class Unfold(inkex.EffectExtension): def add_arguments(self, pars): + pars.add_argument("--tab") pars.add_argument("--inputfile") pars.add_argument("--printNumbers", type=inkex.Boolean, default=False, help="Print numbers on the cut edges") pars.add_argument("--scalefactor", type=float, default=1.0, help="Manual scale factor") diff --git a/extensions/fablabchemnitz/primitive/primitive.inx b/extensions/fablabchemnitz/primitive/primitive.inx index 7db6a028..47dbea69 100644 --- a/extensions/fablabchemnitz/primitive/primitive.inx +++ b/extensions/fablabchemnitz/primitive/primitive.inx @@ -2,36 +2,62 @@ Primitive (Michael Fogleman) fablabchemnitz.de.primitive - - - false - true - 100 - - - - - - - - - - + + + + + false + true + 100 + + + + + + + + + + + + 0 + 256 + 1024 + 128 + true + 255 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg + - 0 - 256 - 1024 - 128 - true - 255 - 0 - - - - - - - image diff --git a/extensions/fablabchemnitz/primitive/primitive.py b/extensions/fablabchemnitz/primitive/primitive.py index 68ddf716..ab3c21bb 100644 --- a/extensions/fablabchemnitz/primitive/primitive.py +++ b/extensions/fablabchemnitz/primitive/primitive.py @@ -56,6 +56,7 @@ class Primitive (inkex.EffectExtension): return path def add_arguments(self, pars): + pars.add_argument("--tab") pars.add_argument("--keeporiginal", type=inkex.Boolean, default=False, help="Keep original image on canvas") pars.add_argument("--cliprect", type=inkex.Boolean, default=True, help="Draw clipping rectangle") pars.add_argument("--n", type=int, default=100, help="Number of shapes") diff --git a/extensions/fablabchemnitz/styles_to_layers.inx b/extensions/fablabchemnitz/styles_to_layers.inx index 37575fcf..405f6c79 100644 --- a/extensions/fablabchemnitz/styles_to_layers.inx +++ b/extensions/fablabchemnitz/styles_to_layers.inx @@ -2,31 +2,56 @@ Styles To Layers fablabchemnitz.de.styles_to_layers - - - - - - - + + + + + + + + + + + + + + + + + 1 + 1 + false + true + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + 000_about_fablabchemnitz.svg + - - - - - - - 1 - 1 - false - true - false - false - - - - - all @@ -38,4 +63,4 @@ - + \ No newline at end of file diff --git a/extensions/fablabchemnitz/styles_to_layers.py b/extensions/fablabchemnitz/styles_to_layers.py index 0babf074..0f1d7126 100644 --- a/extensions/fablabchemnitz/styles_to_layers.py +++ b/extensions/fablabchemnitz/styles_to_layers.py @@ -40,6 +40,7 @@ class StylesToLayers(inkex.EffectExtension): return layer def add_arguments(self, pars): + pars.add_argument("--tab") pars.add_argument("--apply_transformations", type=inkex.Boolean, default=False, help="Run 'Apply Transformations' extension before running vpype. Helps avoiding geometry shifting") pars.add_argument("--separateby", default = "stroke", help = "Separate by") pars.add_argument("--parsecolors",default = "hexval", help = "Sort colors by") diff --git a/extensions/fablabchemnitz/vpypetools/vpypetools_filter.inx b/extensions/fablabchemnitz/vpypetools/vpypetools_filter.inx index fe86d0f3..98280d59 100644 --- a/extensions/fablabchemnitz/vpypetools/vpypetools_filter.inx +++ b/extensions/fablabchemnitz/vpypetools/vpypetools_filter.inx @@ -3,7 +3,7 @@ Filter fablabchemnitz.de.vpype_filter - + true 0.050 @@ -14,7 +14,7 @@ false 0.000 - + false @@ -42,15 +42,34 @@ 1.000 1.000 - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg + diff --git a/extensions/fablabchemnitz/vpypetools/vpypetools_freemode.inx b/extensions/fablabchemnitz/vpypetools/vpypetools_freemode.inx index 63c82943..d0aa1df0 100644 --- a/extensions/fablabchemnitz/vpypetools/vpypetools_freemode.inx +++ b/extensions/fablabchemnitz/vpypetools/vpypetools_freemode.inx @@ -3,7 +3,7 @@ vpype Free Mode fablabchemnitz.de.vpype_free_mode - + true layout 1024x768 translate 150px 50px @@ -19,7 +19,7 @@ false - + false @@ -47,17 +47,15 @@ 1.000 1.000 - - - + - - + + @@ -68,16 +66,40 @@ - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg + diff --git a/extensions/fablabchemnitz/vpypetools/vpypetools_linemerge.inx b/extensions/fablabchemnitz/vpypetools/vpypetools_linemerge.inx index 7701887d..87f446a1 100644 --- a/extensions/fablabchemnitz/vpypetools/vpypetools_linemerge.inx +++ b/extensions/fablabchemnitz/vpypetools/vpypetools_linemerge.inx @@ -3,13 +3,13 @@ Line Merging (Combine Paths) fablabchemnitz.de.vpype_linemerging - + true 0.500 false - + false @@ -37,15 +37,34 @@ 1.000 1.000 - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg + diff --git a/extensions/fablabchemnitz/vpypetools/vpypetools_linesort.inx b/extensions/fablabchemnitz/vpypetools/vpypetools_linesort.inx index a6a262ac..a2169279 100644 --- a/extensions/fablabchemnitz/vpypetools/vpypetools_linesort.inx +++ b/extensions/fablabchemnitz/vpypetools/vpypetools_linesort.inx @@ -3,12 +3,12 @@ Line Sorting fablabchemnitz.de.vpype_linesorting - + true false - + false @@ -36,15 +36,34 @@ 1.000 1.000 - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg + diff --git a/extensions/fablabchemnitz/vpypetools/vpypetools_multipass.inx b/extensions/fablabchemnitz/vpypetools/vpypetools_multipass.inx index 5306c5e6..f5dcdbc0 100644 --- a/extensions/fablabchemnitz/vpypetools/vpypetools_multipass.inx +++ b/extensions/fablabchemnitz/vpypetools/vpypetools_multipass.inx @@ -3,12 +3,12 @@ Multipass fablabchemnitz.de.vpype_multipass - + true 2 - + false @@ -36,15 +36,34 @@ 1.000 1.000 - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg + diff --git a/extensions/fablabchemnitz/vpypetools/vpypetools_occult.inx b/extensions/fablabchemnitz/vpypetools/vpypetools_occult.inx index d4c2bd8a..67939e0c 100644 --- a/extensions/fablabchemnitz/vpypetools/vpypetools_occult.inx +++ b/extensions/fablabchemnitz/vpypetools/vpypetools_occult.inx @@ -3,13 +3,13 @@ Occult Plugin (HLR) fablabchemnitz.de.vpype_plugin_occult - + true 0.01 false - + false @@ -37,15 +37,34 @@ 1.000 1.000 - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg + diff --git a/extensions/fablabchemnitz/vpypetools/vpypetools_relooping.inx b/extensions/fablabchemnitz/vpypetools/vpypetools_relooping.inx index ddd001bf..63c7c572 100644 --- a/extensions/fablabchemnitz/vpypetools/vpypetools_relooping.inx +++ b/extensions/fablabchemnitz/vpypetools/vpypetools_relooping.inx @@ -3,12 +3,12 @@ Relooping fablabchemnitz.de.vpype_relooping - + true 0.500 - + false @@ -36,15 +36,34 @@ 1.000 1.000 - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg + diff --git a/extensions/fablabchemnitz/vpypetools/vpypetools_splitall.inx b/extensions/fablabchemnitz/vpypetools/vpypetools_splitall.inx index 98fcd8cf..38ab0f42 100644 --- a/extensions/fablabchemnitz/vpypetools/vpypetools_splitall.inx +++ b/extensions/fablabchemnitz/vpypetools/vpypetools_splitall.inx @@ -3,11 +3,11 @@ Split All (Break Paths) fablabchemnitz.de.vpype_splitall - + true - + false @@ -35,15 +35,34 @@ 1.000 1.000 - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg + diff --git a/extensions/fablabchemnitz/vpypetools/vpypetools_trim.inx b/extensions/fablabchemnitz/vpypetools/vpypetools_trim.inx index a3fbc138..3213a060 100644 --- a/extensions/fablabchemnitz/vpypetools/vpypetools_trim.inx +++ b/extensions/fablabchemnitz/vpypetools/vpypetools_trim.inx @@ -3,13 +3,13 @@ Trimming fablabchemnitz.de.vpype_trimming - + true 0.000 0.000 - + false @@ -37,15 +37,34 @@ 1.000 1.000 - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + ../000_about_fablabchemnitz.svg +