chiark / gitweb /
Save log output next to gcode after slicing. Also, change the way holes are reported...
authordaid <daid303@gmail.com>
Thu, 15 Mar 2012 14:25:16 +0000 (15:25 +0100)
committerdaid <daid303@gmail.com>
Thu, 15 Mar 2012 14:25:16 +0000 (15:25 +0100)
SkeinPyPy_NewUI/fabmetheus_utilities/geometry/solids/triangle_mesh.py
SkeinPyPy_NewUI/newui/sliceProgessPanel.py

index bbe7723045a62b465905bb0c074363dd892f1f5a..82bd7ac4b564dd1da2771e471a550dd81e23dd7b 100644 (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
index 1dd2dc06949c07d5e9f9fc1bace7bb27ee393a45..d880bf932ab48f8f99595374d5a4da665d22d979 100644 (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):