Skip to content

Commit

Permalink
Set the clip size to the size in the UM2.
Browse files Browse the repository at this point in the history
  • Loading branch information
daid committed Nov 20, 2013
1 parent 5a36bdc commit e5058ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
16 changes: 7 additions & 9 deletions Cura/gui/sceneView.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,10 @@ def OnScaleMax(self, button):
self._scene.pushFree()
#self.sceneUpdated()
if machine == "ultimaker2":
self._selectedObj.setPosition(numpy.array([0.0,-22.5]))

#This is bad and Jaime should feel bad!
self._selectedObj.setPosition(numpy.array([0.0,-10.0]))
self._selectedObj.scaleUpTo(self._machineSize - numpy.array(profile.calculateObjectSizeOffsets() + [0.0], numpy.float32) * 2 - numpy.array([1,1,1], numpy.float32))
self._selectedObj.setPosition(numpy.array([0.0,-15]))
self._selectedObj.setPosition(numpy.array([0.0,0.0]))
self._scene.pushFree()
else:
self._selectedObj.setPosition(numpy.array([0.0, 0.0]))
Expand Down Expand Up @@ -1350,7 +1350,7 @@ def _drawMachine(self):
glColor4ub(127, 127, 127, 200)
#if UM2, draw bat-area zone for head. THe head can't stop there, because its bat-area.
#UpperRight
clipWidth = 50
clipWidth = 25
clipHeight = 10
posX = sx / 2 - clipWidth
posY = sy / 2 - clipHeight
Expand All @@ -1361,7 +1361,7 @@ def _drawMachine(self):
glVertex3f(posX, posY+clipHeight, 0.1)
glEnd()
#UpperLeft
clipWidth = 55
clipWidth = 25
clipHeight = 10
posX = -sx / 2
posY = sy / 2 - clipHeight
Expand All @@ -1372,7 +1372,7 @@ def _drawMachine(self):
glVertex3f(posX, posY+clipHeight, 0.1)
glEnd()
#LowerRight
clipWidth = 50
clipWidth = 25
clipHeight = 10
posX = sx / 2 - clipWidth
posY = -sy / 2
Expand All @@ -1383,7 +1383,7 @@ def _drawMachine(self):
glVertex3f(posX, posY+clipHeight, 0.1)
glEnd()
#LowerLeft
clipWidth = 55
clipWidth = 25
clipHeight = 10
posX = -sx / 2
posY = -sy / 2
Expand All @@ -1394,8 +1394,6 @@ def _drawMachine(self):
glVertex3f(posX, posY+clipHeight, 0.1)
glEnd()



glDisable(GL_BLEND)
glDisable(GL_CULL_FACE)

Expand Down
8 changes: 4 additions & 4 deletions Cura/util/objectScene.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,16 @@ def checkPlatform(self, obj):
machine = profile.getMachineSetting('machine_type')
if(machine == "ultimaker2"):
#lowerRight clip check
if p[0] - s[0] < -self._machineSize[0] / 2 + 50 and p[1] - s[1] < -self._machineSize[1]/2 + 5:
if p[0] - s[0] < -self._machineSize[0] / 2 + 25 and p[1] - s[1] < -self._machineSize[1]/2 + 10:
return False
#UpperRight
if p[0] - s[0] < -self._machineSize[0] / 2 + 50 and p[1] + s[1] > self._machineSize[1]/2 - 35:
if p[0] - s[0] < -self._machineSize[0] / 2 + 25 and p[1] + s[1] > self._machineSize[1]/2 - 10:
return False
#LowerLeft
if p[0] + s[0] > self._machineSize[0] / 2 - 55 and p[1] - s[1] < -self._machineSize[1]/2 + 5:
if p[0] + s[0] > self._machineSize[0] / 2 - 25 and p[1] - s[1] < -self._machineSize[1]/2 + 10:
return False
#UpperLeft
if p[0] + s[0] > self._machineSize[0] / 2 - 55 and p[1] + s[1] > self._machineSize[1]/2 - 35:
if p[0] + s[0] > self._machineSize[0] / 2 - 25 and p[1] + s[1] > self._machineSize[1]/2 - 10:
return False
return True

Expand Down

0 comments on commit e5058ba

Please sign in to comment.