summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 725a0ba)
raw | patch | inline | side by side (parent: 725a0ba)
author | Alvin Penner <penner@vaxxine.com> | |
Mon, 1 Feb 2010 23:35:34 +0000 (18:35 -0500) | ||
committer | Alvin Penner <penner@vaxxine.com> | |
Mon, 1 Feb 2010 23:35:34 +0000 (18:35 -0500) |
share/extensions/dxf_outlines.inx | patch | blob | history | |
share/extensions/dxf_outlines.py | patch | blob | history |
index 1693850013a1d2783e522d272627a54713b023f0..fe8048a8e5ae870a8a08573332e98df628dd0b8c 100644 (file)
<dependency type="executable" location="extensions">inkex.py</dependency>
<param name="tab" type="notebook">
<page name="options" _gui-text="Options">
- <param name="ROBO" type="boolean" _gui-text="enable ROBO-Master output">false</param>
+ <param name="ROBO" type="boolean" _gui-text="use ROBO-Master type of spline output">false</param>
+ <param name="POLY" type="boolean" _gui-text="use LWPOLYLINE type of line output">true</param>
</page>
<page name="help" _gui-text="Help">
<_param name="inputhelp" type="description" xml:space="preserve">- AutoCAD Release 13 format.
- assume svg drawing is in pixels, at 90 dpi.
- assume dxf drawing is in mm.
-- only LWPOLYLINE and SPLINE elements are supported.
-- ROBO-Master option is a specialized spline readable only by ROBO-Master and AutoDesk viewers, not Inkscape.</_param>
+- only line and spline elements are supported.
+- ROBO-Master spline output is a specialized spline readable only by ROBO-Master and AutoDesk viewers, not Inkscape.
+- LWPOLYLINE output is a multiply-connected polyline, disable it to use a legacy version of the LINE output.</_param>
</page>
</param>
<output>
index ecdc6ce40f481495f14d807c9107f18193585ca6..295fc74662201eabc3af856170a5cf0890837d7e 100755 (executable)
- ROBO-Master output option added Aug 2008
- ROBO-Master multispline output added Sept 2008
- LWPOLYLINE output modification added Dec 2008
+- toggle between LINE/LWPOLYLINE added Jan 2010
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
def __init__(self):
inkex.Effect.__init__(self)
self.OptionParser.add_option("-R", "--ROBO", action="store", type="string", dest="ROBO")
+ self.OptionParser.add_option("-P", "--POLY", action="store", type="string", dest="POLY")
self.OptionParser.add_option("--tab", action="store", type="string", dest="tab")
self.OptionParser.add_option("--inputhelp", action="store", type="string", dest="inputhelp")
self.dxf = []
def dxf_add(self, str):
self.dxf.append(str)
def dxf_line(self,csp):
+ self.handle += 1
+ self.dxf_add(" 0\nLINE\n 5\n%x\n100\nAcDbEntity\n 8\n0\n 62\n%d\n100\nAcDbLine\n" % (self.handle, self.color))
+ self.dxf_add(" 10\n%f\n 20\n%f\n 30\n0.0\n 11\n%f\n 21\n%f\n 31\n0.0\n" % (csp[0][0],csp[0][1],csp[1][0],csp[1][1]))
+ def LWPOLY_line(self,csp):
if (abs(csp[0][0] - self.poly[-1][0]) > .0001
or abs(csp[0][1] - self.poly[-1][1]) > .0001):
self.LWPOLY_output() # terminate current polyline
s = sub[i]
e = sub[i+1]
if s[1] == s[2] and e[0] == e[1]:
- self.dxf_line([s[1],e[1]])
+ if (self.options.POLY == 'true'):
+ self.LWPOLY_line([s[1],e[1]])
+ else:
+ 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.ROBO_output()
- self.LWPOLY_output()
+ if self.options.POLY == 'true':
+ self.LWPOLY_output()
self.dxf_add(dxf_templates.r14_footer)
if __name__ == '__main__':