X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=Cura%2Futil%2FdrawingLoader%2Fdxf.py;h=cce9dc9deb9023f98fe10f2b826c7a69e2e504af;hb=6b10e6d007695d29a1500ab62902461a2bb5f325;hp=3915572b3c1483031227da42bcfadcf2ed19c9dc;hpb=a7daeec1ff1a38ca45b759aeafbab5b4c6547ef1;p=cura.git diff --git a/Cura/util/drawingLoader/dxf.py b/Cura/util/drawingLoader/dxf.py index 3915572b..cce9dc9d 100644 --- a/Cura/util/drawingLoader/dxf.py +++ b/Cura/util/drawingLoader/dxf.py @@ -9,9 +9,9 @@ from xml.etree import ElementTree from Cura.util.drawingLoader import drawing -class DXF(object): +class DXF(drawing.Drawing): def __init__(self, filename): - self.paths = [] + super(DXF, self).__init__() self._lastLine = None self._polyLine = None @@ -48,17 +48,15 @@ class DXF(object): if self._lastLine is not None and self._lastLinePoint == complex(float(obj[10]), float(obj[20])): self._lastLine.addLineTo(float(obj[11]), float(obj[21])) else: - p = drawing.Path(float(obj[10]), float(obj[20])) + p = self.addPath(float(obj[10]), float(obj[20])) p.addLineTo(float(obj[11]), float(obj[21])) - self.paths.append(p) self._lastLine = p self._lastLinePoint = complex(float(obj[11]), float(obj[21])) elif type == 'POLYLINE': self._polyLine = None elif type == 'VERTEX': if self._polyLine is None: - self._polyLine = drawing.Path(float(obj[10]), float(obj[20])) - self.paths.append(self._polyLine) + self._polyLine = self.addPath(float(obj[10]), float(obj[20])) else: self._polyLine.addLineTo(float(obj[10]), float(obj[20])) else: @@ -69,5 +67,5 @@ if __name__ == '__main__': print 'File: %s' % (sys.argv[n]) dxf = DXF(sys.argv[n]) - drawing.saveAsHtml(dxf, "test_export.html") + dxf.saveAsHtml("test_export.html")