Commit 2a061796 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix placement of objects in plater

parent ffe154b9
...@@ -300,8 +300,8 @@ class StlPlater(Plater): ...@@ -300,8 +300,8 @@ class StlPlater(Plater):
maxz = j[2] maxz = j[2]
model.dims = [minx, maxx, miny, maxy, minz, maxz] model.dims = [minx, maxx, miny, maxy, minz, maxz]
self.add_model(name, model) self.add_model(name, model)
model.centeroffset = [(maxx - minx) / 2, model.centeroffset = [-(model.dims[1] + model.dims[0]) / 2,
(maxy - miny) / 2, -(model.dims[3] + model.dims[2]) / 2,
0] 0]
self.s.drawmodel(model, 2) self.s.drawmodel(model, 2)
......
...@@ -164,8 +164,9 @@ class Plater(wx.Frame): ...@@ -164,8 +164,9 @@ class Plater(wx.Frame):
center = packer.Vector2(centerx, centery)) center = packer.Vector2(centerx, centery))
for rect in rects: for rect in rects:
i = rect.data i = rect.data
self.models[i].offsets[0] = rect.position.x position = rect.center()
self.models[i].offsets[1] = rect.position.y self.models[i].offsets[0] = position.x
self.models[i].offsets[1] = position.y
except ImportError: except ImportError:
bedsize = self.build_dimensions[0:3] bedsize = self.build_dimensions[0:3]
cursor = [0, 0, 0] cursor = [0, 0, 0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment