mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27:29 -06:00
Add Mesh reading and a basic mesh to render to PrinterApplication
This commit is contained in:
parent
15cec2dbe2
commit
797a345aa1
1 changed files with 12 additions and 1 deletions
|
@ -1,6 +1,10 @@
|
|||
from Cura.Wx.WxApplication import WxApplication
|
||||
from Cura.Wx.MainWindow import MainWindow
|
||||
|
||||
from Cura.Scene.SceneObject import SceneObject
|
||||
|
||||
import wx
|
||||
|
||||
class PrinterApplication(WxApplication):
|
||||
def __init__(self):
|
||||
super(PrinterApplication, self).__init__()
|
||||
|
@ -8,9 +12,16 @@ class PrinterApplication(WxApplication):
|
|||
def run(self):
|
||||
self._plugin_registry.loadPlugins({ "type": "StorageDevice" })
|
||||
self._plugin_registry.loadPlugins({ "type": "View" })
|
||||
self._plugin_registry.loadPlugins({ "type": "MeshHandler" })
|
||||
|
||||
self.getController().setActiveView("MeshView")
|
||||
|
||||
|
||||
root = self.getController().getScene().getRoot()
|
||||
mesh = SceneObject()
|
||||
mesh.setMeshData(self.getMeshFileHandler().read("plugins/STLReader/simpleTestCube.stl",self.getStorageDevice('local')))
|
||||
root.addChild(mesh)
|
||||
|
||||
window = MainWindow("Cura Printer", self)
|
||||
window.getCanvas().setBackgroundColor(wx.Colour(255, 0, 0, 255))
|
||||
window.Show()
|
||||
super(PrinterApplication, self).run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue