Save log output next to gcode after slicing. Also, change the way holes are reported from SF, so we can show which edges cause the error

This commit is contained in:
daid 2012-03-15 15:25:16 +01:00
parent 5d4e8c7ed1
commit 9d4548132b
2 changed files with 12 additions and 6 deletions

View file

@ -429,14 +429,15 @@ def getLoopsFromCorrectMesh( edges, faces, vertexes, z ):
'Get loops from a carve of a correct mesh.'
remainingEdgeTable = getRemainingEdgeTable(edges, vertexes, z)
remainingValues = remainingEdgeTable.values()
error = False
for edge in remainingValues:
if len( edge.faceIndexes ) < 2:
print('This should never happen, there is a hole in the triangle mesh, each edge should have two faces.')
print(edge)
print('Something will still be printed, but there is no guarantee that it will be the correct shape.' )
print('Once the gcode is saved, you should check over the layer with a z of:')
print(z)
return []
if not hasattr(edge, 'errorReported'):
print('Model error(hole): ' + str(vertexes[edge.vertexIndexes[0]]) + ' ' + str(vertexes[edge.vertexIndexes[1]]))
edge.errorReported = True
error = True
if error:
return []
loops = []
while isPathAdded( edges, faces, loops, remainingEdgeTable, vertexes, z ):
pass

View file

@ -132,6 +132,11 @@ class WorkerThread(threading.Thread):
line = p.stdout.readline()
self.returnCode = p.wait()
self.gcodeFilename = self.filename[: self.filename.rfind('.')] + "_export.gcode"
logfile = open(self.filename[: self.filename.rfind('.')] + "_export.log", "w")
for logLine in self.progressLog:
logfile.write(logLine)
logfile.write('\n')
logfile.close()
wx.CallAfter(self.notifyWindow.OnSliceDone, self)
class LogWindow(wx.Frame):