summaryrefslogtreecommitdiffstats
path: root/share/extensions
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2008-10-11 15:16:23 +0000
committerTed Gould <ted@canonical.com>2008-10-11 15:16:23 +0000
commit2f5eb047d9e05be5e68549ef6b75070d2faa7d2f (patch)
treeca2e94164b6d7aaebfc17196ca46bfc825a7665a /share/extensions
parentMerge from trunk. (diff)
downloadinkscape-2f5eb047d9e05be5e68549ef6b75070d2faa7d2f.tar.gz
inkscape-2f5eb047d9e05be5e68549ef6b75070d2faa7d2f.zip
Merging from trunk
(bzr r6884)
Diffstat (limited to 'share/extensions')
-rwxr-xr-xshare/extensions/dxf_outlines.py31
-rw-r--r--share/extensions/hpgl_output.py25
2 files changed, 29 insertions, 27 deletions
diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py
index bd7e91822..5826be693 100755
--- a/share/extensions/dxf_outlines.py
+++ b/share/extensions/dxf_outlines.py
@@ -134,21 +134,22 @@ class MyEffect(inkex.Effect):
for node in self.document.getroot().xpath(path, namespaces=inkex.NSS):
d = node.get('d')
sim = simplepath.parsePath(d)
- simplepath.scalePath(sim,scale,-scale)
- simplepath.translatePath(sim,0,h*scale)
- p = cubicsuperpath.CubicSuperPath(sim)
- for sub in p:
- for i in range(len(sub)-1):
- # generate unique handle for DXF ENTITY
- self.handle += 1
- s = sub[i]
- e = sub[i+1]
- if s[1] == s[2] and e[0] == e[1]:
- self.dxf_line([s[1],e[1]])
- elif (self.options.ROBO == 'true'):
- self.ROBO_spline([s[1],s[2],e[0],e[1]])
- else:
- self.dxf_spline([s[1],s[2],e[0],e[1]])
+ if len(sim):
+ simplepath.scalePath(sim,scale,-scale)
+ simplepath.translatePath(sim,0,h*scale)
+ p = cubicsuperpath.CubicSuperPath(sim)
+ for sub in p:
+ for i in range(len(sub)-1):
+ # generate unique handle for DXF ENTITY
+ self.handle += 1
+ s = sub[i]
+ e = sub[i+1]
+ if s[1] == s[2] and e[0] == e[1]:
+ self.dxf_line([s[1],e[1]])
+ elif (self.options.ROBO == 'true'):
+ self.ROBO_spline([s[1],s[2],e[0],e[1]])
+ else:
+ self.dxf_spline([s[1],s[2],e[0],e[1]])
if self.options.ROBO == 'true':
self.handle += 1
self.ROBO_output()
diff --git a/share/extensions/hpgl_output.py b/share/extensions/hpgl_output.py
index f94456a0c..f327df2f9 100644
--- a/share/extensions/hpgl_output.py
+++ b/share/extensions/hpgl_output.py
@@ -29,19 +29,20 @@ class MyEffect(inkex.Effect):
def output(self):
print ''.join(self.hpgl)
def effect(self):
- path = '//svg:path'
+ path = '//svg:path'
for node in self.document.getroot().xpath(path, namespaces=inkex.NSS):
d = node.get('d')
- p = cubicsuperpath.parsePath(d)
- cspsubdiv.cspsubdiv(p, self.options.flat)
- for sp in p:
- first = True
- for csp in sp:
- cmd = 'PD'
- if first:
- cmd = 'PU'
- first = False
- self.hpgl.append('%s%s,%s;' % (cmd,csp[1][0],csp[1][1]))
+ if len(simplepath.parsePath(d)):
+ p = cubicsuperpath.parsePath(d)
+ cspsubdiv.cspsubdiv(p, self.options.flat)
+ for sp in p:
+ first = True
+ for csp in sp:
+ cmd = 'PD'
+ if first:
+ cmd = 'PU'
+ first = False
+ self.hpgl.append('%s%s,%s;' % (cmd,csp[1][0],csp[1][1]))
e = MyEffect()
-e.affect() \ No newline at end of file
+e.affect()