mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 10:17:52 -06:00
Create a platform in PrinterApplication
This commit is contained in:
parent
6019a0f215
commit
b2480bea71
1 changed files with 9 additions and 9 deletions
|
@ -1,6 +1,7 @@
|
||||||
from Cura.Qt.QtApplication import QtApplication
|
from Cura.Qt.QtApplication import QtApplication
|
||||||
from Cura.Scene.SceneNode import SceneNode
|
from Cura.Scene.SceneNode import SceneNode
|
||||||
from Cura.Scene.Camera import Camera
|
from Cura.Scene.Camera import Camera
|
||||||
|
from Cura.Scene.Platform import Platform
|
||||||
from Cura.Math.Vector import Vector
|
from Cura.Math.Vector import Vector
|
||||||
from Cura.Math.Matrix import Matrix
|
from Cura.Math.Matrix import Matrix
|
||||||
from Cura.Resources import Resources
|
from Cura.Resources import Resources
|
||||||
|
@ -21,17 +22,16 @@ class PrinterApplication(QtApplication):
|
||||||
self.getController().setActiveView("MeshView")
|
self.getController().setActiveView("MeshView")
|
||||||
|
|
||||||
root = self.getController().getScene().getRoot()
|
root = self.getController().getScene().getRoot()
|
||||||
mesh = SceneNode(root)
|
platform = Platform(root)
|
||||||
mesh.setMeshData(self.getMeshFileHandler().read(Resources.getMesh("ultimaker2_platform.stl"), self.getStorageDevice('local')))
|
|
||||||
|
|
||||||
mesh2 = SceneNode(mesh)
|
mesh = SceneNode(platform)
|
||||||
mesh2.setMeshData(self.getMeshFileHandler().read(Resources.getMesh("simplecube.stl"), self.getStorageDevice('local')))
|
mesh.setMeshData(self.getMeshFileHandler().read(Resources.locate(Resources.MeshesLocation, "simplecube.stl"), self.getStorageDevice('local')))
|
||||||
mesh2.translate(Vector(30, 30, 0))
|
mesh.translate(Vector(30, 30, 0))
|
||||||
mesh2.scale(10)
|
mesh.scale(10)
|
||||||
|
|
||||||
mesh3 = SceneNode(mesh)
|
mesh = SceneNode(platform)
|
||||||
mesh3.setMeshData(self.getMeshFileHandler().read(Resources.getMesh("sphere.obj"), self.getStorageDevice('local')))
|
mesh.setMeshData(self.getMeshFileHandler().read(Resources.locate(Resources.MeshesLocation, "sphere.obj"), self.getStorageDevice('local')))
|
||||||
mesh3.translate(Vector(0, 0, 0))
|
mesh.translate(Vector(0, 0, 0))
|
||||||
|
|
||||||
self.getRenderer().setLightPosition(Vector(0, 150, 150))
|
self.getRenderer().setLightPosition(Vector(0, 150, 150))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue