pointList = numpy.zeros((0,3), numpy.float32)
for path in layer:
if path.type == 'extrude' and path.pathType == extrudeType:
- a = numpy.array(path.points, numpy.float32)
+ a = path.points
a = numpy.concatenate((a[:-1], a[1:]), 1)
a = a.reshape((len(a) * 2, 3))
pointList = numpy.concatenate((pointList, a))
pointList = numpy.zeros((0,3), numpy.float32)
for path in layer:
if path.type == 'extrude' and path.pathType == extrudeType:
- a = numpy.array(path.points, numpy.float32)
+ a = path.points
if extrudeType == 'FILL':
a[:,2] += 0.01
import math
import os
import time
+import numpy
from Cura.util import profile
elif comment == 'skirt':
pathType = 'SKIRT'
if comment.startswith('LAYER:'):
+ currentPath = gcodePath(moveType, pathType, layerThickness, currentPath.points[-1])
+ currentPath.extruder = currentExtruder
+ for path in currentLayer:
+ path.points = numpy.array(path.points, numpy.float32)
+ path.extrusion = numpy.array(path.extrusion, numpy.float32)
self.layerList.append(currentLayer)
if self.progressCallback is not None:
if self.progressCallback(float(gcodeFile.tell()) / float(self._fileSize)):
#Abort the loading, we can safely return as the results here will be discarded
gcodeFile.close()
return
- currentLayer = []
+ currentLayer = [currentPath]
line = line[0:line.find(';')]
T = getCodeInt(line, 'T')
if T is not None:
extrudeAmountMultiply = s / 100.0
else:
print "Unknown M code:" + str(M)
+ for path in currentLayer:
+ path.points = numpy.array(path.points, numpy.float32)
+ path.extrusion = numpy.array(path.extrusion, numpy.float32)
self.layerList.append(currentLayer)
if self.progressCallback is not None and self._fileSize > 0:
self.progressCallback(float(gcodeFile.tell()) / float(self._fileSize))