diff options
| author | bulia byak <buliabyak@gmail.com> | 2006-11-23 20:45:42 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2006-11-23 20:45:42 +0000 |
| commit | 0e2bfa1c207f7cdb3ea6b089ec57f19827c78b8a (patch) | |
| tree | 54732b6e5b9bee5c50a16dc0886e0d9ff68be4e0 | |
| parent | retire fretboard designer (diff) | |
| download | inkscape-0e2bfa1c207f7cdb3ea6b089ec57f19827c78b8a.tar.gz inkscape-0e2bfa1c207f7cdb3ea6b089ec57f19827c78b8a.zip | |
retire kochify
(bzr r2011)
| -rw-r--r-- | share/extensions/Makefile.am | 4 | ||||
| -rw-r--r-- | share/extensions/kochify.inx | 15 | ||||
| -rwxr-xr-x | share/extensions/kochify.py | 86 | ||||
| -rw-r--r-- | share/extensions/kochify_load.inx | 15 | ||||
| -rwxr-xr-x | share/extensions/kochify_load.py | 60 |
5 files changed, 0 insertions, 180 deletions
diff --git a/share/extensions/Makefile.am b/share/extensions/Makefile.am index 8015d8792..be3e3d118 100644 --- a/share/extensions/Makefile.am +++ b/share/extensions/Makefile.am @@ -26,8 +26,6 @@ extensions = \ handles.py \ inkex.py \ interp.py \ - kochify.py \ - kochify_load.py \ lindenmayer.py \ motion.py \ pturtle.py \ @@ -106,8 +104,6 @@ modules = \ funcplot.inx \ handles.inx \ interp.inx \ - kochify.inx \ - kochify_load.inx \ lindenmayer.inx \ motion.inx \ radiusrand.inx \ diff --git a/share/extensions/kochify.inx b/share/extensions/kochify.inx deleted file mode 100644 index 93572305b..000000000 --- a/share/extensions/kochify.inx +++ /dev/null @@ -1,15 +0,0 @@ -<inkscape-extension> - <_name>Fractal (Koch)</_name> - <id>org.ekips.filter.kochify</id> - <dependency type="executable" location="extensions">kochify.py</dependency> - <dependency type="executable" location="extensions">inkex.py</dependency> - <effect> - <object-type>path</object-type> - <effects-menu> - <submenu _name="Modify Path"/> - </effects-menu> - </effect> - <script> - <command reldir="extensions" interpreter="python">kochify.py</command> - </script> -</inkscape-extension> diff --git a/share/extensions/kochify.py b/share/extensions/kochify.py deleted file mode 100755 index 7f676cb98..000000000 --- a/share/extensions/kochify.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python -''' -Copyright (C) 2005 Aaron Spike, aaron@ekips.org - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -''' -import math, tempfile, copy, cPickle, inkex, simplepath - -def findend(d): - end = [] - subPathStart = [] - for cmd,params in d: - if cmd == 'M': - subPathStart = params[-2:] - if cmd == 'Z': - end = subPathStart[:] - else: - end = params[-2:] - return end - -class Kochify(inkex.Effect): - def effect(self): - try: - f = open(tempfile.gettempdir() + '/kochify.bin', 'r') - proto = cPickle.load(f) - f.close() - except: - return False - for id, node in self.selected.iteritems(): - if node.tagName == 'path': - d = node.attributes.getNamedItem('d') - p = simplepath.parsePath(d.value) - last = p[0][1][-2:] - subPathStart = [] - cur = [] - new = [] - for i in range(len(p)): - rep = copy.deepcopy(proto['path']) - cmd, params = p[i] - if cmd == 'M': - subPathStart = params[-2:] - new.append(copy.deepcopy(p[i])) - continue - if cmd == 'Z': - cur = subPathStart[:] - else: - cur = params[-2:] - - if last == cur: - continue - - dx = cur[0]-last[0] - dy = cur[1]-last[1] - length = math.sqrt((dx**2) + (dy**2)) - angle = math.atan2(dy,dx) - - scale = length / proto['length'] - rotate = angle - proto['angle'] - simplepath.scalePath(rep,scale,scale) - simplepath.rotatePath(rep, rotate) - repend = findend(rep) - transx = cur[0] - repend[0] - transy = cur[1] - repend[1] - simplepath.translatePath(rep, transx, transy) - - if proto['endsinz']: - new.extend(rep[:]) - else: - new.extend(rep[1:]) - last = cur[:] - - d.value = simplepath.formatPath(new) -e = Kochify() -e.affect() diff --git a/share/extensions/kochify_load.inx b/share/extensions/kochify_load.inx deleted file mode 100644 index 035410310..000000000 --- a/share/extensions/kochify_load.inx +++ /dev/null @@ -1,15 +0,0 @@ -<inkscape-extension> - <_name>Fractal (Koch) - Load Pattern</_name> - <id>org.ekips.filter.kochify.load</id> - <dependency type="executable" location="extensions">kochify_load.py</dependency> - <dependency type="executable" location="extensions">inkex.py</dependency> - <effect> - <object-type>path</object-type> - <effects-menu> - <submenu _name="Modify Path"/> - </effects-menu> - </effect> - <script> - <command reldir="extensions" interpreter="python">kochify_load.py</command> - </script> -</inkscape-extension> diff --git a/share/extensions/kochify_load.py b/share/extensions/kochify_load.py deleted file mode 100755 index 9c178e3c4..000000000 --- a/share/extensions/kochify_load.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -''' -Copyright (C) 2005 Aaron Spike, aaron@ekips.org - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -''' -import math, tempfile, cPickle, inkex, simplepath - -def findend(d): - end = [] - subPathStart = [] - for cmd,params in d: - if cmd == 'M': - subPathStart = params[-2:] - if cmd == 'Z': - end = subPathStart[:] - else: - end = params[-2:] - return end - -class LoadKochify(inkex.Effect): - def effect(self): - for id, node in self.selected.iteritems(): - if node.tagName == 'path': - d = simplepath.parsePath(node.attributes.getNamedItem('d').value) - start = d[0][1][-2:] - end = findend(d) - while start == end and len(d): - d = d[:-1] - end = findend(d) - if not end: - break - dx = end[0]-start[0] - dy = end[1]-start[1] - length = math.sqrt((dx**2) + (dy**2)) - angle = math.atan2(dy,dx) - endsinz = False - if d[-1][0]=='Z': - endsinz = True - path = {'start': start, 'end': end, 'endsinz': endsinz, - 'length': length, 'angle': angle, 'path': d} - f = open(tempfile.gettempdir() + '/kochify.bin', 'w') - cPickle.dump(path, f) - f.close() - break - -e = LoadKochify() -e.affect() |
