chiark / gitweb /
Fix #813
authordaid <daid303@gmail.com>
Fri, 4 Apr 2014 09:42:23 +0000 (11:42 +0200)
committerdaid <daid303@gmail.com>
Fri, 4 Apr 2014 09:42:23 +0000 (11:42 +0200)
Cura/gui/util/engineResultView.py

index 5ea3a1182a8a0da81ad56fe59d9316c76ebca7cd..1554e32b41776c48a60152035dcb0733322a3958 100644 (file)
@@ -82,7 +82,10 @@ class engineResultView(object):
                layerNr = self.layerSelect.getValue()
                if layerNr == self.layerSelect.getMaxValue() and result is not None and len(result._polygons) > 0:
                        layerNr = max(layerNr, len(result._polygons))
-               viewZ = (layerNr - 1) * profile.getProfileSettingFloat('layer_height') + profile.getProfileSettingFloat('bottom_thickness')
+               if len(result._polygons) > layerNr-1 and 'inset0' in result._polygons[layerNr-1] and len(result._polygons[layerNr-1]['inset0']) > 0 and len(result._polygons[layerNr-1]['inset0'][0]) > 0:
+                       viewZ = result._polygons[layerNr-1]['inset0'][0][0][2]
+               else:
+                       viewZ = (layerNr - 1) * profile.getProfileSettingFloat('layer_height') + profile.getProfileSettingFloat('bottom_thickness')
                self._parent._viewTarget[2] = viewZ
                msize = max(profile.getMachineSettingFloat('machine_width'), profile.getMachineSettingFloat('machine_depth'))
                lineTypeList = [