From: daid Date: Thu, 15 Mar 2012 14:25:16 +0000 (+0100) Subject: Save log output next to gcode after slicing. Also, change the way holes are reported... X-Git-Tag: RC1~87 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9d4548132b2529933580639558c32ebdf8a188d8;p=cura.git 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 --- diff --git a/SkeinPyPy_NewUI/fabmetheus_utilities/geometry/solids/triangle_mesh.py b/SkeinPyPy_NewUI/fabmetheus_utilities/geometry/solids/triangle_mesh.py index bbe77230..82bd7ac4 100644 --- a/SkeinPyPy_NewUI/fabmetheus_utilities/geometry/solids/triangle_mesh.py +++ b/SkeinPyPy_NewUI/fabmetheus_utilities/geometry/solids/triangle_mesh.py @@ -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 diff --git a/SkeinPyPy_NewUI/newui/sliceProgessPanel.py b/SkeinPyPy_NewUI/newui/sliceProgessPanel.py index 1dd2dc06..d880bf93 100644 --- a/SkeinPyPy_NewUI/newui/sliceProgessPanel.py +++ b/SkeinPyPy_NewUI/newui/sliceProgessPanel.py @@ -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):