diff options
| author | Alvin Penner <penner@vaxxine.com> | 2013-01-16 23:56:26 +0000 |
|---|---|---|
| committer | apenner <penner@vaxxine.com> | 2013-01-16 23:56:26 +0000 |
| commit | a31fb308fbd345df21a0ac04f9690ee3dbdfb3bc (patch) | |
| tree | 702c0fa03b48dc70e1fa8df337286aa37706c325 | |
| parent | Fix support for UniConvertor 1.1.4 (see bug #425202) (diff) | |
| download | inkscape-a31fb308fbd345df21a0ac04f9690ee3dbdfb3bc.tar.gz inkscape-a31fb308fbd345df21a0ac04f9690ee3dbdfb3bc.zip | |
extensions. dxf output. set flag if LWPOLYLINE is closed (Bug 1098283)
Fixed bugs:
- https://launchpad.net/bugs/1098283
(bzr r12033)
| -rwxr-xr-x | share/extensions/dxf_outlines.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py index fd01e83e9..57f4e4198 100755 --- a/share/extensions/dxf_outlines.py +++ b/share/extensions/dxf_outlines.py @@ -108,12 +108,13 @@ class MyEffect(inkex.Effect): self.poly = [csp[0]] # initiallize new polyline self.color_LWPOLY = self.color self.layer_LWPOLY = self.layer + self.closed_LWPOLY = self.closed self.poly.append(csp[1]) def LWPOLY_output(self): if len(self.poly) == 1: return self.handle += 1 - self.dxf_add(" 0\nLWPOLYLINE\n 5\n%x\n100\nAcDbEntity\n 8\n%s\n 62\n%d\n100\nAcDbPolyline\n 90\n%d\n 70\n0\n" % (self.handle, self.layer_LWPOLY, self.color_LWPOLY, len(self.poly))) + self.dxf_add(" 0\nLWPOLYLINE\n 5\n%x\n100\nAcDbEntity\n 8\n%s\n 62\n%d\n100\nAcDbPolyline\n 90\n%d\n 70\n%d\n" % (self.handle, self.layer_LWPOLY, self.color_LWPOLY, len(self.poly), self.closed_LWPOLY)) for i in range(len(self.poly)): self.dxf_add(" 10\n%f\n 20\n%f\n 30\n0.0\n" % (self.poly[i][0],self.poly[i][1])) def dxf_spline(self,csp): @@ -189,6 +190,7 @@ class MyEffect(inkex.Effect): if style['stroke'] and style['stroke'] != 'none' and style['stroke'][0:3] != 'url': rgb = simplestyle.parseColor(style['stroke']) hsl = coloreffect.ColorEffect.rgb_to_hsl(coloreffect.ColorEffect(),rgb[0]/255.0,rgb[1]/255.0,rgb[2]/255.0) + self.closed = 0 # only for LWPOLYLINE self.color = 7 # default is black if hsl[2]: self.color = 1 + (int(6*hsl[0] + 0.5) % 6) # use 6 hues @@ -196,8 +198,11 @@ class MyEffect(inkex.Effect): d = node.get('d') if not d: return + if (d[-1] == 'z' or d[-1] == 'Z'): + self.closed = 1 p = cubicsuperpath.parsePath(d) elif node.tag == inkex.addNS('rect','svg'): + self.closed = 1 x = float(node.get('x')) y = float(node.get('y')) width = float(node.get('width')) |
