From: daid Date: Thu, 28 Jun 2012 09:27:06 +0000 (+0200) Subject: Fixed #143 - Properly align models when using multiple extruders. X-Git-Tag: 12.07~25 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c3502d9ca4ccb0dfb7b4f77cef8bd628700366bb;p=cura.git Fixed #143 - Properly align models when using multiple extruders. --- diff --git a/Cura/gui/projectPlanner.py b/Cura/gui/projectPlanner.py index c7fecfd8..5a996be3 100644 --- a/Cura/gui/projectPlanner.py +++ b/Cura/gui/projectPlanner.py @@ -92,6 +92,14 @@ class ProjectObject(stl.stlModel): def updateModelTransform(self): self.setRotateMirror(self.rotate, self.flipX, self.flipY, self.flipZ, self.swapXZ, self.swapYZ) + minZ = self.getMinimumZ() + minV = self.getMinimum() + maxV = self.getMaximum() + for v in self.vertexes: + v.z -= minZ + v.x -= minV.x + (maxV.x - minV.x) / 2 + v.y -= minV.y + (maxV.y - minV.y) / 2 + minZ = self.getMinimumZ() self.modelDirty = True def clone(self): diff --git a/Cura/util/mesh.py b/Cura/util/mesh.py index c2198486..30e29521 100644 --- a/Cura/util/mesh.py +++ b/Cura/util/mesh.py @@ -80,13 +80,6 @@ class mesh(object): face.normal = (v2 - v1).cross(v3 - v1) face.normal.normalize() - minZ = self.getMinimumZ() - minV = self.getMinimum() - maxV = self.getMaximum() - for v in self.vertexes: - v.z -= minZ - v.x -= minV.x + (maxV.x - minV.x) / 2 - v.y -= minV.y + (maxV.y - minV.y) / 2 self.getMinimumZ() def splitToParts(self):