from util import profile\r
from util import util3d\r
from util import stl\r
+from util import mesh\r
from util import sliceRun\r
from util import gcodeInterpreter\r
from util import exporer\r
toolbarUtil.NormalButton(self.toolbar, self.OnPreferences, 'preferences.png', 'Project planner preferences')\r
self.toolbar.AddSeparator()\r
toolbarUtil.NormalButton(self.toolbar, self.OnCutMesh, 'cut-mesh.png', 'Cut a plate STL into multiple STL files, and add those files to the project.\nNote: Splitting up plates sometimes takes a few minutes.')\r
+ toolbarUtil.NormalButton(self.toolbar, self.OnSaveCombinedSTL, 'save-combination.png', 'Save all the combined STL files into a single STL file as a plate.')\r
self.toolbar.AddSeparator()\r
toolbarUtil.NormalButton(self.toolbar, self.OnQuit, 'exit.png', 'Close project planner')\r
\r
self.preview.Refresh()\r
dlg.Destroy()\r
\r
+ def OnSaveCombinedSTL(self, e):\r
+ dlg=wx.FileDialog(self, "Save as STL", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_SAVE)\r
+ dlg.SetWildcard("STL files (*.stl)|*.stl;*.STL")\r
+ if dlg.ShowModal() == wx.ID_OK:\r
+ output = mesh.mesh()\r
+ for item in self.list:\r
+ offset = util3d.Vector3(item.centerX, item.centerY, 0)\r
+ for f in item.faces:\r
+ output.addFace(f.v[0] * item.scale + offset, f.v[1] * item.scale + offset, f.v[2] * item.scale + offset)\r
+ stl.saveAsSTL(output, dlg.GetPath())\r
+ dlg.Destroy()\r
+ \r
def OnSaveProject(self, e):\r
dlg=wx.FileDialog(self, "Save project file", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_SAVE)\r
dlg.SetWildcard("Project files (*.curaproject)|*.curaproject")\r