From 423fafd352342e4fbf2cb38630c7b424bdcf2ea1 Mon Sep 17 00:00:00 2001 From: leyghisbb Date: Sun, 30 Aug 2020 11:50:15 +0200 Subject: [PATCH] Removed deprecations from twist extension --- extensions/fablabchemnitz_eggbot_twist.inx | 51 +++++++--------------- extensions/fablabchemnitz_eggbot_twist.py | 15 ++++--- 2 files changed, 24 insertions(+), 42 deletions(-) diff --git a/extensions/fablabchemnitz_eggbot_twist.inx b/extensions/fablabchemnitz_eggbot_twist.inx index e7c29a5e..ca13c5ff 100644 --- a/extensions/fablabchemnitz_eggbot_twist.inx +++ b/extensions/fablabchemnitz_eggbot_twist.inx @@ -1,38 +1,19 @@ - Twist - fablabchemnitz.de.twist - -Iteratively twist and self-inscribe -a polygon within itself. - -The number of twists is how many -iterations to perform. - -The step ratio is the fractional -distance along an edge to move each -vertex. - -*** -This extension is intended as an -example of how to write an Inkscape -extension for use with the Eggbot. -See the eggbot_twist.py file in the -Inkscape extensions directory for -this extensions' Python code. -*** - - 8 - 0.15 - - all - - - - - - - + Twist + fablabchemnitz.de.twist + + 8 + 0.15 + + all + + + + + + + \ No newline at end of file diff --git a/extensions/fablabchemnitz_eggbot_twist.py b/extensions/fablabchemnitz_eggbot_twist.py index c38fe006..63f028f2 100644 --- a/extensions/fablabchemnitz_eggbot_twist.py +++ b/extensions/fablabchemnitz_eggbot_twist.py @@ -284,11 +284,11 @@ class Twist(inkex.Effect): w = float(node.get('width', '0')) h = float(node.get('height', '0')) a = [] - a.append(['M ', [x, y]]) - a.append([' l ', [w, 0]]) - a.append([' l ', [0, h]]) - a.append([' l ', [-w, 0]]) - a.append([' Z', []]) + a.append(['M', [x, y]]) + a.append(['l', [w, 0]]) + a.append(['l', [0, h]]) + a.append(['l', [-w, 0]]) + a.append(['Z', []]) self.addPathVertices(Path(a), node, mat_new, clone_transform) elif node.tag in [inkex.addNS('line', 'svg'), 'line']: @@ -504,7 +504,8 @@ class Twist(inkex.Effect): if self.options.ids: # Traverse the selected objects for id_ in self.options.ids: - self.recursivelyTraverseSvg([self.svg.selected[id_]]) +# self.recursivelyTraverseSvg([self.svg.selected[id_]]) + self.recursivelyTraverseSvg([self.svg.getElementById(id_)]) else: # Traverse the entire document self.recursivelyTraverseSvg(self.document.getroot()) @@ -516,4 +517,4 @@ class Twist(inkex.Effect): if __name__ == '__main__': - Twist().run() \ No newline at end of file + Twist().run()