mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
3mf reader now uses correct origin
This commit is contained in:
parent
c550dd5072
commit
7d28f5cdf1
1 changed files with 6 additions and 1 deletions
|
@ -8,7 +8,7 @@ from UM.Math.Matrix import Matrix
|
||||||
from UM.Math.Vector import Vector
|
from UM.Math.Vector import Vector
|
||||||
from UM.Scene.SceneNode import SceneNode
|
from UM.Scene.SceneNode import SceneNode
|
||||||
from UM.Scene.GroupDecorator import GroupDecorator
|
from UM.Scene.GroupDecorator import GroupDecorator
|
||||||
from UM.Math.Quaternion import Quaternion
|
import UM.Application
|
||||||
from UM.Job import Job
|
from UM.Job import Job
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
@ -118,6 +118,11 @@ class ThreeMFReader(MeshReader):
|
||||||
Logger.log("w", "Bounding box test for object failed. Skipping this object")
|
Logger.log("w", "Bounding box test for object failed. Skipping this object")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# 3mf defines the front left corner as the 0, so we need to translate to their operating space.
|
||||||
|
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||||
|
if global_container_stack:
|
||||||
|
translation = Vector(x = -global_container_stack.getProperty("machine_width", "value") / 2, y = 0, z = global_container_stack.getProperty("machine_depth", "value") / 2)
|
||||||
|
node.translate(translation)
|
||||||
result.addChild(node)
|
result.addChild(node)
|
||||||
|
|
||||||
Job.yieldThread()
|
Job.yieldThread()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue