from Cura.gui import preferencesDialog
from Cura.gui import configWizard
from Cura.gui import firmwareInstall
-from Cura.gui import printWindow
from Cura.gui import simpleMode
-from Cura.gui import projectPlanner
from Cura.gui import sceneView
from Cura.gui.tools import batchRun
from Cura.gui.util import dropTarget
from Cura.gui.tools import minecraftImport
from Cura.util import profile
from Cura.util import version
-from Cura.util import sliceRun
from Cura.util import meshLoader
class mainWindow(wx.Frame):
self.switchToNormalMenuItem = i
self.Bind(wx.EVT_MENU, self.OnNormalSwitch, i)
toolsMenu.AppendSeparator()
- i = toolsMenu.Append(-1, 'Project planner...')
- self.Bind(wx.EVT_MENU, self.OnProjectPlanner, i)
- self.normalModeOnlyItems.append(i)
i = toolsMenu.Append(-1, 'Batch run...')
self.Bind(wx.EVT_MENU, self.OnBatchRun, i)
self.normalModeOnlyItems.append(i)
prefDialog.Show(True)
def OnDropFiles(self, files):
- profile.putProfileSetting('model_matrix', '1,0,0,0,1,0,0,0,1')
profile.setPluginConfig([])
self.updateProfileToControls()
self.scene.loadScene(files)
- def OnPrint(self, e):
- if len(self.filelist) < 1:
- wx.MessageBox('You need to load a file and prepare it before you can print.', 'Print error', wx.OK | wx.ICON_INFORMATION)
- return
- if not os.path.exists(sliceRun.getExportFilename(self.filelist[0])):
- wx.MessageBox('You need to prepare a print before you can run the actual print.', 'Print error', wx.OK | wx.ICON_INFORMATION)
- return
- printWindow.printFile(sliceRun.getExportFilename(self.filelist[0]))
-
def OnModelMRU(self, e):
fileNum = e.GetId() - self.ID_MRU_MODEL1
path = self.modelFileHistory.GetHistoryFile(fileNum)
ecw.Centre()
ecw.Show(True)
- def OnProjectPlanner(self, e):
- pp = projectPlanner.projectPlanner()
- pp.Centre()
- pp.Show(True)
-
def OnMinecraftImport(self, e):
mi = minecraftImport.minecraftImportWindow(self)
mi.Centre()
if y == sy - 1 or not self.isSolid[blocks[x, y + 1, z]]:
faceCount += 1
m = mesh.mesh()
- m._prepareVertexCount(faceCount * 2 * 3)
+ m._prepareFaceCount(faceCount * 2)
for x in xrange(0, sx):
for y in xrange(0, sy):
for z in xrange(minZ, maxZ + 1):
if self.isSolid[blocks[x, y, z]]:
if z == maxZ or not self.isSolid[blocks[x, y, z + 1]]:
- m.addVertex(x, y, z+1)
- m.addVertex(x+1, y, z+1)
- m.addVertex(x, y+1, z+1)
+ m._addFace(x, y, z+1, x+1, y, z+1, x, y+1, z+1)
- m.addVertex(x+1, y+1, z+1)
- m.addVertex(x, y+1, z+1)
- m.addVertex(x+1, y, z+1)
+ m._addFace(x+1, y+1, z+1, x, y+1, z+1, x+1, y, z+1)
if z == minZ or not self.isSolid[blocks[x, y, z - 1]]:
- m.addVertex(x, y, z)
- m.addVertex(x, y+1, z)
- m.addVertex(x+1, y, z)
+ m._addFace(x, y, z, x, y+1, z, x+1, y, z)
- m.addVertex(x+1, y+1, z)
- m.addVertex(x+1, y, z)
- m.addVertex(x, y+1, z)
+ m._addFace(x+1, y+1, z, x+1, y, z, x, y+1, z)
if x == 0 or not self.isSolid[blocks[x - 1, y, z]]:
- m.addVertex(x, y, z)
- m.addVertex(x, y, z+1)
- m.addVertex(x, y+1, z)
+ m._addFace(x, y, z, x, y, z+1, x, y+1, z)
- m.addVertex(x, y+1, z+1)
- m.addVertex(x, y+1, z)
- m.addVertex(x, y, z+1)
+ m._addFace(x, y+1, z+1, x, y+1, z, x, y, z+1)
if x == sx - 1 or not self.isSolid[blocks[x + 1, y, z]]:
- m.addVertex(x+1, y, z)
- m.addVertex(x+1, y+1, z)
- m.addVertex(x+1, y, z+1)
+ m._addFace(x+1, y, z, x+1, y+1, z, x+1, y, z+1)
- m.addVertex(x+1, y+1, z+1)
- m.addVertex(x+1, y, z+1)
- m.addVertex(x+1, y+1, z)
+ m._addFace(x+1, y+1, z+1, x+1, y, z+1, x+1, y+1, z)
if y == 0 or not self.isSolid[blocks[x, y - 1, z]]:
- m.addVertex(x, y, z)
- m.addVertex(x+1, y, z)
- m.addVertex(x, y, z+1)
+ m._addFace(x, y, z, x+1, y, z, x, y, z+1)
- m.addVertex(x+1, y, z+1)
- m.addVertex(x, y, z+1)
- m.addVertex(x+1, y, z)
+ m._addFace(x+1, y, z+1, x, y, z+1, x+1, y, z)
if y == sy - 1 or not self.isSolid[blocks[x, y + 1, z]]:
- m.addVertex(x, y+1, z)
- m.addVertex(x, y+1, z+1)
- m.addVertex(x+1, y+1, z)
+ m._addFace(x, y+1, z, x, y+1, z+1, x+1, y+1, z)
- m.addVertex(x+1, y+1, z+1)
- m.addVertex(x+1, y+1, z)
- m.addVertex(x, y+1, z+1)
+ m._addFace(x+1, y+1, z+1, x+1, y+1, z, x, y+1, z+1)
stlFilename = os.path.join(os.path.dirname(self.level.filename), 'export.stl')
stl.saveAsSTL(m, stlFilename)
- self.GetParent()._loadModels([stlFilename])
+ self.GetParent().scene.loadScene([stlFilename])
#setting('raft_interface_material_amount', 100, int, 'expert', 'Raft').setRange(0,100).setLabel('Interface material amount (%)', 'The interface layer is a weak thin layer between the base layer and the printed object. It is designed to has little material to make it easy to break the base off the printed object. This setting adjusts the amount of material used for the interface layer.')
#setting('hop_on_move', False, bool, 'expert', 'Hop').setLabel('Enable hop on move', 'When moving from print position to print position, raise the printer head 0.2mm so it does not knock off the print (experimental).')
-setting('model_matrix', '1,0,0,0,1,0,0,0,1', str, 'hidden', 'hidden')
setting('plugin_config', '', str, 'hidden', 'hidden')
setting('object_center_x', -1, float, 'hidden', 'hidden')
setting('object_center_y', -1, float, 'hidden', 'hidden')
return [0, 0]
return [getPreferenceFloat('machine_width') / 2, getPreferenceFloat('machine_depth') / 2]
-def getObjectMatrix():
- try:
- return map(float, getProfileSetting('model_matrix').split(','))
- except ValueError:
- return [1,0,0, 0,1,0, 0,0,1]
-
#########################################################
## Alteration file functions
#########################################################