chiark / gitweb /
Typos fixed
authornallath <nallath@gmail.com>
Thu, 6 Feb 2014 15:00:19 +0000 (16:00 +0100)
committernallath <nallath@gmail.com>
Thu, 6 Feb 2014 15:00:19 +0000 (16:00 +0100)
Cura/gui/sceneView.py
Cura/util/profile.py

index a64b958ef83461a8885eed7def160f9cf6b9d94d..0059ba309a748d4af8694c236e9ec316de5a56d4 100644 (file)
@@ -901,78 +901,78 @@ class SceneView(openglGui.glGuiPanel):
                if self._objectShader is None:
                        if openglHelpers.hasShaderSupport():
                                self._objectShader = openglHelpers.GLShader("""
-varying float light_amount;
-
-void main(void)
-{
-    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-    gl_FrontColor = gl_Color;
-
-       light_amount = abs(dot(normalize(gl_NormalMatrix * gl_Normal), normalize(gl_LightSource[0].position.xyz)));
-       light_amount += 0.2;
-}
-                               ""","""
-varying float light_amount;
-
-void main(void)
-{
-       gl_FragColor = vec4(gl_Color.xyz * light_amount, gl_Color[3]);
-}
+                                       varying float light_amount;
+
+                                       void main(void)
+                                       {
+                                               gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+                                               gl_FrontColor = gl_Color;
+
+                                               light_amount = abs(dot(normalize(gl_NormalMatrix * gl_Normal), normalize(gl_LightSource[0].position.xyz)));
+                                               light_amount += 0.2;
+                                       }
+                                                                       ""","""
+                                       varying float light_amount;
+
+                                       void main(void)
+                                       {
+                                               gl_FragColor = vec4(gl_Color.xyz * light_amount, gl_Color[3]);
+                                       }
                                """)
                                self._objectOverhangShader = openglHelpers.GLShader("""
-uniform float cosAngle;
-uniform mat3 rotMatrix;
-varying float light_amount;
-
-void main(void)
-{
-    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-    gl_FrontColor = gl_Color;
-
-       light_amount = abs(dot(normalize(gl_NormalMatrix * gl_Normal), normalize(gl_LightSource[0].position.xyz)));
-       light_amount += 0.2;
-       if (normalize(rotMatrix * gl_Normal).z < -cosAngle)
-       {
-               light_amount = -10.0;
-       }
-}
+                                       uniform float cosAngle;
+                                       uniform mat3 rotMatrix;
+                                       varying float light_amount;
+
+                                       void main(void)
+                                       {
+                                               gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+                                               gl_FrontColor = gl_Color;
+
+                                               light_amount = abs(dot(normalize(gl_NormalMatrix * gl_Normal), normalize(gl_LightSource[0].position.xyz)));
+                                               light_amount += 0.2;
+                                               if (normalize(rotMatrix * gl_Normal).z < -cosAngle)
+                                               {
+                                                       light_amount = -10.0;
+                                               }
+                                       }
                                ""","""
-varying float light_amount;
-
-void main(void)
-{
-       if (light_amount == -10.0)
-       {
-               gl_FragColor = vec4(1.0, 0.0, 0.0, gl_Color[3]);
-       }else{
-               gl_FragColor = vec4(gl_Color.xyz * light_amount, gl_Color[3]);
-       }
-}
-                               """)
+                                       varying float light_amount;
+
+                                       void main(void)
+                                       {
+                                               if (light_amount == -10.0)
+                                               {
+                                                       gl_FragColor = vec4(1.0, 0.0, 0.0, gl_Color[3]);
+                                               }else{
+                                                       gl_FragColor = vec4(gl_Color.xyz * light_amount, gl_Color[3]);
+                                               }
+                                       }
+                                                                       """)
                                self._objectLoadShader = openglHelpers.GLShader("""
-uniform float intensity;
-uniform float scale;
-varying float light_amount;
-
-void main(void)
-{
-       vec4 tmp = gl_Vertex;
-    tmp.x += sin(tmp.z/5.0+intensity*30.0) * scale * intensity;
-    tmp.y += sin(tmp.z/3.0+intensity*40.0) * scale * intensity;
-    gl_Position = gl_ModelViewProjectionMatrix * tmp;
-    gl_FrontColor = gl_Color;
-
-       light_amount = abs(dot(normalize(gl_NormalMatrix * gl_Normal), normalize(gl_LightSource[0].position.xyz)));
-       light_amount += 0.2;
-}
+                                       uniform float intensity;
+                                       uniform float scale;
+                                       varying float light_amount;
+
+                                       void main(void)
+                                       {
+                                               vec4 tmp = gl_Vertex;
+                                               tmp.x += sin(tmp.z/5.0+intensity*30.0) * scale * intensity;
+                                               tmp.y += sin(tmp.z/3.0+intensity*40.0) * scale * intensity;
+                                               gl_Position = gl_ModelViewProjectionMatrix * tmp;
+                                               gl_FrontColor = gl_Color;
+
+                                               light_amount = abs(dot(normalize(gl_NormalMatrix * gl_Normal), normalize(gl_LightSource[0].position.xyz)));
+                                               light_amount += 0.2;
+                                       }
                        ""","""
-uniform float intensity;
-varying float light_amount;
+                               uniform float intensity;
+                               varying float light_amount;
 
-void main(void)
-{
-       gl_FragColor = vec4(gl_Color.xyz * light_amount, 1.0-intensity);
-}
+                               void main(void)
+                               {
+                                       gl_FragColor = vec4(gl_Color.xyz * light_amount, 1.0-intensity);
+                               }
                                """)
                        if self._objectShader is None or not self._objectShader.isValid():
                                self._objectShader = openglHelpers.GLFakeShader()
@@ -1072,9 +1072,9 @@ void main(void)
                                glPushMatrix()
                                glLoadIdentity()
                                glEnable(GL_STENCIL_TEST)
-                               glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP)
+                               glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP) #Keep values
                                glDisable(GL_DEPTH_TEST)
-                               for i in xrange(2, 15, 2):
+                               for i in xrange(2, 15, 2): #All even values
                                        glStencilFunc(GL_EQUAL, i, 0xFF)
                                        glColor(float(i)/10, float(i)/10, float(i)/5)
                                        glBegin(GL_QUADS)
@@ -1083,7 +1083,7 @@ void main(void)
                                        glVertex3f( 1000, 1000,-10)
                                        glVertex3f(-1000, 1000,-10)
                                        glEnd()
-                               for i in xrange(1, 15, 2):
+                               for i in xrange(1, 15, 2): #All odd values
                                        glStencilFunc(GL_EQUAL, i, 0xFF)
                                        glColor(float(i)/10, 0, 0)
                                        glBegin(GL_QUADS)
@@ -1128,7 +1128,7 @@ void main(void)
                                        layer = 1
                                self.layerSelect.setValue(layer)
                        else:
-                               size = self._machineSize
+                               size = self._machineSize #Typing is hard.
                                glEnable(GL_BLEND)
                                glColor4ub(255,255,0,128)
                                glBegin(GL_QUADS)
@@ -1153,7 +1153,7 @@ void main(void)
                                                glVertex3f(p[0], p[1], 0)
                                        glEnd()
                                        glPopMatrix()
-                               if self._scene.isOneAtATime():
+                               if self._scene.isOneAtATime(): #Check print sequence mode.
                                        glPushMatrix()
                                        glColor4f(0,0,0,0.06)
                                        glTranslatef(self._selectedObj.getPosition()[0], self._selectedObj.getPosition()[1], 0)
@@ -1169,7 +1169,7 @@ void main(void)
                                glDepthMask(True)
                                glDisable(GL_CULL_FACE)
 
-                       #Draw the outline of the selected object, on top of everything else except the GUI.
+                       #Draw the outline of the selected object on top of everything else except the GUI.
                        if self._selectedObj is not None and self._selectedObj._loadAnim is None:
                                glDisable(GL_DEPTH_TEST)
                                glEnable(GL_CULL_FACE)
@@ -1203,7 +1203,7 @@ void main(void)
                        openglHelpers.glDrawStringCenter(_("Overhang view not working due to lack of OpenGL shaders support."))
                        glPopMatrix()
 
-       def _renderObject(self, obj, brightness = False, addSink = True):
+       def _renderObject(self, obj, brightness = 0, addSink = True):
                glPushMatrix()
                if addSink:
                        glTranslate(obj.getPosition()[0], obj.getPosition()[1], obj.getSize()[2] / 2 - profile.getProfileSettingFloat('object_sink'))
@@ -1211,21 +1211,19 @@ void main(void)
                        glTranslate(obj.getPosition()[0], obj.getPosition()[1], obj.getSize()[2] / 2)
 
                if self.tempMatrix is not None and obj == self._selectedObj:
-                       tempMatrix = openglHelpers.convert3x3MatrixTo4x4(self.tempMatrix)
-                       glMultMatrixf(tempMatrix)
+                       glMultMatrixf(openglHelpers.convert3x3MatrixTo4x4(self.tempMatrix))
 
                offset = obj.getDrawOffset()
                glTranslate(-offset[0], -offset[1], -offset[2] - obj.getSize()[2] / 2)
 
-               tempMatrix = openglHelpers.convert3x3MatrixTo4x4(obj.getMatrix())
-               glMultMatrixf(tempMatrix)
+               glMultMatrixf(openglHelpers.convert3x3MatrixTo4x4(obj.getMatrix()))
 
                n = 0
                for m in obj._meshList:
                        if m.vbo is None:
                                m.vbo = openglHelpers.GLVBO(GL_TRIANGLES, m.vertexes, m.normal)
-                       if brightness:
-                               glColor4fv(map(lambda n: n * brightness, self._objColors[n]))
+                       if brightness != 0:
+                               glColor4fv(map(lambda idx: idx * brightness, self._objColors[n]))
                                n += 1
                        m.vbo.render()
                glPopMatrix()
@@ -1308,6 +1306,7 @@ void main(void)
                height = profile.getMachineSettingFloat('machine_height')
                circular = profile.getMachineSetting('machine_shape') == 'Circular'
                glBegin(GL_QUADS)
+               # Draw the sides of the build volume.
                for n in xrange(0, len(polys[0])):
                        if not circular:
                                if n % 2 == 0:
@@ -1322,6 +1321,8 @@ void main(void)
                        glVertex3f(polys[0][n-1][0], polys[0][n-1][1], 0)
                        glVertex3f(polys[0][n-1][0], polys[0][n-1][1], height)
                glEnd()
+
+               #Draw top of build volume.
                glColor4ub(5, 171, 231, 128)
                glBegin(GL_TRIANGLE_FAN)
                for p in polys[0][::-1]:
@@ -1342,6 +1343,8 @@ void main(void)
                        glTexCoord2f(p[0]/20, p[1]/20)
                        glVertex3f(p[0], p[1], 0)
                glEnd()
+
+               #Draw no-go zones. (clips in case of UM2)
                glDisable(GL_TEXTURE_2D)
                glColor4ub(127, 127, 127, 200)
                for poly in polys[1:]:
@@ -1374,9 +1377,10 @@ void main(void)
 
        def getObjectMatrix(self):
                if self._selectedObj is None:
-                       return numpy.matrix([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]])
+                       return numpy.matrix(numpy.identity(3))
                return self._selectedObj.getMatrix()
 
+#TODO: Remove this or put it in a seperate file
 class shaderEditor(wx.Dialog):
        def __init__(self, parent, callback, v, f):
                super(shaderEditor, self).__init__(parent, title="Shader editor", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
index 3b99f09abd628ece1db2f291dbbbd3364953a2b6..c8d88114371e0764cccd7799d3fcce88aae42214 100644 (file)
@@ -191,29 +191,23 @@ setting('overlap_dual',             0.15, float, 'advanced', _('Quality')).setLa
 setting('travel_speed',            150.0, float, 'advanced', _('Speed')).setRange(0.1).setLabel(_("Travel speed (mm/s)"), _("Speed at which travel moves are done, a high quality build Ultimaker can reach speeds of 250mm/s. But some machines might miss steps then."))
 setting('bottom_layer_speed',         20, float, 'advanced', _('Speed')).setRange(0.1).setLabel(_("Bottom layer speed (mm/s)"), _("Print speed for the bottom layer, you want to print the first layer slower so it sticks better to the printer bed."))
 setting('infill_speed',              0.0, float, 'advanced', _('Speed')).setRange(0.0).setLabel(_("Infill speed (mm/s)"), _("Speed at which infill parts are printed. If set to 0 then the print speed is used for the infill. Printing the infill faster can greatly reduce printing, but this can negatively effect print quality."))
-setting('inset0_speed',              0.0, float, 'advanced', _('Speed')).setRange(0.0).setLabel(_("Outser shell speed (mm/s)"), _("Speed at which outer shell is printed. If set to 0 then the print speed is used. Printing the outer shell at a lower speed improves the final skin quality. However, having a large difference between the inner shell speed and the outer shell speed will effect quality in a negative way."))
-setting('insetx_speed',              0.0, float, 'advanced', _('Speed')).setRange(0.0).setLabel(_("Innser shell speed (mm/s)"), _("Speed at which inner shells are printed. If set to 0 then the print speed is used. Printing the inner shell faster then the outer shell will reduce printing time. It is good to set this somewhere in between the outer shell speed and the infill/printing speed."))
+setting('inset0_speed',              0.0, float, 'advanced', _('Speed')).setRange(0.0).setLabel(_("Outer shell speed (mm/s)"), _("Speed at which outer shell is printed. If set to 0 then the print speed is used. Printing the outer shell at a lower speed improves the final skin quality. However, having a large difference between the inner shell speed and the outer shell speed will effect quality in a negative way."))
+setting('insetx_speed',              0.0, float, 'advanced', _('Speed')).setRange(0.0).setLabel(_("Inner shell speed (mm/s)"), _("Speed at which inner shells are printed. If set to 0 then the print speed is used. Printing the inner shell faster then the outer shell will reduce printing time. It is good to set this somewhere in between the outer shell speed and the infill/printing speed."))
 setting('cool_min_layer_time',         5, float, 'advanced', _('Cool')).setRange(0).setLabel(_("Minimal layer time (sec)"), _("Minimum time spend in a layer, gives the layer time to cool down before the next layer is put on top. If the layer will be placed down too fast the printer will slow down to make sure it has spend at least this amount of seconds printing this layer."))
 setting('fan_enabled',              True, bool,  'advanced', _('Cool')).setLabel(_("Enable cooling fan"), _("Enable the cooling fan during the print. The extra cooling from the cooling fan is essential during faster prints."))
 
 setting('skirt_line_count',            1, int,   'expert', 'Skirt').setRange(0).setLabel(_("Line count"), _("The skirt is a line drawn around the object at the first layer. This helps to prime your extruder, and to see if the object fits on your platform.\nSetting this to 0 will disable the skirt. Multiple skirt lines can help priming your extruder better for small objects."))
 setting('skirt_gap',                 3.0, float, 'expert', 'Skirt').setRange(0).setLabel(_("Start distance (mm)"), _("The distance between the skirt and the first layer.\nThis is the minimal distance, multiple skirt lines will be put outwards from this distance."))
 setting('skirt_minimal_length',    150.0, float, 'expert', 'Skirt').setRange(0).setLabel(_("Minimal length (mm)"), _("The minimal length of the skirt, if this minimal length is not reached it will add more skirt lines to reach this minimal lenght.\nNote: If the line count is set to 0 this is ignored."))
-#setting('max_z_speed',               3.0, float, 'expert',   _('Speed')).setRange(0.1).setLabel(_("Max Z speed (mm/s)"), _("Speed at which Z moves are done. When you Z axis is properly lubricated you can increase this for less Z blob."))
-#setting('retract_on_jumps_only',    True, bool,  'expert',   _('Retraction')).setLabel(_('Retract on jumps only'), _('Only retract when we are making a move that is over a hole in the model, else retract on every move. This effects print quality in different ways.'))
 setting('fan_full_height',           0.5, float, 'expert',   _('Cool')).setRange(0).setLabel(_("Fan full on at height (mm)"), _("The height at which the fan is turned on completely. For the layers below this the fan speed is scaled linear with the fan off at layer 0."))
 setting('fan_speed',                 100, int,   'expert',   _('Cool')).setRange(0,100).setLabel(_("Fan speed min (%)"), _("When the fan is turned on, it is enabled at this speed setting. If cool slows down the layer, the fan is adjusted between the min and max speed. Minimal fan speed is used if the layer is not slowed down due to cooling."))
 setting('fan_speed_max',             100, int,   'expert',   _('Cool')).setRange(0,100).setLabel(_("Fan speed max (%)"), _("When the fan is turned on, it is enabled at this speed setting. If cool slows down the layer, the fan is adjusted between the min and max speed. Maximal fan speed is used if the layer is slowed down due to cooling by more than 200%."))
 setting('cool_min_feedrate',          10, float, 'expert',   _('Cool')).setRange(0).setLabel(_("Minimum speed (mm/s)"), _("The minimal layer time can cause the print to slow down so much it starts to ooze. The minimal feedrate protects against this. Even if a print gets slown down it will never be slower than this minimal speed."))
 setting('cool_head_lift',          False, bool,  'expert',   _('Cool')).setLabel(_("Cool head lift"), _("Lift the head if the minimal speed is hit because of cool slowdown, and wait the extra time so the minimal layer time is always hit."))
-#setting('extra_base_wall_thickness', 0.0, float, 'expert',   'Accuracy').setRange(0).setLabel(_("Extra Wall thickness for bottom/top (mm)"), _("Additional wall thickness of the bottom and top layers."))
-#setting('sequence', 'Loops > Perimeter > Infill', ['Loops > Perimeter > Infill', 'Loops > Infill > Perimeter', 'Infill > Loops > Perimeter', 'Infill > Perimeter > Loops', 'Perimeter > Infill > Loops', 'Perimeter > Loops > Infill'], 'expert', 'Sequence')
-#setting('force_first_layer_sequence', True, bool, 'expert', 'Sequence').setLabel(_('Force first layer sequence'), _('This setting forces the order of the first layer to be \'Perimeter > Loops > Infill\''))
-#setting('infill_type', 'Line', ['Line', 'Grid Circular', 'Grid Hexagonal', 'Grid Rectangular'], 'expert', _('Infill')).setLabel(_("Infill pattern"), _("Pattern of the none-solid infill. Line is default, but grids can provide a strong print."))
 setting('solid_top', True, bool, 'expert', _('Infill')).setLabel(_("Solid infill top"), _("Create a solid top surface, if set to false the top is filled with the fill percentage. Useful for cups/vases."))
 setting('solid_bottom', True, bool, 'expert', _('Infill')).setLabel(_("Solid infill bottom"), _("Create a solid bottom surface, if set to false the bottom is filled with the fill percentage. Useful for buildings."))
 setting('fill_overlap', 15, int, 'expert', _('Infill')).setRange(0,100).setLabel(_("Infill overlap (%)"), _("Amount of overlap between the infill and the walls. There is a slight overlap with the walls and the infill so the walls connect firmly to the infill."))
-setting('support_angle', 60, float, 'expert', _('Support')).setRange(0,90).setLabel(_("Overhang angle for support (deg)"), _("The minimal angle that overhangs need to have to get support. With 0deg being horizontal and 90deg being vertical."))
+setting('support_angle', 60, float, 'expert', _('Support')).setRange(0,90).setLabel(_("Overhang angle for support (deg)"), _("The minimal angle that overhangs need to have to get support. With 0 degree being horizontal and 90 degree being vertical."))
 setting('support_fill_rate', 15, int, 'expert', _('Support')).setRange(0,100).setLabel(_("Fill amount (%)"), _("Amount of infill structure in the support material, less material gives weaker support which is easier to remove. 15% seems to be a good average."))
 setting('support_xy_distance', 0.7, float, 'expert', _('Support')).setRange(0,10).setLabel(_("Distance X/Y (mm)"), _("Distance of the support material from the print, in the X/Y directions.\n0.7mm gives a nice distance from the print so the support does not stick to the print."))
 setting('support_z_distance', 0.15, float, 'expert', _('Support')).setRange(0,10).setLabel(_("Distance Z (mm)"), _("Distance from the top/bottom of the support to the print. A small gap here makes it easier to remove the support but makes the print a bit uglier.\n0.15mm gives a good seperation of the support material."))
@@ -226,7 +220,6 @@ setting('raft_base_thickness', 0.3, float, 'expert', _('Raft')).setRange(0).setL
 setting('raft_base_linewidth', 0.7, float, 'expert', _('Raft')).setRange(0).setLabel(_("Base line width (mm)"), _("When you are using the raft this is the width of the base layer lines which are put down."))
 setting('raft_interface_thickness', 0.2, float, 'expert', _('Raft')).setRange(0).setLabel(_("Interface thickness (mm)"), _("When you are using the raft this is the thickness of the interface layer which is put down."))
 setting('raft_interface_linewidth', 0.2, float, 'expert', _('Raft')).setRange(0).setLabel(_("Interface line width (mm)"), _("When you are using the raft this is the width of the interface layer lines which are put down."))
-#setting('hop_on_move', False, bool, 'expert', 'Hop').setLabel(_("Enable hop on move"), _("When moving from print position to print position, raise the printer head 0.2mm so it does not knock off the print (experimental)."))
 setting('fix_horrible_union_all_type_a', True,  bool, 'expert', _('Fix horrible')).setLabel(_("Combine everything (Type-A)"), _("This expert option adds all parts of the model together. The result is usually that internal cavities disappear. Depending on the model this can be intended or not. Enabling this option is at your own risk. Type-A is depended on the model normals and tries to keep some internal holes intact. Type-B ignores all internal holes and only keeps the outside shape per layer."))
 setting('fix_horrible_union_all_type_b', False, bool, 'expert', _('Fix horrible')).setLabel(_("Combine everything (Type-B)"), _("This expert option adds all parts of the model together. The result is usually that internal cavities disappear. Depending on the model this can be intended or not. Enabling this option is at your own risk. Type-A is depended on the model normals and tries to keep some internal holes intact. Type-B ignores all internal holes and only keeps the outside shape per layer."))
 setting('fix_horrible_use_open_bits', False, bool, 'expert', _('Fix horrible')).setLabel(_("Keep open faces"), _("This expert option keeps all the open bits of the model intact. Normally Cura tries to stitch up small holes and remove everything with big holes, but this option keeps bits that are not properly part of anything and just goes with whatever it is left. This option is usually not what you want, but it might enable you to slice models otherwise failing to produce proper paths.\nAs with all \"Fix horrible\" options, results may vary and use at your own risk."))