From a9da54a2001f314a429b77fe5d7904abbbc3b646 Mon Sep 17 00:00:00 2001 From: daid303 Date: Fri, 3 May 2013 14:56:01 +0200 Subject: [PATCH] Add extruder offset passing to the engine. Update some tooltips. --- Cura/gui/sceneView.py | 9 +++++++-- Cura/util/profile.py | 4 ++-- Cura/util/sliceEngine.py | 7 +++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index ff46ccb2..5cb6376c 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -48,7 +48,7 @@ class SceneView(openglGui.glGuiPanel): self._animView = None self._animZoom = None self._platformMesh = meshLoader.loadMeshes(resources.getPathForMesh('ultimaker_platform.stl'))[0] - self._platformMesh._drawOffset = numpy.array([0,0,1.5], numpy.float32) + self._platformMesh._drawOffset = numpy.array([0,0,2.5], numpy.float32) self._isSimpleMode = True self._viewport = None @@ -693,7 +693,10 @@ class SceneView(openglGui.glGuiPanel): if self._animZoom.isDone(): self._animZoom = None if self.viewMode == 'gcode' and self._gcode is not None: - self._viewTarget[2] = self._gcode.layerList[self.layerSelect.getValue()][-1].points[0][2] + try: + self._viewTarget[2] = self._gcode.layerList[self.layerSelect.getValue()][-1].points[0][2] + except: + pass if self._objectShader is None: self._objectShader = opengl.GLShader(""" varying float light_amount; @@ -759,12 +762,14 @@ void main(void) self._renderObject(obj) if self._mouseX > -1: + glFlush() n = glReadPixels(self._mouseX, self.GetSize().GetHeight() - 1 - self._mouseY, 1, 1, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8)[0][0] if n < len(self._scene.objects()): self._focusObj = self._scene.objects()[n] else: self._focusObj = None f = glReadPixels(self._mouseX, self.GetSize().GetHeight() - 1 - self._mouseY, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT)[0][0] + #self.GetTopLevelParent().SetTitle(hex(n) + " " + str(f)) self._mouse3Dpos = opengl.unproject(self._mouseX, self._viewport[1] + self._viewport[3] - self._mouseY, f, self._modelMatrix, self._projMatrix, self._viewport) self._mouse3Dpos -= self._viewTarget diff --git a/Cura/util/profile.py b/Cura/util/profile.py index 0c7a88d8..b497ec9f 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -111,7 +111,7 @@ class setting(object): ## Settings ######################################################### setting('layer_height', 0.1, float, 'basic', 'Quality').setRange(0.0001).setLabel('Layer height (mm)', 'Layer height in millimeters.\nThis is the most important setting to determen the quality of your print. Normal quality prints are 0.1mm, high quality is 0.06mm. You can go up to 0.25mm with an Ultimaker for very fast prints at low quality.') -setting('wall_thickness', 0.8, float, 'basic', 'Quality').setRange(0.0001).setLabel('Wall thickness (mm)', 'Thickness of the walls.\nThis is used in combination with the nozzle size to define the number\nof perimeter lines and the thickness of those perimeter lines.') +setting('wall_thickness', 0.8, float, 'basic', 'Quality').setRange(0.0001).setLabel('Shell thickness (mm)', 'Thickness of the outside shell in the horizontal direction.\nThis is used in combination with the nozzle size to define the number\nof perimeter lines and the thickness of those perimeter lines.') setting('retraction_enable', False, bool, 'basic', 'Quality').setLabel('Enable retraction', 'Retract the filament when the nozzle is moving over a none-printed area. Details about the retraction can be configured in the advanced tab.') setting('solid_layer_thickness', 0.6, float, 'basic', 'Fill').setRange(0).setLabel('Bottom/Top thickness (mm)', 'This controls the thickness of the bottom and top layers, the amount of solid layers put down is calculated by the layer thickness and this value.\nHaving this value a multiply of the layer thickness makes sense. And keep it near your wall thickness to make an evenly strong part.') setting('fill_density', 20, float, 'basic', 'Fill').setRange(0, 100).setLabel('Fill Density (%)', 'This controls how densely filled the insides of your print will be. For a solid part use 100%, for an empty part use 0%. A value around 20% is usually enough.\nThis won\'t effect the outside of the print and only adjusts how strong the part becomes.') @@ -124,7 +124,7 @@ setting('print_temperature2', 0, int, 'basic', 'Speed & Temperatur setting('print_temperature3', 0, int, 'basic', 'Speed & Temperature').setRange(0,340).setLabel('3th nozzle temperature (C)', 'Temperature used for printing. Set at 0 to pre-heat yourself.\nFor PLA a value of 210C is usually used.\nFor ABS a value of 230C or higher is required.') setting('print_temperature4', 0, int, 'basic', 'Speed & Temperature').setRange(0,340).setLabel('4th nozzle temperature (C)', 'Temperature used for printing. Set at 0 to pre-heat yourself.\nFor PLA a value of 210C is usually used.\nFor ABS a value of 230C or higher is required.') setting('print_bed_temperature', 70, int, 'basic', 'Speed & Temperature').setRange(0,340).setLabel('Bed temperature (C)', 'Temperature used for the heated printer bed. Set at 0 to pre-heat yourself.') -setting('support', 'None', ['None', 'Touching buildplate', 'Everywhere'], 'basic', 'Support').setLabel('Support type', 'Type of support structure build.\n"Exterior only" is the most commonly used support setting.\n\nNone does not do any support.\nTouching buildplate only creates support where the support structure will touch the build platform.\nEverywhere creates support even on top of parts of the model.') +setting('support', 'None', ['None', 'Touching buildplate', 'Everywhere'], 'basic', 'Support').setLabel('Support type', 'Type of support structure build.\n"Touching buildplate" is the most commonly used support setting.\n\nNone does not do any support.\nTouching buildplate only creates support where the support structure will touch the build platform.\nEverywhere creates support even on top of parts of the model.') setting('platform_adhesion', 'None', ['None', 'Brim', 'Raft'], 'basic', 'Support').setLabel('Platform adhesion type', 'Different options that help in preventing corners from lifting due to warping.\nBrim adds a single layer thick flat area around your object which is easy to cut off afterwards, and the recommended option.\nRaft adds a thick raster at below the object and a thin interface between this and your object.\n(Note that enabling the brim or raft disables the skirt)') #setting('enable_raft', False, bool, 'basic', 'Support').setLabel('Enable raft', 'A raft is a few layers of lines below the bottom of the object. It prevents warping. Full raft settings can be found in the expert settings.\nFor PLA this is usually not required. But if you print with ABS it is almost required.') setting('support_dual_extrusion', False, bool, 'basic', 'Support').setLabel('Support dual extrusion', 'Print the support material with the 2nd extruder in a dual extrusion setup. The primary extruder will be used for normal material, while the second extruder is used to print support material.') diff --git a/Cura/util/sliceEngine.py b/Cura/util/sliceEngine.py index 4f96171f..9fb8e5b4 100644 --- a/Cura/util/sliceEngine.py +++ b/Cura/util/sliceEngine.py @@ -212,6 +212,13 @@ class Slicer(object): 'coolHeadLift': 1 if profile.getProfileSetting('cool_head_lift') == 'True' else 0, 'startCode': profile.getAlterationFileContents('start.gcode'), 'endCode': profile.getAlterationFileContents('end.gcode'), + + 'extruderOffset[1].X': int(profile.getPreferenceFloat('extruder_offset_x1') * 1000), + 'extruderOffset[1].Y': int(profile.getPreferenceFloat('extruder_offset_y1') * 1000), + 'extruderOffset[2].X': int(profile.getPreferenceFloat('extruder_offset_x2') * 1000), + 'extruderOffset[2].Y': int(profile.getPreferenceFloat('extruder_offset_y2') * 1000), + 'extruderOffset[3].X': int(profile.getPreferenceFloat('extruder_offset_x3') * 1000), + 'extruderOffset[3].Y': int(profile.getPreferenceFloat('extruder_offset_y3') * 1000), } if profile.getProfileSetting('platform_adhesion') == 'Brim': settings['skirtDistance'] = 0.0 -- 2.30.2