mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-28 13:21:10 -07:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
ceb6017cf4
2 changed files with 13 additions and 2 deletions
|
|
@ -185,9 +185,20 @@ class ThreeMFReader(MeshReader):
|
|||
continue
|
||||
|
||||
build_item_node = self._createNodeFromObject(object, self._base_name + "_" + str(id))
|
||||
|
||||
# compensate for original center position, if object(s) is/are not around its zero position
|
||||
extents = build_item_node.getMeshData().getExtents()
|
||||
center_vector = Vector(extents.center.x, extents.center.y, extents.center.z)
|
||||
transform_matrix = Matrix()
|
||||
transform_matrix.setByTranslation(center_vector)
|
||||
|
||||
# offset with transform from 3mf
|
||||
transform = build_item.get("transform")
|
||||
if transform is not None:
|
||||
build_item_node.setTransformation(self._createMatrixFromTransformationString(transform))
|
||||
transform_matrix.multiply(self._createMatrixFromTransformationString(transform))
|
||||
|
||||
build_item_node.setTransformation(transform_matrix)
|
||||
|
||||
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||
|
||||
# Create a transformation Matrix to convert from 3mf worldspace into ours.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue