From 48b5632fdc8c7d54b5c592bad73a2c12ffd8dfa9 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Sat, 22 Oct 2016 01:09:58 +0200 Subject: [PATCH 01/72] all machines from legacy Cura --- resources/definitions/bfb.def.json | 40 ++++++++++++ resources/definitions/deltabot.def.json | 35 +++++++++++ resources/definitions/kupido.def.json | 38 ++++++++++++ .../definitions/makerbotreplicator.def.json | 31 ++++++++++ resources/definitions/ord.def.json | 41 +++++++++++++ .../definitions/prusa_mendel_i3.def.json | 30 +++++++++ .../definitions/punchtec_connect_xl.def.json | 36 +++++++++++ resources/definitions/rigid3d.def.json | 53 ++++++++++++++++ resources/definitions/rigid3d_3rdgen.def.json | 50 +++++++++++++++ resources/definitions/rigid3d_hobby.def.json | 47 ++++++++++++++ resources/definitions/rigid3d_zero.def.json | 54 ++++++++++++++++ resources/definitions/robo_3d_r1.def.json | 61 +++++++++++++++++++ resources/definitions/zone3d_printer.def.json | 30 +++++++++ resources/extruders/ord_extruder_0.def.json | 19 ++++++ resources/extruders/ord_extruder_1.def.json | 19 ++++++ resources/extruders/ord_extruder_2.def.json | 19 ++++++ resources/extruders/ord_extruder_3.def.json | 19 ++++++ resources/extruders/ord_extruder_4.def.json | 19 ++++++ ...punchtec_connect_xl_extruder_left.def.json | 19 ++++++ ...unchtec_connect_xl_extruder_right.def.json | 19 ++++++ 20 files changed, 679 insertions(+) create mode 100644 resources/definitions/bfb.def.json create mode 100644 resources/definitions/deltabot.def.json create mode 100644 resources/definitions/kupido.def.json create mode 100644 resources/definitions/makerbotreplicator.def.json create mode 100644 resources/definitions/ord.def.json create mode 100644 resources/definitions/prusa_mendel_i3.def.json create mode 100644 resources/definitions/punchtec_connect_xl.def.json create mode 100644 resources/definitions/rigid3d.def.json create mode 100644 resources/definitions/rigid3d_3rdgen.def.json create mode 100644 resources/definitions/rigid3d_hobby.def.json create mode 100644 resources/definitions/rigid3d_zero.def.json create mode 100644 resources/definitions/robo_3d_r1.def.json create mode 100644 resources/definitions/zone3d_printer.def.json create mode 100644 resources/extruders/ord_extruder_0.def.json create mode 100644 resources/extruders/ord_extruder_1.def.json create mode 100644 resources/extruders/ord_extruder_2.def.json create mode 100644 resources/extruders/ord_extruder_3.def.json create mode 100644 resources/extruders/ord_extruder_4.def.json create mode 100644 resources/extruders/punchtec_connect_xl_extruder_left.def.json create mode 100644 resources/extruders/punchtec_connect_xl_extruder_right.def.json diff --git a/resources/definitions/bfb.def.json b/resources/definitions/bfb.def.json new file mode 100644 index 0000000000..8f883dc8d7 --- /dev/null +++ b/resources/definitions/bfb.def.json @@ -0,0 +1,40 @@ +{ + "id": "bfb", + "name": "BFB", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "speed_topbottom": { "default_value": 40 }, + "speed_print": { "default_value": 40 }, + "machine_extruder_count": { "default_value": 1 }, + "prime_tower_size": { "default_value": 7.745966692414834 }, + "machine_name": { "default_value": "BFB_Test" }, + "machine_heated_bed": { "default_value": false }, + "machine_nozzle_size": { "default_value": 0.5 }, + "speed_layer_0": { "default_value": 25 }, + "machine_width": { "default_value": 275 }, + "machine_gcode_flavor": { "default_value": "BFB" }, + "machine_depth": { "default_value": 265 }, + "speed_infill": { "default_value": 30 }, + "material_diameter": { "default_value": 1.7 }, + "machine_center_is_zero": { "default_value": true }, + "machine_height": { "default_value": 240 }, + "layer_height": { "default_value": 0.25 }, + "material_print_temperature": { "default_value": 200 }, + "retraction_amount": { "default_value": 0.05 }, + "speed_wall_0": { "default_value": 25 }, + "speed_travel": { "default_value": 50 }, + "infill_sparse_density": { "default_value": 10 }, + "layer_height_0": { "default_value": 0.5 }, + "speed_wall_x": { "default_value": 20 } + } +} diff --git a/resources/definitions/deltabot.def.json b/resources/definitions/deltabot.def.json new file mode 100644 index 0000000000..f625995019 --- /dev/null +++ b/resources/definitions/deltabot.def.json @@ -0,0 +1,35 @@ +{ + "id": "deltabot", + "name": "DeltaBot", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "speed_travel": { "default_value": 150 }, + "prime_tower_size": { "default_value": 8.660254037844387 }, + "infill_sparse_density": { "default_value": 10 }, + "speed_wall_x": { "default_value": 30 }, + "speed_wall_0": { "default_value": 30 }, + "speed_topbottom": { "default_value": 30 }, + "layer_height": { "default_value": 0.2 }, + "machine_nozzle_size": { "default_value": 0.5 }, + "speed_print": { "default_value": 30 }, + "speed_infill": { "default_value": 30 }, + "machine_extruder_count": { "default_value": 1 }, + "machine_heated_bed": { "default_value": true }, + "machine_center_is_zero": { "default_value": true }, + "machine_height": { "default_value": 150 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 150 }, + "machine_width": { "default_value": 150 }, + "machine_name": { "default_value": "DeltaBot style" } + } +} diff --git a/resources/definitions/kupido.def.json b/resources/definitions/kupido.def.json new file mode 100644 index 0000000000..ce0a65741f --- /dev/null +++ b/resources/definitions/kupido.def.json @@ -0,0 +1,38 @@ +{ + "id": "kupido", + "name": "Kupido", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "machine_name": { "default_value": "Kupido" }, + "machine_start_gcode": { + "default_value": " ;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\n ;Print time: {print_time}\n ;Filament used: {filament_amount}m {filament_weight}g\n ;Filament cost: {filament_cost}\n ;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n ;M109 S{print_temperature} ;Uncomment to add your own temperature line\n G21 ;metric values\n G90 ;absolute positioning\n M82 ;set extruder to absolute mode\n M107 ;start with the fan off\n G28 X0 Y0 ;move X Y to endstops\n G28 Z0 ;move Z to endstops\n G1 Z20.0 F{40} ;move the platform down 20mm\n G1 Y0 X170 F{travel_speed}\n G92 E0 ;zero the extruded length\n G1 F200 E10 ;extrude 3mm of feed stock\n G92 E0 ;zero the extruded length again\n G4 P7000\n G1 F{travel_speed}\n ;Put printing message on LCD screen\n M117 Printing...\n" + }, + "machine_end_gcode": { + "default_value": " M104 S0 ;extruder heater off\n M140 S0 ;heated bed heater off (if you have it)\n G91 ;relative positioning\n G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\n G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\n G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\n M84 ;steppers off\n G90 ;absolute positioning\n ;{profile_string}\n" + }, + "prime_tower_size": { "default_value": 8.660254037844387 }, + "retraction_speed": { "default_value": 60 }, + "material_bed_temperature": { "default_value": 60 }, + "speed_wall_x": { "default_value": 40 }, + "skirt_line_count": { "default_value": 2 }, + "retraction_min_travel": { "default_value": 2 }, + "speed_wall_0": { "default_value": 30 }, + "material_print_temperature": { "default_value": 220 }, + "brim_line_count": { "default_value": 15 }, + "retraction_amount": { "default_value": 3.6 }, + "speed_topbottom": { "default_value": 20 }, + "layer_height": { "default_value": 0.2 }, + "speed_print": { "default_value": 30 }, + "speed_infill": { "default_value": 30 } + } +} diff --git a/resources/definitions/makerbotreplicator.def.json b/resources/definitions/makerbotreplicator.def.json new file mode 100644 index 0000000000..115fd4bd21 --- /dev/null +++ b/resources/definitions/makerbotreplicator.def.json @@ -0,0 +1,31 @@ +{ + "id": "makerbotreplicator", + "name": "MakerBotReplicator", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "prime_tower_size": { "default_value": 10.0 }, + "infill_sparse_density": { "default_value": 10 }, + "speed_travel": { "default_value": 150 }, + "material_diameter": { "default_value": 1.75 }, + "layer_height": { "default_value": 0.15 }, + "material_print_temperature": { "default_value": 220 }, + "machine_extruder_count": { "default_value": 1 }, + "machine_heated_bed": { "default_value": true }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 150 }, + "machine_gcode_flavor": { "default_value": "MakerBot" }, + "machine_depth": { "default_value": 145 }, + "machine_width": { "default_value": 225 }, + "machine_name": { "default_value": "MakerBot Replicator" } + } +} diff --git a/resources/definitions/ord.def.json b/resources/definitions/ord.def.json new file mode 100644 index 0000000000..ffa6d2be74 --- /dev/null +++ b/resources/definitions/ord.def.json @@ -0,0 +1,41 @@ +{ + "id": "ord", + "name": "Ord", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "machine_extruder_trains": + { + "0": "ord_extruder_0", + "1": "ord_extruder_1", + "2": "ord_extruder_2", + "3": "ord_extruder_3", + "4": "ord_extruder_4" + }, + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "material_bed_temperature": { "default_value": 60 }, + "prime_tower_size": { "default_value": 7.0710678118654755 }, + "infill_sparse_density": { "default_value": 15 }, + "speed_travel": { "default_value": 150 }, + "material_diameter": { "default_value": 1.75 }, + "layer_height": { "default_value": 0.3 }, + "machine_nozzle_size": { "default_value": 0.35 }, + "material_print_temperature": { "default_value": 240 }, + "machine_extruder_count": { "default_value": 5 }, + "machine_heated_bed": { "default_value": true }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 200 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 250 }, + "machine_width": { "default_value": 215 }, + "machine_name": { "default_value": "Ord" } + } +} diff --git a/resources/definitions/prusa_mendel_i3.def.json b/resources/definitions/prusa_mendel_i3.def.json new file mode 100644 index 0000000000..a17678d65c --- /dev/null +++ b/resources/definitions/prusa_mendel_i3.def.json @@ -0,0 +1,30 @@ +{ + "id": "prusa_mendel_i3", + "name": "Prusa Mendel i3", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "prime_tower_size": { "default_value": 8.660254037844387 }, + "machine_nozzle_size": { "default_value": 0.5 }, + "material_print_temperature": { "default_value": 240 }, + "layer_height": { "default_value": 0.2 }, + "speed_travel": { "default_value": 150 }, + "machine_extruder_count": { "default_value": 1 }, + "machine_heated_bed": { "default_value": true }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 200 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 185 }, + "machine_width": { "default_value": 198 }, + "machine_name": { "default_value": "Prusa Mendel i3" } + } +} diff --git a/resources/definitions/punchtec_connect_xl.def.json b/resources/definitions/punchtec_connect_xl.def.json new file mode 100644 index 0000000000..81b71b9cb0 --- /dev/null +++ b/resources/definitions/punchtec_connect_xl.def.json @@ -0,0 +1,36 @@ +{ + "id": "punchtec_connect_xl", + "name": "punchtec Connect XL", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "machine_head_polygon": { "default_value": [[ 0, 0], [ 0, 0], [ 0, 0], [ 0, 0]] }, + "speed_travel": { "default_value": 150 }, + "prime_tower_size": { "default_value": 8.660254037844387 }, + "speed_wall_x": { "default_value": 40 }, + "speed_wall_0": { "default_value": 40 }, + "material_diameter": { "default_value": 1.75 }, + "speed_topbottom": { "default_value": 40 }, + "layer_height": { "default_value": 0.2 }, + "material_print_temperature": { "default_value": 195 }, + "speed_print": { "default_value": 40 }, + "speed_infill": { "default_value": 40 }, + "machine_extruder_count": { "default_value": 2 }, + "machine_heated_bed": { "default_value": true }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 200 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 304 }, + "machine_width": { "default_value": 304 }, + "machine_name": { "default_value": "Connect XL" } + } +} diff --git a/resources/definitions/rigid3d.def.json b/resources/definitions/rigid3d.def.json new file mode 100644 index 0000000000..e067c6147e --- /dev/null +++ b/resources/definitions/rigid3d.def.json @@ -0,0 +1,53 @@ +{ + "id": "rigid3d", + "name": "Rigid3D", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "machine_start_gcode": { + "default_value": " ; -- START GCODE --\n G21\n G28 ; Home extruder\n G29 ; Autolevel bed\n M107 ; Turn off fan\n G90 ; Absolute positioning\n M82 ; Extruder in absolute mode\n G92 E0 ; Reset extruder position\n ; -- end of START GCODE --\n\n" + }, + "machine_end_gcode": { + "default_value": " ; -- END GCODE --\n G1 X0 Y230 ; Get extruder out of way.\n M107 ; Turn off fan\n G91 ; Relative positioning\n G0 Z20 ; Lift extruder up\n T0\n G1 E-1 ; Reduce filament pressure\n M104 T0 S0 ; Turn ectruder heater off\n G90 ; Absolute positioning\n G92 E0 ; Reset extruder position\n M140 S0 ; Disable heated bed\n M84 ; Turn steppers off\n ; -- end of END GCODE --\n" + }, + "machine_head_polygon": { "default_value": [[ 22, 67], [ 22, 51], [ 36, 51], [ 36, 67]] }, + "skirt_gap": { "default_value": 5.0 }, + "cool_min_layer_time": { "default_value": 10 }, + "prime_tower_size": { "default_value": 7.745966692414834 }, + "speed_wall_x": { "default_value": 40 }, + "speed_travel": { "default_value": 100 }, + "bottom_thickness": { "default_value": 0.75 }, + "material_diameter": { "default_value": 1.75 }, + "layer_height_0": { "default_value": 0.25 }, + "support_angle": { "default_value": 45 }, + "material_bed_temperature": { "default_value": 100 }, + "top_thickness": { "default_value": 0.75 }, + "material_print_temperature": { "default_value": 235 }, + "retraction_speed": { "default_value": 60.0 }, + "wall_thickness": { "default_value": 0.8 }, + "retraction_min_travel": { "default_value": 2 }, + "speed_wall_0": { "default_value": 30 }, + "retraction_amount": { "default_value": 1 }, + "speed_topbottom": { "default_value": 30 }, + "layer_height": { "default_value": 0.25 }, + "speed_print": { "default_value": 40 }, + "speed_infill": { "default_value": 40 }, + "machine_extruder_count": { "default_value": 1 }, + "machine_heated_bed": { "default_value": true }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 210 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 250 }, + "machine_width": { "default_value": 250 }, + "machine_name": { "default_value": "Rigid3D" } + } +} diff --git a/resources/definitions/rigid3d_3rdgen.def.json b/resources/definitions/rigid3d_3rdgen.def.json new file mode 100644 index 0000000000..4df0466df5 --- /dev/null +++ b/resources/definitions/rigid3d_3rdgen.def.json @@ -0,0 +1,50 @@ +{ + "id": "rigid3d_3rdgen", + "name": "rigid3d_3rdGen", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "machine_start_gcode": { + "default_value": " ; -- START GCODE --\n G21\n G28 ; Home extruder\n G29 ; Autolevel bed\n M107 ; Turn off fan\n G90 ; Absolute positioning\n M82 ; Extruder in absolute mode\n G92 E0 ; Reset extruder position\n ; -- end of START GCODE --\n\n" + }, + "machine_end_gcode": { + "default_value": " ; -- END GCODE --\n G1 X0 Y230 ; Get extruder out of way.\n M107 ; Turn off fan\n G91 ; Relative positioning\n G0 Z20 ; Lift extruder up\n T0\n G1 E-1 ; Reduce filament pressure\n M104 T0 S0 ; Turn extruder heater off\n G90 ; Absolute positioning\n G92 E0 ; Reset extruder position\n M140 S0 ; Disable heated bed\n M84 ; Turn steppers off\n ; -- end of END GCODE --\n" + }, + "machine_head_polygon": { "default_value": [[ 18, 0], [ 18, 65], [ 32, 65], [ 32, 0]] }, + "cool_min_layer_time": { "default_value": 10 }, + "prime_tower_size": { "default_value": 7.745966692414834 }, + "skirt_gap": { "default_value": 5.0 }, + "speed_travel": { "default_value": 120 }, + "bottom_thickness": { "default_value": 0.75 }, + "material_diameter": { "default_value": 1.75 }, + "layer_height_0": { "default_value": 0.25 }, + "support_angle": { "default_value": 45 }, + "material_bed_temperature": { "default_value": 100 }, + "retraction_min_travel": { "default_value": 2 }, + "speed_wall_0": { "default_value": 30 }, + "retraction_speed": { "default_value": 60.0 }, + "wall_thickness": { "default_value": 0.8 }, + "material_print_temperature": { "default_value": 235 }, + "retraction_amount": { "default_value": 1 }, + "speed_topbottom": { "default_value": 25 }, + "layer_height": { "default_value": 0.25 }, + "top_thickness": { "default_value": 0.75 }, + "machine_extruder_count": { "default_value": 1 }, + "machine_heated_bed": { "default_value": true }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 240 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 290 }, + "machine_width": { "default_value": 275 }, + "machine_name": { "default_value": "Rigid3D 3rd Geneartion" } + } +} diff --git a/resources/definitions/rigid3d_hobby.def.json b/resources/definitions/rigid3d_hobby.def.json new file mode 100644 index 0000000000..fe46a3c7d6 --- /dev/null +++ b/resources/definitions/rigid3d_hobby.def.json @@ -0,0 +1,47 @@ +{ + "id": "rigid3d_hobby", + "name": "RIGID3D HOBBY", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "machine_head_polygon": { "default_value": [[ 16, 30], [ 16, 45], [ 16, 45], [ 16, 30]] }, + "prime_tower_size": { "default_value": 8.660254037844387 }, + "speed_travel": { "default_value": 40 }, + "skirt_gap": { "default_value": 5.0 }, + "cool_min_layer_time": { "default_value": 15 }, + "support_pattern": { "default_value": "grid" }, + "material_diameter": { "default_value": 1.75 }, + "layer_height_0": { "default_value": 0.25 }, + "speed_wall_x": { "default_value": 30 }, + "skirt_line_count": { "default_value": 2 }, + "support_angle": { "default_value": 45 }, + "speed_topbottom": { "default_value": 20 }, + "material_print_temperature": { "default_value": 205 }, + "retraction_speed": { "default_value": 80 }, + "wall_thickness": { "default_value": 0.8 }, + "retraction_min_travel": { "default_value": 2 }, + "speed_wall_0": { "default_value": 20 }, + "retraction_amount": { "default_value": 2 }, + "speed_layer_0": { "default_value": 15 }, + "layer_height": { "default_value": 0.2 }, + "speed_print": { "default_value": 30 }, + "speed_infill": { "default_value": 30 }, + "machine_extruder_count": { "default_value": 1 }, + "machine_heated_bed": { "default_value": false }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 150 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 150 }, + "machine_width": { "default_value": 150 }, + "machine_name": { "default_value": "Rigid3D Hobby" } + } +} diff --git a/resources/definitions/rigid3d_zero.def.json b/resources/definitions/rigid3d_zero.def.json new file mode 100644 index 0000000000..a3e254c1a3 --- /dev/null +++ b/resources/definitions/rigid3d_zero.def.json @@ -0,0 +1,54 @@ +{ + "id": "rigid3d_zero", + "name": "Rigid3d_Zero", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "machine_start_gcode": { + "default_value": " ; -- START GCODE --\n G21\n G28 ; Home extruder\n G29 ; Autolevel bed\n M107 ; Turn off fan\n G90 ; Absolute positioning\n M82 ; Extruder in absolute mode\n G92 E0 ; Reset extruder position\n ; -- end of START GCODE --\n\n" + }, + "machine_end_gcode": { + "default_value": " ; -- END GCODE --\n G1 X0 Y230 ; Get extruder out of way.\n M107 ; Turn off fan\n G91 ; Relative positioning\n G0 Z20 ; Lift extruder up\n T0\n G1 E-1 ; Reduce filament pressure\n M104 T0 S0 ; Turn ectruder heater off\n G90 ; Absolute positioning\n G92 E0 ; Reset extruder position\n M140 S0 ; Disable heated bed\n M84 ; Turn steppers off\n ; -- end of END GCODE --\n" + }, + "machine_head_polygon": { "default_value": [[ 40, 15], [ 40, 60], [ 30, 60], [ 30, 15]] }, + "support_pattern": { "default_value": "grid" }, + "cool_min_layer_time": { "default_value": 10 }, + "speed_travel": { "default_value": 80 }, + "support_angle": { "default_value": 45 }, + "retraction_min_travel": { "default_value": 2 }, + "speed_wall_0": { "default_value": 20 }, + "speed_layer_0": { "default_value": 15 }, + "speed_infill": { "default_value": 30 }, + "speed_topbottom": { "default_value": 30 }, + "prime_tower_size": { "default_value": 7.745966692414834 }, + "skirt_line_count": { "default_value": 2 }, + "speed_wall_x": { "default_value": 30 }, + "material_diameter": { "default_value": 1.75 }, + "bottom_thickness": { "default_value": 0.75 }, + "layer_height_0": { "default_value": 0.25 }, + "top_thickness": { "default_value": 0.75 }, + "wall_thickness": { "default_value": 0.8 }, + "material_print_temperature": { "default_value": 195 }, + "retraction_amount": { "default_value": 1.5 }, + "skirt_gap": { "default_value": 5.0 }, + "layer_height": { "default_value": 0.25 }, + "speed_print": { "default_value": 30 }, + "machine_extruder_count": { "default_value": 1 }, + "machine_heated_bed": { "default_value": false }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 190 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 250 }, + "machine_width": { "default_value": 250 }, + "machine_name": { "default_value": "Rigid3D Zero" } + } +} diff --git a/resources/definitions/robo_3d_r1.def.json b/resources/definitions/robo_3d_r1.def.json new file mode 100644 index 0000000000..fa84b74e0d --- /dev/null +++ b/resources/definitions/robo_3d_r1.def.json @@ -0,0 +1,61 @@ +{ + "id": "robo_3d_r1", + "name": "ROBO 3D R1", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "machine_start_gcode": { + "default_value": " G92 E0 ;\n M565 Z-1 ;\n G1 Z5 F5000 ;\n G29 ;\n" + }, + "machine_end_gcode": { + "default_value": " M104 S0 ;extruder heater off\n M140 S0 ;heated bed heater off (if you have it)\n G91 ;relative positioning\n G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\n G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\n G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\n M84 ;steppers off\n G90 ;absolute positioning\n ;{profile_string}\n" + }, + "cool_min_layer_time": { "default_value": 7 }, + "speed_topbottom": { "default_value": 40 }, + "retraction_speed": { "default_value": 50 }, + "layer_0_z_overlap": { "default_value": 0.2 }, + "cool_min_speed": { "default_value": 19 }, + "material_bed_temperature": { "default_value": 60 }, + "support_angle": { "default_value": 50 }, + "speed_layer_0": { "default_value": 30 }, + "line_width": { "default_value": 0.39999999999999997 }, + "speed_infill": { "default_value": 60 }, + "prime_tower_size": { "default_value": 8.660254037844387 }, + "support_enable": { "default_value": true }, + "cool_fan_full_at_height": { "default_value": 0.1 }, + "material_diameter": { "default_value": 1.75 }, + "bottom_thickness": { "default_value": 1.2 }, + "raft_airgap": { "default_value": 0.2 }, + "layer_height_0": { "default_value": 0.15 }, + "top_thickness": { "default_value": 1.2 }, + "speed_wall_0": { "default_value": 40 }, + "retraction_min_travel": { "default_value": 5 }, + "material_flow": { "default_value": 100 }, + "infill_sparse_density": { "default_value": 10 }, + "wall_thickness": { "default_value": 1.2 }, + "material_print_temperature": { "default_value": 190 }, + "retraction_amount": { "default_value": 3 }, + "layer_height": { "default_value": 0.2 }, + "speed_print": { "default_value": 40 }, + "machine_extruder_count": { "default_value": 1 }, + "retraction_combing": { "default_value": "off" }, + "machine_heated_bed": { "default_value": true }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 210 }, + "adhesion_type": { "default_value": "raft" }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 245 }, + "machine_width": { "default_value": 225 }, + "support_z_distance": { "default_value": 0.22 }, + "machine_name": { "default_value": "ROBO 3D R1" } + } +} diff --git a/resources/definitions/zone3d_printer.def.json b/resources/definitions/zone3d_printer.def.json new file mode 100644 index 0000000000..1663ffdf2b --- /dev/null +++ b/resources/definitions/zone3d_printer.def.json @@ -0,0 +1,30 @@ +{ + "id": "zone3d_printer", + "name": "Zone3d Printer", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "material_diameter": { "default_value": 1.75 }, + "prime_tower_size": { "default_value": 10.350983390135314 }, + "material_print_temperature": { "default_value": 260 }, + "layer_height": { "default_value": 0.14 }, + "speed_travel": { "default_value": 150 }, + "machine_extruder_count": { "default_value": 1 }, + "machine_heated_bed": { "default_value": true }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 210 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 220 }, + "machine_width": { "default_value": 240 }, + "machine_name": { "default_value": "Zone3D Printer" } + } +} diff --git a/resources/extruders/ord_extruder_0.def.json b/resources/extruders/ord_extruder_0.def.json new file mode 100644 index 0000000000..c3f8d75cc0 --- /dev/null +++ b/resources/extruders/ord_extruder_0.def.json @@ -0,0 +1,19 @@ +{ + "id": "ord_extruder_0", + "version": 2, + "name": "0", + "inherits": "fdmextruder", + "metadata": { + "machine": "ord", + "position": "0" + }, + + "overrides": { + "extruder_nr": { + "default_value": 0, + "maximum_value": "4" + }, + "machine_nozzle_offset_x": { "default_value": 0.0 }, + "machine_nozzle_offset_y": { "default_value": 0.0 } + } +} diff --git a/resources/extruders/ord_extruder_1.def.json b/resources/extruders/ord_extruder_1.def.json new file mode 100644 index 0000000000..9b7990605d --- /dev/null +++ b/resources/extruders/ord_extruder_1.def.json @@ -0,0 +1,19 @@ +{ + "id": "ord_extruder_1", + "version": 2, + "name": "1", + "inherits": "fdmextruder", + "metadata": { + "machine": "ord", + "position": "1" + }, + + "overrides": { + "extruder_nr": { + "default_value": 1, + "maximum_value": "4" + }, + "machine_nozzle_offset_x": { "default_value": 62.95 }, + "machine_nozzle_offset_y": { "default_value": 2.05 } + } +} diff --git a/resources/extruders/ord_extruder_2.def.json b/resources/extruders/ord_extruder_2.def.json new file mode 100644 index 0000000000..4e8a9f6c15 --- /dev/null +++ b/resources/extruders/ord_extruder_2.def.json @@ -0,0 +1,19 @@ +{ + "id": "ord_extruder_2", + "version": 2, + "name": "2", + "inherits": "fdmextruder", + "metadata": { + "machine": "ord", + "position": "2" + }, + + "overrides": { + "extruder_nr": { + "default_value": 2, + "maximum_value": "4" + }, + "machine_nozzle_offset_x": { "default_value": 0.0 }, + "machine_nozzle_offset_y": { "default_value": 27.7 } + } +} diff --git a/resources/extruders/ord_extruder_3.def.json b/resources/extruders/ord_extruder_3.def.json new file mode 100644 index 0000000000..e8da77a6ec --- /dev/null +++ b/resources/extruders/ord_extruder_3.def.json @@ -0,0 +1,19 @@ +{ + "id": "ord_extruder_3", + "version": 2, + "name": "3", + "inherits": "fdmextruder", + "metadata": { + "machine": "ord", + "position": "3" + }, + + "overrides": { + "extruder_nr": { + "default_value": 3, + "maximum_value": "4" + }, + "machine_nozzle_offset_x": { "default_value": 63.18 }, + "machine_nozzle_offset_y": { "default_value": 28.65 } + } +} diff --git a/resources/extruders/ord_extruder_4.def.json b/resources/extruders/ord_extruder_4.def.json new file mode 100644 index 0000000000..aa6c8052bf --- /dev/null +++ b/resources/extruders/ord_extruder_4.def.json @@ -0,0 +1,19 @@ +{ + "id": "ord_extruder_4", + "version": 2, + "name": "4", + "inherits": "fdmextruder", + "metadata": { + "machine": "ord", + "position": "4" + }, + + "overrides": { + "extruder_nr": { + "default_value": 4, + "maximum_value": "4" + }, + "machine_nozzle_offset_x": { "default_value": 31.6 }, + "machine_nozzle_offset_y": { "default_value": 28.2 } + } +} diff --git a/resources/extruders/punchtec_connect_xl_extruder_left.def.json b/resources/extruders/punchtec_connect_xl_extruder_left.def.json new file mode 100644 index 0000000000..4bc6bc8b84 --- /dev/null +++ b/resources/extruders/punchtec_connect_xl_extruder_left.def.json @@ -0,0 +1,19 @@ +{ + "id": "punchtec_connect_xl_extruder_0", + "version": 2, + "name": "0", + "inherits": "fdmextruder", + "metadata": { + "machine": "ord", + "position": "0" + }, + + "overrides": { + "extruder_nr": { + "default_value": 0, + "maximum_value": "1" + }, + "machine_nozzle_offset_x": { "default_value": 0.0 }, + "machine_nozzle_offset_y": { "default_value": 0.0 } + } +} diff --git a/resources/extruders/punchtec_connect_xl_extruder_right.def.json b/resources/extruders/punchtec_connect_xl_extruder_right.def.json new file mode 100644 index 0000000000..f5df25c27c --- /dev/null +++ b/resources/extruders/punchtec_connect_xl_extruder_right.def.json @@ -0,0 +1,19 @@ +{ + "id": "punchtec_connect_xl_extruder_1", + "version": 2, + "name": "1", + "inherits": "fdmextruder", + "metadata": { + "machine": "ord", + "position": "1" + }, + + "overrides": { + "extruder_nr": { + "default_value": 1, + "maximum_value": "1" + }, + "machine_nozzle_offset_x": { "default_value": 0.0 }, + "machine_nozzle_offset_y": { "default_value": 0.0 } + } +} From e1409c4f83f0ddd6d785cde801d3e25d806fa127 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Sat, 22 Oct 2016 12:15:29 +0200 Subject: [PATCH 02/72] julia machine definition --- resources/definitions/julia.def.json | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 resources/definitions/julia.def.json diff --git a/resources/definitions/julia.def.json b/resources/definitions/julia.def.json new file mode 100644 index 0000000000..fecf1bd5c1 --- /dev/null +++ b/resources/definitions/julia.def.json @@ -0,0 +1,52 @@ +{ + "id": "julia", + "name": "julia", + "version": 2, + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Ultimaker", + "manufacturer": "Unknown", + "category": "Other", + "file_formats": "text/x-gcode", + "platform_offset": [ 0, 0, 0] + }, + + "overrides": { + "machine_start_gcode": { + "default_value": " ;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\n ;Print time: {print_time}\n ;Filament used: {filament_amount}m {filament_weight}g\n ;Filament cost: {filament_cost}\n G21 ;metric values\n M107\n G28\n G29\n G90 ;absolute positioning\n G92 E0; reset extruder distance\n G1 Z5 F300 ;move nozzle up 5mm for safe homing\n G1 X0 Y0 Z0 F5000; move nozzle to home\n M300 S600P200\n M300 S800 P200\n M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n M109 S{print_temperature} ;Uncomment to add your own temperature line\n M82 ;set extruder to absolute mode\n M107 ;start with the fan off\n G1 Z15.0 F{travel_speed} ;move the platform down 15mm\n G92 E0 ;zero the extruded length\n G1 F200 E3 ;extrude 3mm of feed stock\n G92 E0 ;zero the extruded length again\n G1 F{travel_speed}\n ;Put printing message on LCD screen\n M117 Printing...\n" + }, + "machine_end_gcode": { + "default_value": " M104 S0 ;extruder heater off\n M140 S0 ;heated bed heater off (if you have it)\n G91 ;relative positioning\n G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\n G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\n G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\n M84 ;steppers off\n G90 ;absolute positioning\n ;{profile_string}\n" + }, + "material_bed_temperature": { "default_value": 100 }, + "layer_height": { "default_value": 0.2 }, + "support_angle": { "default_value": 30 }, + "infill_overlap": { "default_value": 30 }, + "layer_height_0": { "default_value": 0.2 }, + "speed_print": { "default_value": 80 }, + "speed_wall_0": { "default_value": 30 }, + "speed_travel": { "default_value": 150 }, + "brim_line_count": { "default_value": 15 }, + "skin_overlap": { "default_value": 30 }, + "prime_tower_size": { "default_value": 8.660254037844387 }, + "material_diameter": { "default_value": 1.75 }, + "bottom_thickness": { "default_value": 0.8 }, + "retraction_amount": { "default_value": 3 }, + "speed_topbottom": { "default_value": 80 }, + "material_print_temperature": { "default_value": 230 }, + "support_pattern": { "default_value": "grid" }, + "speed_infill": { "default_value": 80 }, + "infill_sparse_density": { "default_value": 10 }, + "top_thickness": { "default_value": 0.8 }, + "machine_extruder_count": { "default_value": 1 }, + "retraction_combing": { "default_value": "off" }, + "machine_heated_bed": { "default_value": true }, + "machine_center_is_zero": { "default_value": false }, + "machine_height": { "default_value": 260 }, + "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, + "machine_depth": { "default_value": 250 }, + "machine_width": { "default_value": 210 }, + "machine_name": { "default_value": "Julia V2" } + } +} From eaf3c1f1dd6366c8befaef4b0685344dfb7f6f55 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sat, 22 Oct 2016 15:36:22 +0200 Subject: [PATCH 03/72] Correct machine reference --- resources/extruders/punchtec_connect_xl_extruder_left.def.json | 2 +- resources/extruders/punchtec_connect_xl_extruder_right.def.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/extruders/punchtec_connect_xl_extruder_left.def.json b/resources/extruders/punchtec_connect_xl_extruder_left.def.json index 4bc6bc8b84..b618999fc2 100644 --- a/resources/extruders/punchtec_connect_xl_extruder_left.def.json +++ b/resources/extruders/punchtec_connect_xl_extruder_left.def.json @@ -4,7 +4,7 @@ "name": "0", "inherits": "fdmextruder", "metadata": { - "machine": "ord", + "machine": "punchtec_connect_xl", "position": "0" }, diff --git a/resources/extruders/punchtec_connect_xl_extruder_right.def.json b/resources/extruders/punchtec_connect_xl_extruder_right.def.json index f5df25c27c..1173bb5584 100644 --- a/resources/extruders/punchtec_connect_xl_extruder_right.def.json +++ b/resources/extruders/punchtec_connect_xl_extruder_right.def.json @@ -4,7 +4,7 @@ "name": "1", "inherits": "fdmextruder", "metadata": { - "machine": "ord", + "machine": "punchtec_connect_xl", "position": "1" }, From 0597610388fe6faee4ced19e9ed1a8638f905ee7 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sat, 22 Oct 2016 15:37:28 +0200 Subject: [PATCH 04/72] Add known manufacturers, make capitalization consistent --- resources/definitions/bfb.def.json | 2 +- resources/definitions/julia.def.json | 4 ++-- resources/definitions/kupido.def.json | 2 +- resources/definitions/makerbotreplicator.def.json | 2 +- resources/definitions/ord.def.json | 4 ++-- resources/definitions/punchtec_connect_xl.def.json | 2 +- resources/definitions/rigid3d.def.json | 2 +- resources/definitions/rigid3d_3rdgen.def.json | 4 ++-- resources/definitions/rigid3d_hobby.def.json | 4 ++-- resources/definitions/rigid3d_zero.def.json | 4 ++-- resources/definitions/robo_3d_r1.def.json | 4 ++-- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/resources/definitions/bfb.def.json b/resources/definitions/bfb.def.json index 8f883dc8d7..b685b3d94d 100644 --- a/resources/definitions/bfb.def.json +++ b/resources/definitions/bfb.def.json @@ -6,7 +6,7 @@ "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "BFB", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] diff --git a/resources/definitions/julia.def.json b/resources/definitions/julia.def.json index fecf1bd5c1..8d908de5e0 100644 --- a/resources/definitions/julia.def.json +++ b/resources/definitions/julia.def.json @@ -1,12 +1,12 @@ { "id": "julia", - "name": "julia", + "name": "Julia", "version": 2, "inherits": "fdmprinter", "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "Fracktal", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] diff --git a/resources/definitions/kupido.def.json b/resources/definitions/kupido.def.json index ce0a65741f..2555a14e89 100644 --- a/resources/definitions/kupido.def.json +++ b/resources/definitions/kupido.def.json @@ -6,7 +6,7 @@ "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "Kupido", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] diff --git a/resources/definitions/makerbotreplicator.def.json b/resources/definitions/makerbotreplicator.def.json index 115fd4bd21..9c49f301bd 100644 --- a/resources/definitions/makerbotreplicator.def.json +++ b/resources/definitions/makerbotreplicator.def.json @@ -6,7 +6,7 @@ "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "MakerBot", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] diff --git a/resources/definitions/ord.def.json b/resources/definitions/ord.def.json index ffa6d2be74..7b954298f7 100644 --- a/resources/definitions/ord.def.json +++ b/resources/definitions/ord.def.json @@ -1,12 +1,12 @@ { "id": "ord", - "name": "Ord", + "name": "ORD", "version": 2, "inherits": "fdmprinter", "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "ORD Solutions", "category": "Other", "file_formats": "text/x-gcode", "machine_extruder_trains": diff --git a/resources/definitions/punchtec_connect_xl.def.json b/resources/definitions/punchtec_connect_xl.def.json index 81b71b9cb0..e9d63cbb33 100644 --- a/resources/definitions/punchtec_connect_xl.def.json +++ b/resources/definitions/punchtec_connect_xl.def.json @@ -6,7 +6,7 @@ "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "Punchtec", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] diff --git a/resources/definitions/rigid3d.def.json b/resources/definitions/rigid3d.def.json index e067c6147e..b167646f6e 100644 --- a/resources/definitions/rigid3d.def.json +++ b/resources/definitions/rigid3d.def.json @@ -6,7 +6,7 @@ "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "Rigid3D", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] diff --git a/resources/definitions/rigid3d_3rdgen.def.json b/resources/definitions/rigid3d_3rdgen.def.json index 4df0466df5..e7c73ed54d 100644 --- a/resources/definitions/rigid3d_3rdgen.def.json +++ b/resources/definitions/rigid3d_3rdgen.def.json @@ -1,12 +1,12 @@ { "id": "rigid3d_3rdgen", - "name": "rigid3d_3rdGen", + "name": "Rigid3D 3rdGen", "version": 2, "inherits": "fdmprinter", "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "Rigid3D", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] diff --git a/resources/definitions/rigid3d_hobby.def.json b/resources/definitions/rigid3d_hobby.def.json index fe46a3c7d6..09ba77f63c 100644 --- a/resources/definitions/rigid3d_hobby.def.json +++ b/resources/definitions/rigid3d_hobby.def.json @@ -1,12 +1,12 @@ { "id": "rigid3d_hobby", - "name": "RIGID3D HOBBY", + "name": "Rigid3D Hobby", "version": 2, "inherits": "fdmprinter", "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "Rigid3D", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] diff --git a/resources/definitions/rigid3d_zero.def.json b/resources/definitions/rigid3d_zero.def.json index a3e254c1a3..e5b24baa4d 100644 --- a/resources/definitions/rigid3d_zero.def.json +++ b/resources/definitions/rigid3d_zero.def.json @@ -1,12 +1,12 @@ { "id": "rigid3d_zero", - "name": "Rigid3d_Zero", + "name": "Rigid3D Zero", "version": 2, "inherits": "fdmprinter", "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "Rigid3D", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] diff --git a/resources/definitions/robo_3d_r1.def.json b/resources/definitions/robo_3d_r1.def.json index fa84b74e0d..4ba3f2eb73 100644 --- a/resources/definitions/robo_3d_r1.def.json +++ b/resources/definitions/robo_3d_r1.def.json @@ -1,12 +1,12 @@ { "id": "robo_3d_r1", - "name": "ROBO 3D R1", + "name": "Robo R1", "version": 2, "inherits": "fdmprinter", "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "Robo 3D", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] From 0bc50523d623bc0f7ba31eeede6c600de7a3c40a Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Sat, 22 Oct 2016 16:20:20 +0200 Subject: [PATCH 05/72] JSON feat: retract_at_layer_change (CURA-2780) --- resources/definitions/fdmprinter.def.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index abe6a3e378..61c0f091ae 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1215,6 +1215,14 @@ "settable_per_mesh": false, "settable_per_extruder": true }, + "retract_at_layer_change":{ + "label": "Retract at Layer Change", + "description": "Retract the filament when the nozzle is moving to the next layer.", + "type": "bool", + "default_value": false, + "settable_per_mesh": false, + "settable_per_extruder": true + }, "retraction_amount": { "label": "Retraction Distance", From 6752a184350ddc0126aa8788f1d092201353ac92 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 7 Nov 2016 14:02:19 +0100 Subject: [PATCH 06/72] Add dialog to set number of copies when duplicating models --- cura/CuraApplication.py | 3 +- resources/qml/Cura.qml | 9 +++- resources/qml/MultiplyObjectOptions.qml | 66 +++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 resources/qml/MultiplyObjectOptions.qml diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 59e5a15f71..532a60b58c 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -686,10 +686,9 @@ class CuraApplication(QtApplication): while current_node.getParent() and current_node.getParent().callDecoration("isGroup"): current_node = current_node.getParent() - new_node = copy.deepcopy(current_node) - op = GroupedOperation() for _ in range(count): + new_node = copy.deepcopy(current_node) op.addOperation(AddSceneNodeOperation(new_node, current_node.getParent())) op.push() diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 021178e6db..5380eaf7ca 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -605,6 +605,11 @@ UM.MainWindow } } + MultiplyObjectOptions + { + id: multiplyObjectOptions + } + Connections { target: Cura.Actions.multiplyObject @@ -612,7 +617,9 @@ UM.MainWindow { if(objectContextMenu.objectId != 0) { - Printer.multiplyObject(objectContextMenu.objectId, 1); + multiplyObjectOptions.objectId = objectContextMenu.objectId; + multiplyObjectOptions.visible = true; + multiplyObjectOptions.reset(); objectContextMenu.objectId = 0; } } diff --git a/resources/qml/MultiplyObjectOptions.qml b/resources/qml/MultiplyObjectOptions.qml new file mode 100644 index 0000000000..a55d7e0cdc --- /dev/null +++ b/resources/qml/MultiplyObjectOptions.qml @@ -0,0 +1,66 @@ +// Copyright (c) 2015 Ultimaker B.V. +// Cura is released under the terms of the AGPLv3 or higher. + +import QtQuick 2.2 +import QtQuick.Controls 1.1 +import QtQuick.Window 2.1 + +import UM 1.1 as UM + +UM.Dialog +{ + id: base + + //: Dialog title + title: catalog.i18nc("@title:window", "Duplicate Model") + + minimumWidth: 400 * Screen.devicePixelRatio + minimumHeight: 80 * Screen.devicePixelRatio + width: minimumWidth + height: minimumHeight + + property int objectId: 0; + onAccepted: Printer.multiplyObject(base.objectId, parseInt(copiesField.text)) + + property variant catalog: UM.I18nCatalog { name: "cura" } + + signal reset() + onReset: { + copiesField.text = "1"; + copiesField.selectAll(); + copiesField.focus = true; + } + + Row + { + spacing: UM.Theme.getSize("default_margin").width + + Label { + text: "Number of copies:" + anchors.verticalCenter: copiesField.verticalCenter + } + + TextField { + id: copiesField + validator: RegExpValidator { regExp: /^\d{0,2}/ } + maximumLength: 2 + } + } + + + rightButtons: + [ + Button + { + text: catalog.i18nc("@action:button","OK") + onClicked: base.accept() + enabled: base.objectId != 0 && parseInt(copiesField.text) > 0 + }, + Button + { + text: catalog.i18nc("@action:button","Cancel") + onClicked: base.reject() + } + ] +} + From 0ce4b5f2de7b7c61d439fbfa520059b18da37843 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 7 Nov 2016 14:07:06 +0100 Subject: [PATCH 07/72] Add "..." to Duplicate Model menu entry to indicate there is a dialog --- resources/qml/Actions.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index e88b7e77ea..d03070d7e7 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -232,7 +232,7 @@ Item Action { id: multiplyObjectAction; - text: catalog.i18nc("@action:inmenu","&Duplicate Model"); + text: catalog.i18nc("@action:inmenu","&Duplicate Model..."); iconName: "edit-duplicate" } From 71d015eeec1d86cb23ea72e4b95f52e90a7e4cf0 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 7 Nov 2016 15:17:32 +0100 Subject: [PATCH 08/72] JSON fix: no initial layer temperature commands for the UM2 family (CURA-2781, CURA-2736) --- resources/definitions/ultimaker2.def.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/definitions/ultimaker2.def.json b/resources/definitions/ultimaker2.def.json index c26a3a8856..be04b0b5a7 100644 --- a/resources/definitions/ultimaker2.def.json +++ b/resources/definitions/ultimaker2.def.json @@ -89,9 +89,15 @@ "material_print_temperature": { "enabled": "not (material_flow_dependent_temperature) and machine_gcode_flavor != \"UltiGCode\"" }, + "material_print_temperature_layer_0": { + "enabled": "machine_gcode_flavor != \"UltiGCode\"" + }, "material_bed_temperature": { "enabled": "machine_heated_bed and machine_gcode_flavor != \"UltiGCode\"" }, + "material_bed_temperature_layer_0": { + "enabled": "machine_heated_bed and machine_gcode_flavor != \"UltiGCode\"" + }, "machine_max_feedrate_x": { "default_value": 300 }, From f014a87494fd6a8eb8d30489abba8d8ef6c36dbd Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 7 Nov 2016 15:18:43 +0100 Subject: [PATCH 09/72] JSON fix: no standby temperature for single extrusion machines and UM2 family (CURA-2781, CURA-2736) --- resources/definitions/fdmprinter.def.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 00b755bf7d..7fd872c96e 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1385,6 +1385,7 @@ "minimum_value": "-273.15", "minimum_value_warning": "0", "maximum_value_warning": "260", + "enabled": "machine_extruder_count > 1 and machine_gcode_flavor != \"UltiGCode\"", "settable_per_mesh": false, "settable_per_extruder": true }, From 3a69d916360d39fdf1ffc80e27fd5b1f161b6fa6 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 7 Nov 2016 15:25:32 +0100 Subject: [PATCH 10/72] JSON refactor: move UltiGcode setting enabled dependency to fdmprinter (CURA-2781, CURA-2736) --- resources/definitions/fdmprinter.def.json | 18 ++++++++------ resources/definitions/ultimaker2.def.json | 30 ----------------------- 2 files changed, 10 insertions(+), 38 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 7fd872c96e..0e3aa79bcb 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1148,7 +1148,7 @@ "minimum_value": "-273.15", "minimum_value_warning": "0", "maximum_value_warning": "260", - "enabled": "not (material_flow_dependent_temperature)", + "enabled": "not (material_flow_dependent_temperature) and machine_gcode_flavor != \"UltiGCode\"", "settable_per_mesh": false, "settable_per_extruder": true }, @@ -1163,7 +1163,7 @@ "minimum_value": "-273.15", "minimum_value_warning": "0", "maximum_value_warning": "260", - "enabled": "not (material_flow_dependent_temperature)", + "enabled": "machine_gcode_flavor != \"UltiGCode\"", "settable_per_mesh": false, "settable_per_extruder": true }, @@ -1204,7 +1204,7 @@ "minimum_value": "-273.15", "minimum_value_warning": "0", "maximum_value_warning": "260", - "enabled": "machine_heated_bed", + "enabled": "machine_heated_bed and machine_gcode_flavor != \"UltiGCode\"", "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": false @@ -1220,7 +1220,7 @@ "minimum_value": "-273.15", "minimum_value_warning": "0", "maximum_value_warning": "260", - "enabled": "machine_heated_bed", + "enabled": "machine_heated_bed and machine_gcode_flavor != \"UltiGCode\"", "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": false @@ -1235,6 +1235,7 @@ "minimum_value": "0.0001", "minimum_value_warning": "0.4", "maximum_value_warning": "3.5", + "enabled": "machine_gcode_flavor != \"UltiGCode\"", "settable_per_mesh": false, "settable_per_extruder": true }, @@ -1248,6 +1249,7 @@ "minimum_value": "5", "minimum_value_warning": "50", "maximum_value_warning": "150", + "enabled": "machine_gcode_flavor != \"UltiGCode\"", "settable_per_mesh": true }, "retraction_enable": @@ -1268,7 +1270,7 @@ "default_value": 6.5, "minimum_value_warning": "-0.0001", "maximum_value_warning": "10.0", - "enabled": "retraction_enable", + "enabled": "retraction_enable and machine_gcode_flavor != \"UltiGCode\"", "settable_per_mesh": false, "settable_per_extruder": true }, @@ -1283,7 +1285,7 @@ "minimum_value_warning": "1", "maximum_value": "machine_max_feedrate_e", "maximum_value_warning": "70", - "enabled": "retraction_enable", + "enabled": "retraction_enable and machine_gcode_flavor != \"UltiGCode\"", "settable_per_mesh": false, "settable_per_extruder": true, "children": @@ -1299,7 +1301,7 @@ "maximum_value": "machine_max_feedrate_e", "minimum_value_warning": "1", "maximum_value_warning": "70", - "enabled": "retraction_enable", + "enabled": "retraction_enable and machine_gcode_flavor != \"UltiGCode\"", "value": "retraction_speed", "settable_per_mesh": false, "settable_per_extruder": true @@ -1315,7 +1317,7 @@ "maximum_value": "machine_max_feedrate_e", "minimum_value_warning": "1", "maximum_value_warning": "70", - "enabled": "retraction_enable", + "enabled": "retraction_enable and machine_gcode_flavor != \"UltiGCode\"", "value": "retraction_speed", "settable_per_mesh": false, "settable_per_extruder": true diff --git a/resources/definitions/ultimaker2.def.json b/resources/definitions/ultimaker2.def.json index be04b0b5a7..84e09113f3 100644 --- a/resources/definitions/ultimaker2.def.json +++ b/resources/definitions/ultimaker2.def.json @@ -86,18 +86,6 @@ "machine_nozzle_expansion_angle": { "default_value": 45 }, - "material_print_temperature": { - "enabled": "not (material_flow_dependent_temperature) and machine_gcode_flavor != \"UltiGCode\"" - }, - "material_print_temperature_layer_0": { - "enabled": "machine_gcode_flavor != \"UltiGCode\"" - }, - "material_bed_temperature": { - "enabled": "machine_heated_bed and machine_gcode_flavor != \"UltiGCode\"" - }, - "material_bed_temperature_layer_0": { - "enabled": "machine_heated_bed and machine_gcode_flavor != \"UltiGCode\"" - }, "machine_max_feedrate_x": { "default_value": 300 }, @@ -112,24 +100,6 @@ }, "machine_acceleration": { "default_value": 3000 - }, - "material_diameter": { - "enabled": "machine_gcode_flavor != \"UltiGCode\"" - }, - "material_flow": { - "enabled": "machine_gcode_flavor != \"UltiGCode\"" - }, - "retraction_amount": { - "enabled": "retraction_enable and machine_gcode_flavor != \"UltiGCode\"" - }, - "retraction_speed": { - "enabled": "retraction_enable and machine_gcode_flavor != \"UltiGCode\"" - }, - "retraction_retract_speed": { - "enabled": "retraction_enable and machine_gcode_flavor != \"UltiGCode\"" - }, - "retraction_prime_speed": { - "enabled": "retraction_enable and machine_gcode_flavor != \"UltiGCode\"" } } } From eeff3b65ec972031d99b06580b50e57cc1d8cb44 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 9 Nov 2016 09:27:44 +0100 Subject: [PATCH 11/72] Change wording from "duplicate" to "multiply" --- resources/qml/Actions.qml | 2 +- resources/qml/MultiplyObjectOptions.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index d03070d7e7..043552d768 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -232,7 +232,7 @@ Item Action { id: multiplyObjectAction; - text: catalog.i18nc("@action:inmenu","&Duplicate Model..."); + text: catalog.i18nc("@action:inmenu","&Multiply Model..."); iconName: "edit-duplicate" } diff --git a/resources/qml/MultiplyObjectOptions.qml b/resources/qml/MultiplyObjectOptions.qml index a55d7e0cdc..7756ab074b 100644 --- a/resources/qml/MultiplyObjectOptions.qml +++ b/resources/qml/MultiplyObjectOptions.qml @@ -12,7 +12,7 @@ UM.Dialog id: base //: Dialog title - title: catalog.i18nc("@title:window", "Duplicate Model") + title: catalog.i18nc("@title:window", "Multiply Model") minimumWidth: 400 * Screen.devicePixelRatio minimumHeight: 80 * Screen.devicePixelRatio From ba0fba08444746a6952508d58bc8c03312eeb48d Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Wed, 9 Nov 2016 12:55:31 +0100 Subject: [PATCH 12/72] Bump the Python version number for Cura. CURA-2150 Upgrade to PyQt 5.6 and Python 3.5 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c591ffa625..a18c4585d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ if(NOT ${URANIUM_SCRIPTS_DIR} STREQUAL "") CREATE_TRANSLATION_TARGETS() endif() -find_package(PythonInterp 3.4.0 REQUIRED) +find_package(PythonInterp 3.5.0 REQUIRED) install(DIRECTORY resources DESTINATION ${CMAKE_INSTALL_DATADIR}/cura) From 35a3bdc9242eedcb3905856bf584f3efb5fbbbda Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 9 Nov 2016 13:18:15 +0100 Subject: [PATCH 13/72] Fix qml error about stopCamera when no printer is connected --- resources/qml/Cura.qml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 5380eaf7ca..5c5a1cdc9d 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -424,6 +424,10 @@ UM.MainWindow visible: base.monitoringPrint onVisibleChanged: { + if(Cura.MachineManager.printerOutputDevices.length == 0 ) + { + return; + } if(visible) { Cura.MachineManager.printerOutputDevices[0].startCamera() From 189e3e30d9eb097aea53f67e0c28c1663e2b0fba Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 9 Nov 2016 13:25:04 +0100 Subject: [PATCH 14/72] Fix error about casting undefined to QString --- resources/qml/Settings/SettingExtruder.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index ff30a7146e..82d7def5ce 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -21,7 +21,11 @@ SettingItem id: extruders_model onModelChanged: control.color = extruders_model.getItem(control.currentIndex).color } - property string color: extruders_model.getItem(control.currentIndex).color + property string color: + { + var model_color = extruders_model.getItem(control.currentIndex).color; + return (model_color) ? model_color : ""; + } textRole: "name" From 236723fc8dd49499189ad14de028a59810c6b5db Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 9 Nov 2016 16:20:34 +0100 Subject: [PATCH 15/72] Remove unused required argument on _startCamera and _stopCamera (they were probably there due to a copy/paste error, see _setJobState) CURA-2411 --- cura/PrinterOutputDevice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index f90566c30b..6eae259e1e 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -138,14 +138,14 @@ class PrinterOutputDevice(QObject, OutputDevice): def startCamera(self): self._startCamera() - def _startCamera(self, job_state): + def _startCamera(self): Logger.log("w", "_startCamera is not implemented by this output device") @pyqtSlot() def stopCamera(self): self._stopCamera() - def _stopCamera(self, job_state): + def _stopCamera(self): Logger.log("w", "_stopCamera is not implemented by this output device") @pyqtProperty(str, notify = jobNameChanged) From bba74328f1ee1222c409df0a2bdc182841657098 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Thu, 10 Nov 2016 13:42:41 +0100 Subject: [PATCH 16/72] fix: Deltabot manufacturer --- resources/definitions/deltabot.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/deltabot.def.json b/resources/definitions/deltabot.def.json index f625995019..5d36857e9e 100644 --- a/resources/definitions/deltabot.def.json +++ b/resources/definitions/deltabot.def.json @@ -6,7 +6,7 @@ "metadata": { "visible": true, "author": "Ultimaker", - "manufacturer": "Unknown", + "manufacturer": "Danny Lu", "category": "Other", "file_formats": "text/x-gcode", "platform_offset": [ 0, 0, 0] From 967e5c57764debf87a3f974a4b76f3d323e5d297 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Thu, 10 Nov 2016 13:43:55 +0100 Subject: [PATCH 17/72] fix: makerbot output file format: x3g --- resources/definitions/makerbotreplicator.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/makerbotreplicator.def.json b/resources/definitions/makerbotreplicator.def.json index 9c49f301bd..d762db67fc 100644 --- a/resources/definitions/makerbotreplicator.def.json +++ b/resources/definitions/makerbotreplicator.def.json @@ -8,7 +8,7 @@ "author": "Ultimaker", "manufacturer": "MakerBot", "category": "Other", - "file_formats": "text/x-gcode", + "file_formats": "application/x3g", "platform_offset": [ 0, 0, 0] }, From b86d8b481538fee1975bc31f3628a889a2f097c4 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Thu, 10 Nov 2016 13:45:45 +0100 Subject: [PATCH 18/72] removed default setting --- resources/definitions/rigid3d_zero.def.json | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/definitions/rigid3d_zero.def.json b/resources/definitions/rigid3d_zero.def.json index e5b24baa4d..d5f8c1ef6a 100644 --- a/resources/definitions/rigid3d_zero.def.json +++ b/resources/definitions/rigid3d_zero.def.json @@ -43,7 +43,6 @@ "layer_height": { "default_value": 0.25 }, "speed_print": { "default_value": 30 }, "machine_extruder_count": { "default_value": 1 }, - "machine_heated_bed": { "default_value": false }, "machine_center_is_zero": { "default_value": false }, "machine_height": { "default_value": 190 }, "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, From 98bbeae055251ebce998313aa8a4f2151ec9f016 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Thu, 10 Nov 2016 13:46:31 +0100 Subject: [PATCH 19/72] lil: rounding error --- resources/definitions/robo_3d_r1.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/robo_3d_r1.def.json b/resources/definitions/robo_3d_r1.def.json index 4ba3f2eb73..320eea613e 100644 --- a/resources/definitions/robo_3d_r1.def.json +++ b/resources/definitions/robo_3d_r1.def.json @@ -27,7 +27,7 @@ "material_bed_temperature": { "default_value": 60 }, "support_angle": { "default_value": 50 }, "speed_layer_0": { "default_value": 30 }, - "line_width": { "default_value": 0.39999999999999997 }, + "line_width": { "default_value": 0.4 }, "speed_infill": { "default_value": 60 }, "prime_tower_size": { "default_value": 8.660254037844387 }, "support_enable": { "default_value": true }, From 14e736d9ebfedc0826d7ad41c12751655244b907 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 10 Nov 2016 19:31:02 +0100 Subject: [PATCH 20/72] Add function to find the extruders that are used These are the extruders that are being used by the scene if it would currently be printed. You can ask the extruder stacks for stuff like the nozzle offset. This way we can determine the disallowed areas per extruder. Contributes to issue CURA-2625. --- cura/Settings/ExtruderManager.py | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index d3005a78fe..30370e417f 100644 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -5,6 +5,8 @@ from PyQt5.QtCore import pyqtSignal, pyqtProperty, pyqtSlot, QObject, QVariant # import UM.Application #To get the global container stack to find the current machine. import UM.Logger +from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator #To find which extruders are used in the scene. +from UM.Scene.SceneNode import SceneNode #To find which extruders are used in the scene. import UM.Settings.ContainerRegistry #Finding containers by ID. import UM.Settings.SettingFunction @@ -287,6 +289,57 @@ class ExtruderManager(QObject): result.append(stack.getProperty(setting_key, property)) return result + ## Gets the extruder stacks that are actually being used at the moment. + # + # An extruder stack is being used if it is the extruder to print any mesh + # with, or if it is the support infill extruder, the support interface + # extruder, or the bed adhesion extruder. + # + # If there are no extruders, this returns the global stack as a singleton + # list. + # + # \return A list of extruder stacks. + def getUsedExtruderStacks(self): + global_stack = UM.Application.getInstance().getGlobalContainerStack() + container_registry = UM.Settings.ContainerRegistry.getInstance() + + if global_stack.getProperty("machine_extruder_count", "value") == 0: #For single extrusion. + return [global_stack] + + used_extruder_stack_ids = set() + + #Get the extruders of all meshes in the scene. + support_enabled = False + support_interface_enabled = False + scene_root = UM.Application.getInstance().getController().getScene().getRoot() + meshes = [node for node in DepthFirstIterator(scene_root) if type(node) is SceneNode and node.isSelectable()] #Only use the nodes that will be printed. + for mesh in meshes: + extruder_stack_id = mesh.callDecoration("getActiveExtruder") + if not extruder_stack_id: #No per-object settings for this node. + extruder_stack_id = self.extruderIds["0"] + used_extruder_stack_ids.add(extruder_stack_id) + + #Get whether any of them use support. + per_mesh_stack = mesh.callDecoration("getStack") + if per_mesh_stack: + support_enabled |= per_mesh_stack.getProperty("support_enable", "value") + support_interface_enabled |= per_mesh_stack.getProperty("support_interface_enable", "value") + else: #Take the setting from the build extruder stack. + extruder_stack = container_registry.findContainerStacks(id = extruder_stack_id)[0] + support_enabled |= extruder_stack.getProperty("support_enable", "value") + support_interface_enabled |= extruder_stack.getProperty("support_enable", "value") + + #The support extruders. + if support_enabled: + used_extruder_stack_ids.add(self.extruderIds[str(global_stack.getProperty("support_infill_extruder_nr", "value"))]) + if support_interface_enabled: + used_extruder_stack_ids.add(self.extruderIds[str(global_stack.getProperty("support_interface_extruder_nr", "value"))]) + + #The platform adhesion extruder. Not used if using brim and brim width is 0. + if global_stack.getProperty("adhesion_type", "value") != "brim" or global_stack.getProperty("brim_line_count", "value") > 0: + used_extruder_stack_ids.add(self.extruderIds[str(global_stack.getProperty("adhesion_extruder_nr", "value"))]) + + return [container_registry.findContainerStacks(id = stack_id)[0] for stack_id in used_extruder_stack_ids] ## Removes the container stack and user profile for the extruders for a specific machine. # From a70e4c8120abeddb7855d6539948f41a0ee38485 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 11 Nov 2016 10:22:17 +0100 Subject: [PATCH 21/72] Fixed blurSettings UM.MainWindow does not derive from QML Item, so it does not have a forceActiveFocus() method. CURA-2835 --- resources/qml/Cura.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 5c5a1cdc9d..ab4d7bfd06 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -573,7 +573,7 @@ UM.MainWindow target: Cura.MachineManager onBlurSettings: { - forceActiveFocus() + contentItem.forceActiveFocus() } } From 1603930c5c9e7276c1ac5fb6c898a1e6be83b726 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 11:41:55 +0100 Subject: [PATCH 22/72] Extract computing static disallowed areas to different function These disallowed areas will have to move or get duplicated according to which nozzles are used. Eventually we'll want to compute these with their Minkowski additions only when needed (the skirt size changes), not when the used extruders change. This is also part of an effort to make this disallowed area computation a bit better structured. The behaviour should be the same. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 104 +++++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 45 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index c1a62c872b..97bc41566a 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -402,14 +402,14 @@ class BuildVolume(SceneNode): # Check if prime positions intersect with disallowed areas prime_collision = False - if disallowed_areas: - for area in disallowed_areas: - poly = Polygon(numpy.array(area, numpy.float32)) + for area in self._global_container_stack.getProperty("machine_disallowed_areas", "value"): + poly = Polygon(numpy.array(area, numpy.float32)) - # Minkowski with zero, to ensure that the polygon is correct & watertight. - poly = poly.getMinkowskiHull(Polygon.approximatedCircle(0)) - disallowed_polygons.append(poly) + # Minkowski with zero, to ensure that the polygon is correct & watertight. + poly = poly.getMinkowskiHull(Polygon.approximatedCircle(0)) + disallowed_polygons.append(poly) + if disallowed_polygons: extruder_manager = ExtruderManager.getInstance() extruders = extruder_manager.getMachineExtruders(self._global_container_stack.getId()) prime_polygons = [] @@ -450,46 +450,8 @@ class BuildVolume(SceneNode): disallowed_polygons.extend(prime_polygons) - disallowed_border_size = self._getEdgeDisallowedSize() - # Extend every area already in the disallowed_areas with the skirt size. - if disallowed_areas: - for poly in disallowed_polygons: - poly = poly.getMinkowskiHull(Polygon.approximatedCircle(disallowed_border_size)) - areas.append(poly) - - # Add the skirt areas around the borders of the build plate. - if disallowed_border_size > 0: - half_machine_width = self._global_container_stack.getProperty("machine_width", "value") / 2 - half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") / 2 - - areas.append(Polygon(numpy.array([ - [-half_machine_width, -half_machine_depth], - [-half_machine_width, half_machine_depth], - [-half_machine_width + disallowed_border_size, half_machine_depth - disallowed_border_size], - [-half_machine_width + disallowed_border_size, -half_machine_depth + disallowed_border_size] - ], numpy.float32))) - - areas.append(Polygon(numpy.array([ - [half_machine_width, half_machine_depth], - [half_machine_width, -half_machine_depth], - [half_machine_width - disallowed_border_size, -half_machine_depth + disallowed_border_size], - [half_machine_width - disallowed_border_size, half_machine_depth - disallowed_border_size] - ], numpy.float32))) - - areas.append(Polygon(numpy.array([ - [-half_machine_width, half_machine_depth], - [half_machine_width, half_machine_depth], - [half_machine_width - disallowed_border_size, half_machine_depth - disallowed_border_size], - [-half_machine_width + disallowed_border_size, half_machine_depth - disallowed_border_size] - ], numpy.float32))) - - areas.append(Polygon(numpy.array([ - [half_machine_width, -half_machine_depth], - [-half_machine_width, -half_machine_depth], - [-half_machine_width + disallowed_border_size, -half_machine_depth + disallowed_border_size], - [half_machine_width - disallowed_border_size, -half_machine_depth + disallowed_border_size] - ], numpy.float32))) + areas.extend(self._computeDisallowedAreasStatic()) # Check if the prime tower area intersects with any of the other areas. # If this is the case, add it to the error area's so it can be drawn in red. @@ -511,6 +473,58 @@ class BuildVolume(SceneNode): self._has_errors = prime_tower_collision or prime_collision self._disallowed_areas = areas + ## Computes the disallowed areas that are statically placed in the machine. + # + # These disallowed areas need to be offset with the negative of the nozzle + # offset to check if the disallowed areas are intersected. + # + # \return A list of polygons that represent the disallowed areas. These + # areas are not offset with any nozzle offset yet. + def _computeDisallowedAreasStatic(self): + result = [] + if not self._global_container_stack: + return result + disallowed_border_size = self._getEdgeDisallowedSize() + + machine_disallowed_areas = copy.deepcopy(self._global_container_stack.getProperty("machine_disallowed_areas", "value")) + if machine_disallowed_areas: + for area in machine_disallowed_areas: + polygon = Polygon(numpy.array(area, numpy.float32)) + polygon = polygon.getMinkowskiHull(Polygon.approximatedCircle(disallowed_border_size)) + result.append(polygon) + + #Add the border around the edge of the build volume. + if disallowed_border_size == 0: + return result #No need to add this border. + half_machine_width = self._global_container_stack.getProperty("machine_width", "value") / 2 + half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") / 2 + result.append(Polygon(numpy.array([ + [-half_machine_width, -half_machine_depth], + [-half_machine_width, half_machine_depth], + [-half_machine_width + disallowed_border_size, half_machine_depth - disallowed_border_size], + [-half_machine_width + disallowed_border_size, -half_machine_depth + disallowed_border_size] + ], numpy.float32))) + result.append(Polygon(numpy.array([ + [half_machine_width, half_machine_depth], + [half_machine_width, -half_machine_depth], + [half_machine_width - disallowed_border_size, -half_machine_depth + disallowed_border_size], + [half_machine_width - disallowed_border_size, half_machine_depth - disallowed_border_size] + ], numpy.float32))) + result.append(Polygon(numpy.array([ + [-half_machine_width, half_machine_depth], + [half_machine_width, half_machine_depth], + [half_machine_width - disallowed_border_size, half_machine_depth - disallowed_border_size], + [-half_machine_width + disallowed_border_size, half_machine_depth - disallowed_border_size] + ], numpy.float32))) + result.append(Polygon(numpy.array([ + [half_machine_width, -half_machine_depth], + [-half_machine_width, -half_machine_depth], + [-half_machine_width + disallowed_border_size, -half_machine_depth + disallowed_border_size], + [half_machine_width - disallowed_border_size, -half_machine_depth + disallowed_border_size] + ], numpy.float32))) + + return result + ## Private convenience function to get a setting from the adhesion # extruder. # From 49c5a90d29dec841e8c982d8a4bd08736b7e5c7e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 11:48:03 +0100 Subject: [PATCH 23/72] Remove unused variable This one is now moved to the _computeDisallowedAreasStatic function. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 97bc41566a..35707b91c8 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -378,8 +378,6 @@ class BuildVolume(SceneNode): self._has_errors = False # Reset. self._error_areas = [] - disallowed_areas = copy.deepcopy( - self._global_container_stack.getProperty("machine_disallowed_areas", "value")) areas = [] machine_width = self._global_container_stack.getProperty("machine_width", "value") From b6611b66f84f328190ca10c01ed17b49299f483f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 11:51:32 +0100 Subject: [PATCH 24/72] Remove unused intermediary value This is not used, unless you take multi-threading into account. In that case though, the actual disallowed areas are only updated at the end of this function, and the _has_errors variable is updated right before then as well, so this way the variable is in an invalid state for a smaller amount of time. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 35707b91c8..6f0a708ee2 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -376,7 +376,6 @@ class BuildVolume(SceneNode): if not self._global_container_stack: return - self._has_errors = False # Reset. self._error_areas = [] areas = [] From 77a6c459d8230f3dbbadb4ac5b5081e5871dde02 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 11:53:13 +0100 Subject: [PATCH 25/72] Move initialisation of areas closer to where it's used Makes the code more easy to follow. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 6f0a708ee2..54788ceb08 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -377,7 +377,6 @@ class BuildVolume(SceneNode): return self._error_areas = [] - areas = [] machine_width = self._global_container_stack.getProperty("machine_width", "value") machine_depth = self._global_container_stack.getProperty("machine_depth", "value") @@ -448,7 +447,7 @@ class BuildVolume(SceneNode): disallowed_polygons.extend(prime_polygons) # Extend every area already in the disallowed_areas with the skirt size. - areas.extend(self._computeDisallowedAreasStatic()) + areas = self._computeDisallowedAreasStatic() # Check if the prime tower area intersects with any of the other areas. # If this is the case, add it to the error area's so it can be drawn in red. From 42ee87c88ff82e5b5a3d4d82d805eb0c8b5c9247 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 11:54:50 +0100 Subject: [PATCH 26/72] Rename areas to result_areas Because we have 'areas', 'disallowed_areas', 'self._disallowed_areas', 'disallowed_polygons', and so on. This should reduce the confusion a bit. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 54788ceb08..aed1af769b 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -447,7 +447,7 @@ class BuildVolume(SceneNode): disallowed_polygons.extend(prime_polygons) # Extend every area already in the disallowed_areas with the skirt size. - areas = self._computeDisallowedAreasStatic() + result_areas = self._computeDisallowedAreasStatic() # Check if the prime tower area intersects with any of the other areas. # If this is the case, add it to the error area's so it can be drawn in red. @@ -456,18 +456,18 @@ class BuildVolume(SceneNode): if prime_tower_area: # Using Minkowski of 0 fixes the prime tower area so it's rendered correctly prime_tower_area = prime_tower_area.getMinkowskiHull(Polygon.approximatedCircle(0)) - for area in areas: + for area in result_areas: if prime_tower_area.intersectsPolygon(area) is not None: prime_tower_collision = True break if not prime_tower_collision: - areas.append(prime_tower_area) + result_areas.append(prime_tower_area) else: self._error_areas.append(prime_tower_area) # The buildplate has errors if either prime tower or prime has a colission. self._has_errors = prime_tower_collision or prime_collision - self._disallowed_areas = areas + self._disallowed_areas = result_areas ## Computes the disallowed areas that are statically placed in the machine. # From 3d9eb4f2be1c7b0011dd52b6cc1af100ef10da71 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 12:01:08 +0100 Subject: [PATCH 27/72] Move prime tower creation code closer to where it's used The check for collisions is only at the end, and after that it adds the polygon itself. We should keep the code closer together to make it more readable. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index aed1af769b..ad478976e1 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -380,20 +380,7 @@ class BuildVolume(SceneNode): machine_width = self._global_container_stack.getProperty("machine_width", "value") machine_depth = self._global_container_stack.getProperty("machine_depth", "value") - prime_tower_area = None - # Add prime tower location as disallowed area. - if ExtruderManager.getInstance().getResolveOrValue("prime_tower_enable") == True: - prime_tower_size = self._global_container_stack.getProperty("prime_tower_size", "value") - prime_tower_x = self._global_container_stack.getProperty("prime_tower_position_x", "value") - machine_width / 2 - prime_tower_y = - self._global_container_stack.getProperty("prime_tower_position_y", "value") + machine_depth / 2 - - prime_tower_area = Polygon([ - [prime_tower_x - prime_tower_size, prime_tower_y - prime_tower_size], - [prime_tower_x, prime_tower_y - prime_tower_size], - [prime_tower_x, prime_tower_y], - [prime_tower_x - prime_tower_size, prime_tower_y], - ]) disallowed_polygons = [] # Check if prime positions intersect with disallowed areas @@ -449,13 +436,25 @@ class BuildVolume(SceneNode): # Extend every area already in the disallowed_areas with the skirt size. result_areas = self._computeDisallowedAreasStatic() - # Check if the prime tower area intersects with any of the other areas. - # If this is the case, add it to the error area's so it can be drawn in red. - # If not, add it back to disallowed area's, so it's rendered as normal. + # Add prime tower location as disallowed area. prime_tower_collision = False - if prime_tower_area: + if ExtruderManager.getInstance().getResolveOrValue("prime_tower_enable") == True: + prime_tower_size = self._global_container_stack.getProperty("prime_tower_size", "value") + prime_tower_x = self._global_container_stack.getProperty("prime_tower_position_x", "value") - machine_width / 2 + prime_tower_y = - self._global_container_stack.getProperty("prime_tower_position_y", "value") + machine_depth / 2 + + prime_tower_area = Polygon([ + [prime_tower_x - prime_tower_size, prime_tower_y - prime_tower_size], + [prime_tower_x, prime_tower_y - prime_tower_size], + [prime_tower_x, prime_tower_y], + [prime_tower_x - prime_tower_size, prime_tower_y], + ]) # Using Minkowski of 0 fixes the prime tower area so it's rendered correctly prime_tower_area = prime_tower_area.getMinkowskiHull(Polygon.approximatedCircle(0)) + + #Check if the prime tower area intersects with any of the other areas. + #If this is the case, add it to the error area's so it can be drawn in red. + #If not, add it back to disallowed area's, so it's rendered as normal. for area in result_areas: if prime_tower_area.intersectsPolygon(area) is not None: prime_tower_collision = True @@ -465,6 +464,7 @@ class BuildVolume(SceneNode): result_areas.append(prime_tower_area) else: self._error_areas.append(prime_tower_area) + # The buildplate has errors if either prime tower or prime has a colission. self._has_errors = prime_tower_collision or prime_collision self._disallowed_areas = result_areas From a37ab8f4b1e61e3cc33c4e21d245cf688f2bfc83 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 12:46:53 +0100 Subject: [PATCH 28/72] Use approximated circle for the prime polygons It's much easier to create, more obvious code, and better approximates the area that we seek to use for our prime location. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index ad478976e1..d5d19b9bc7 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -401,13 +401,8 @@ class BuildVolume(SceneNode): prime_x = extruder.getProperty("extruder_prime_pos_x", "value") - machine_width / 2 prime_y = machine_depth / 2 - extruder.getProperty("extruder_prime_pos_y", "value") - prime_polygon = Polygon([ - [prime_x - PRIME_CLEARANCE, prime_y - PRIME_CLEARANCE], - [prime_x + PRIME_CLEARANCE, prime_y - PRIME_CLEARANCE], - [prime_x + PRIME_CLEARANCE, prime_y + PRIME_CLEARANCE], - [prime_x - PRIME_CLEARANCE, prime_y + PRIME_CLEARANCE], - ]) - prime_polygon = prime_polygon.getMinkowskiHull(Polygon.approximatedCircle(0)) + prime_polygon = Polygon.approximatedCircle(PRIME_CLEARANCE) + prime_polygon = prime_polygon.translate(prime_x, prime_y) collision = False # Check if prime polygon is intersecting with any of the other disallowed areas. @@ -469,6 +464,16 @@ class BuildVolume(SceneNode): self._has_errors = prime_tower_collision or prime_collision self._disallowed_areas = result_areas + ## Computes the disallowed areas for objects that are printed. + # + # These disallowed areas are not offset with the negative of the nozzle + # offset, since the engine already performs the offset for us to make sure + # they are printed in head-coordinates instead of nozzle-coordinates. + # + # \return A list of polygons that represent the disallowed areas. + def _computeDisallowedAreasPrinted(self): + result = [] + ## Computes the disallowed areas that are statically placed in the machine. # # These disallowed areas need to be offset with the negative of the nozzle From cfc9a7b6cfeb06567a9c05e040a4e092f043a774 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 13:03:34 +0100 Subject: [PATCH 29/72] Move prime tower area generation to separate function This function is named as if it could later include other printed pieces, but it is meant to only include pieces that have normal bed adhesion, so not the prime locations. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 47 ++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index d5d19b9bc7..4cb9ac3604 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -433,32 +433,18 @@ class BuildVolume(SceneNode): # Add prime tower location as disallowed area. prime_tower_collision = False - if ExtruderManager.getInstance().getResolveOrValue("prime_tower_enable") == True: - prime_tower_size = self._global_container_stack.getProperty("prime_tower_size", "value") - prime_tower_x = self._global_container_stack.getProperty("prime_tower_position_x", "value") - machine_width / 2 - prime_tower_y = - self._global_container_stack.getProperty("prime_tower_position_y", "value") + machine_depth / 2 - - prime_tower_area = Polygon([ - [prime_tower_x - prime_tower_size, prime_tower_y - prime_tower_size], - [prime_tower_x, prime_tower_y - prime_tower_size], - [prime_tower_x, prime_tower_y], - [prime_tower_x - prime_tower_size, prime_tower_y], - ]) - # Using Minkowski of 0 fixes the prime tower area so it's rendered correctly - prime_tower_area = prime_tower_area.getMinkowskiHull(Polygon.approximatedCircle(0)) - - #Check if the prime tower area intersects with any of the other areas. - #If this is the case, add it to the error area's so it can be drawn in red. - #If not, add it back to disallowed area's, so it's rendered as normal. + prime_tower_areas = self._computeDisallowedAreasPrinted() + for prime_tower_area in prime_tower_areas: for area in result_areas: if prime_tower_area.intersectsPolygon(area) is not None: prime_tower_collision = True break - - if not prime_tower_collision: - result_areas.append(prime_tower_area) - else: - self._error_areas.append(prime_tower_area) + if prime_tower_collision: #Already found a collision. + break + if not prime_tower_collision: + result_areas.extend(prime_tower_areas) + else: + self._error_areas.extend(prime_tower_areas) # The buildplate has errors if either prime tower or prime has a colission. self._has_errors = prime_tower_collision or prime_collision @@ -473,6 +459,23 @@ class BuildVolume(SceneNode): # \return A list of polygons that represent the disallowed areas. def _computeDisallowedAreasPrinted(self): result = [] + #Currently, the only normally printed object is the prime tower. + if ExtruderManager.getInstance().getResolveOrValue("prime_tower_enable") == True: + prime_tower_size = self._global_container_stack.getProperty("prime_tower_size", "value") + machine_width = self._global_container_stack.getProperty("machine_width", "value") + machine_depth = self._global_container_stack.getProperty("machine_depth", "value") + prime_tower_x = self._global_container_stack.getProperty("prime_tower_position_x", "value") - machine_width / 2 + prime_tower_y = - self._global_container_stack.getProperty("prime_tower_position_y", "value") + machine_depth / 2 + + prime_tower_area = Polygon([ + [prime_tower_x - prime_tower_size, prime_tower_y - prime_tower_size], + [prime_tower_x, prime_tower_y - prime_tower_size], + [prime_tower_x, prime_tower_y], + [prime_tower_x - prime_tower_size, prime_tower_y], + ]) + result.append(prime_tower_area) + + return result ## Computes the disallowed areas that are statically placed in the machine. # From 41c8371b86912d1ec734b2be1c64eacbee2024b8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 13:09:17 +0100 Subject: [PATCH 30/72] Compute _has_errors only from _error_areas This way we need fewer intermediary variables. It's also more robust and somewhat more elegant. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 4cb9ac3604..e0b93c1b82 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -384,7 +384,6 @@ class BuildVolume(SceneNode): disallowed_polygons = [] # Check if prime positions intersect with disallowed areas - prime_collision = False for area in self._global_container_stack.getProperty("machine_disallowed_areas", "value"): poly = Polygon(numpy.array(area, numpy.float32)) @@ -424,7 +423,6 @@ class BuildVolume(SceneNode): prime_polygons.append(prime_polygon) else: self._error_areas.append(prime_polygon) - prime_collision = collision or prime_collision disallowed_polygons.extend(prime_polygons) @@ -446,8 +444,7 @@ class BuildVolume(SceneNode): else: self._error_areas.extend(prime_tower_areas) - # The buildplate has errors if either prime tower or prime has a colission. - self._has_errors = prime_tower_collision or prime_collision + self._has_errors = len(self._error_areas) > 0 self._disallowed_areas = result_areas ## Computes the disallowed areas for objects that are printed. From ccccf62bf768299e81fd8a32701e098972b532d1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 14:18:08 +0100 Subject: [PATCH 31/72] Repair showing build volume We needed to apply the Minkowski hull on the polygon or it would be disjunct and wouldn't show up in the interface. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index e0b93c1b82..2af3b21e62 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -470,6 +470,7 @@ class BuildVolume(SceneNode): [prime_tower_x, prime_tower_y], [prime_tower_x - prime_tower_size, prime_tower_y], ]) + prime_tower_area = prime_tower_area.getMinkowskiHull(Polygon.approximatedCircle(0)) result.append(prime_tower_area) return result From 45db315f774b7cfdeedd5b3081284afdcfd86c22 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 15:10:39 +0100 Subject: [PATCH 32/72] Fix adding prime locations to final disallowed areas They were added to several intermediary variables, but not to the final result. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 2af3b21e62..8f59ae8d32 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -378,6 +378,8 @@ class BuildVolume(SceneNode): self._error_areas = [] + result_areas = self._computeDisallowedAreasStatic() + machine_width = self._global_container_stack.getProperty("machine_width", "value") machine_depth = self._global_container_stack.getProperty("machine_depth", "value") @@ -402,6 +404,7 @@ class BuildVolume(SceneNode): prime_polygon = Polygon.approximatedCircle(PRIME_CLEARANCE) prime_polygon = prime_polygon.translate(prime_x, prime_y) + prime_polygon = prime_polygon.getMinkowskiHull(Polygon.approximatedCircle(0)) collision = False # Check if prime polygon is intersecting with any of the other disallowed areas. @@ -424,10 +427,7 @@ class BuildVolume(SceneNode): else: self._error_areas.append(prime_polygon) - disallowed_polygons.extend(prime_polygons) - - # Extend every area already in the disallowed_areas with the skirt size. - result_areas = self._computeDisallowedAreasStatic() + result_areas.extend(prime_polygons) # Add prime tower location as disallowed area. prime_tower_collision = False From bcd4dd3aeb6b9f4588e39919f13460bad44c4464 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 15:14:15 +0100 Subject: [PATCH 33/72] Fix applying skirt radius to prime locations This makes the prime locations equal to what it was before. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 8f59ae8d32..63d54d07f4 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -378,6 +378,7 @@ class BuildVolume(SceneNode): self._error_areas = [] + disallowed_border_size = self._getEdgeDisallowedSize() result_areas = self._computeDisallowedAreasStatic() machine_width = self._global_container_stack.getProperty("machine_width", "value") @@ -404,7 +405,7 @@ class BuildVolume(SceneNode): prime_polygon = Polygon.approximatedCircle(PRIME_CLEARANCE) prime_polygon = prime_polygon.translate(prime_x, prime_y) - prime_polygon = prime_polygon.getMinkowskiHull(Polygon.approximatedCircle(0)) + prime_polygon = prime_polygon.getMinkowskiHull(Polygon.approximatedCircle(disallowed_border_size)) collision = False # Check if prime polygon is intersecting with any of the other disallowed areas. From ec057c72a6e40a864f8d19197e4c0b6cbe1b82ee Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 15:16:43 +0100 Subject: [PATCH 34/72] Compute disallowed border size only once We pass it on through a parameter instead of computing it again in the function. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 63d54d07f4..1d96ef8385 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -379,7 +379,7 @@ class BuildVolume(SceneNode): self._error_areas = [] disallowed_border_size = self._getEdgeDisallowedSize() - result_areas = self._computeDisallowedAreasStatic() + result_areas = self._computeDisallowedAreasStatic(disallowed_border_size) machine_width = self._global_container_stack.getProperty("machine_width", "value") machine_depth = self._global_container_stack.getProperty("machine_depth", "value") @@ -481,49 +481,50 @@ class BuildVolume(SceneNode): # These disallowed areas need to be offset with the negative of the nozzle # offset to check if the disallowed areas are intersected. # + # \param border_size The size with which to offset the disallowed areas + # due to skirt, brim, travel avoid distance, etc. # \return A list of polygons that represent the disallowed areas. These # areas are not offset with any nozzle offset yet. - def _computeDisallowedAreasStatic(self): + def _computeDisallowedAreasStatic(self, border_size): result = [] if not self._global_container_stack: return result - disallowed_border_size = self._getEdgeDisallowedSize() machine_disallowed_areas = copy.deepcopy(self._global_container_stack.getProperty("machine_disallowed_areas", "value")) if machine_disallowed_areas: for area in machine_disallowed_areas: polygon = Polygon(numpy.array(area, numpy.float32)) - polygon = polygon.getMinkowskiHull(Polygon.approximatedCircle(disallowed_border_size)) + polygon = polygon.getMinkowskiHull(Polygon.approximatedCircle(border_size)) result.append(polygon) #Add the border around the edge of the build volume. - if disallowed_border_size == 0: + if border_size == 0: return result #No need to add this border. half_machine_width = self._global_container_stack.getProperty("machine_width", "value") / 2 half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") / 2 result.append(Polygon(numpy.array([ [-half_machine_width, -half_machine_depth], [-half_machine_width, half_machine_depth], - [-half_machine_width + disallowed_border_size, half_machine_depth - disallowed_border_size], - [-half_machine_width + disallowed_border_size, -half_machine_depth + disallowed_border_size] + [-half_machine_width + border_size, half_machine_depth - border_size], + [-half_machine_width + border_size, -half_machine_depth + border_size] ], numpy.float32))) result.append(Polygon(numpy.array([ [half_machine_width, half_machine_depth], [half_machine_width, -half_machine_depth], - [half_machine_width - disallowed_border_size, -half_machine_depth + disallowed_border_size], - [half_machine_width - disallowed_border_size, half_machine_depth - disallowed_border_size] + [half_machine_width - border_size, -half_machine_depth + border_size], + [half_machine_width - border_size, half_machine_depth - border_size] ], numpy.float32))) result.append(Polygon(numpy.array([ [-half_machine_width, half_machine_depth], [half_machine_width, half_machine_depth], - [half_machine_width - disallowed_border_size, half_machine_depth - disallowed_border_size], - [-half_machine_width + disallowed_border_size, half_machine_depth - disallowed_border_size] + [half_machine_width - border_size, half_machine_depth - border_size], + [-half_machine_width + border_size, half_machine_depth - border_size] ], numpy.float32))) result.append(Polygon(numpy.array([ [half_machine_width, -half_machine_depth], [-half_machine_width, -half_machine_depth], - [-half_machine_width + disallowed_border_size, -half_machine_depth + disallowed_border_size], - [half_machine_width - disallowed_border_size, -half_machine_depth + disallowed_border_size] + [-half_machine_width + border_size, -half_machine_depth + border_size], + [half_machine_width - border_size, -half_machine_depth + border_size] ], numpy.float32))) return result From 3571ed2d7a7b6ab3482e5d3ee367501223f3e4b8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 15:44:32 +0100 Subject: [PATCH 35/72] Expand disallowed border beyond build volume This way we can offset it with the nozzle offset and it would still cover all the way to the edge. The disallowed areas are clipped to the build volume anyway. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 1d96ef8385..907f31bddd 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -500,31 +500,31 @@ class BuildVolume(SceneNode): #Add the border around the edge of the build volume. if border_size == 0: return result #No need to add this border. - half_machine_width = self._global_container_stack.getProperty("machine_width", "value") / 2 - half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") / 2 + machine_width = self._global_container_stack.getProperty("machine_width", "value") + machine_depth = self._global_container_stack.getProperty("machine_depth", "value") result.append(Polygon(numpy.array([ - [-half_machine_width, -half_machine_depth], - [-half_machine_width, half_machine_depth], - [-half_machine_width + border_size, half_machine_depth - border_size], - [-half_machine_width + border_size, -half_machine_depth + border_size] + [-machine_width * 1.5, -machine_width * 1.5], #Times 1.5 because that makes it still extend over the entire build volume if the nozzle offset is the entire machine width. + [-machine_width * 1.5, machine_depth * 1.5], + [-machine_width / 2 + border_size, machine_depth / 2 - border_size], + [-machine_width / 2 + border_size, -machine_depth / 2 + border_size] ], numpy.float32))) result.append(Polygon(numpy.array([ - [half_machine_width, half_machine_depth], - [half_machine_width, -half_machine_depth], - [half_machine_width - border_size, -half_machine_depth + border_size], - [half_machine_width - border_size, half_machine_depth - border_size] + [machine_width * 1.5, machine_depth * 1.5], + [machine_width * 1.5, -machine_depth * 1.5], + [machine_width / 2 - border_size, -machine_depth / 2 + border_size], + [machine_width / 2 - border_size, machine_depth / 2 - border_size] ], numpy.float32))) result.append(Polygon(numpy.array([ - [-half_machine_width, half_machine_depth], - [half_machine_width, half_machine_depth], - [half_machine_width - border_size, half_machine_depth - border_size], - [-half_machine_width + border_size, half_machine_depth - border_size] + [-machine_width * 1.5, machine_depth * 1.5], + [machine_width * 1.5, machine_depth * 1.5], + [machine_width / 2 - border_size, machine_depth / 2 - border_size], + [-machine_width / 2 + border_size, machine_depth / 2 - border_size] ], numpy.float32))) result.append(Polygon(numpy.array([ - [half_machine_width, -half_machine_depth], - [-half_machine_width, -half_machine_depth], - [-half_machine_width + border_size, -half_machine_depth + border_size], - [half_machine_width - border_size, -half_machine_depth + border_size] + [machine_width * 1.5, -machine_depth * 1.5], + [-machine_width * 1.5, -machine_depth * 1.5], + [-machine_width / 2 + border_size, -machine_depth / 2 + border_size], + [machine_width / 2 - border_size, -machine_depth / 2 + border_size] ], numpy.float32))) return result From 4b02171db604e5ca2a61aaf9406b6fd7f00099fa Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 16:26:58 +0100 Subject: [PATCH 36/72] Compute disallowed areas per-extruder This computes the disallowed areas of the machine, the disallowed border and the prime tower per extruder. The prime locations are not yet calculated per extruder, but I'd like to extract it to a function before I try that. Warning: Cura will not run at this stage. Please await the next commits. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 125 +++++++++++++++++++++++++------------------- 1 file changed, 71 insertions(+), 54 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 907f31bddd..928785d553 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -378,8 +378,10 @@ class BuildVolume(SceneNode): self._error_areas = [] + extruder_manager = ExtruderManager.getInstance() + used_extruders = extruder_manager.getUsedExtruderStacks() disallowed_border_size = self._getEdgeDisallowedSize() - result_areas = self._computeDisallowedAreasStatic(disallowed_border_size) + result_areas = self._computeDisallowedAreasStatic(disallowed_border_size, used_extruders) machine_width = self._global_container_stack.getProperty("machine_width", "value") machine_depth = self._global_container_stack.getProperty("machine_depth", "value") @@ -395,7 +397,6 @@ class BuildVolume(SceneNode): disallowed_polygons.append(poly) if disallowed_polygons: - extruder_manager = ExtruderManager.getInstance() extruders = extruder_manager.getMachineExtruders(self._global_container_stack.getId()) prime_polygons = [] # Each extruder has it's own prime location @@ -432,7 +433,7 @@ class BuildVolume(SceneNode): # Add prime tower location as disallowed area. prime_tower_collision = False - prime_tower_areas = self._computeDisallowedAreasPrinted() + prime_tower_areas = self._computeDisallowedAreasPrinted(used_extruders) for prime_tower_area in prime_tower_areas: for area in result_areas: if prime_tower_area.intersectsPolygon(area) is not None: @@ -448,15 +449,19 @@ class BuildVolume(SceneNode): self._has_errors = len(self._error_areas) > 0 self._disallowed_areas = result_areas - ## Computes the disallowed areas for objects that are printed. + ## Computes the disallowed areas for objects that are printed with print + # features. # - # These disallowed areas are not offset with the negative of the nozzle - # offset, since the engine already performs the offset for us to make sure - # they are printed in head-coordinates instead of nozzle-coordinates. + # This means that the brim, travel avoidance and such will be applied to + # these features. # - # \return A list of polygons that represent the disallowed areas. - def _computeDisallowedAreasPrinted(self): - result = [] + # \return A dictionary with for each used extruder ID the disallowed areas + # where that extruder may not print. + def _computeDisallowedAreasPrinted(self, used_extruders): + result = {} + for extruder in used_extruders: + result[extruder.getId()] = [] + #Currently, the only normally printed object is the prime tower. if ExtruderManager.getInstance().getResolveOrValue("prime_tower_enable") == True: prime_tower_size = self._global_container_stack.getProperty("prime_tower_size", "value") @@ -472,60 +477,72 @@ class BuildVolume(SceneNode): [prime_tower_x - prime_tower_size, prime_tower_y], ]) prime_tower_area = prime_tower_area.getMinkowskiHull(Polygon.approximatedCircle(0)) - result.append(prime_tower_area) + for extruder in used_extruders: + result[extruder.getId()].append(prime_tower_area) #The prime tower location is the same for each extruder, regardless of offset. return result ## Computes the disallowed areas that are statically placed in the machine. # - # These disallowed areas need to be offset with the negative of the nozzle - # offset to check if the disallowed areas are intersected. + # It computes different disallowed areas depending on the offset of the + # extruder. The resulting dictionary will therefore have an entry for each + # extruder that is used. # # \param border_size The size with which to offset the disallowed areas # due to skirt, brim, travel avoid distance, etc. - # \return A list of polygons that represent the disallowed areas. These - # areas are not offset with any nozzle offset yet. - def _computeDisallowedAreasStatic(self, border_size): - result = [] - if not self._global_container_stack: - return result + # \param used_extruders The extruder stacks to generate disallowed areas + # for. + # \return A dictionary with for each used extruder ID the disallowed areas + # where that extruder may not print. + def _computeDisallowedAreasStatic(self, border_size, used_extruders): + #Convert disallowed areas to polygons and dilate them. + machine_disallowed_polygons = [] + for area in self._global_container_stack.getProperty("machine_disallowed_areas", "value"): + polygon = Polygon(numpy.array(area, numpy.float32)) + polygon = polygon.getMinkowskiHull(Polygon.approximatedCircle(border_size)) + machine_disallowed_polygons.append(polygon) - machine_disallowed_areas = copy.deepcopy(self._global_container_stack.getProperty("machine_disallowed_areas", "value")) - if machine_disallowed_areas: - for area in machine_disallowed_areas: - polygon = Polygon(numpy.array(area, numpy.float32)) - polygon = polygon.getMinkowskiHull(Polygon.approximatedCircle(border_size)) - result.append(polygon) + result = {} + for extruder in used_extruders: + extruder_id = extruder.getId() + offset_x = extruder.getProperty("machine_nozzle_offset_x", "value") + offset_y = extruder.getProperty("machine_nozzle_offset_y", "value") + result[extruder_id] = [] - #Add the border around the edge of the build volume. - if border_size == 0: - return result #No need to add this border. - machine_width = self._global_container_stack.getProperty("machine_width", "value") - machine_depth = self._global_container_stack.getProperty("machine_depth", "value") - result.append(Polygon(numpy.array([ - [-machine_width * 1.5, -machine_width * 1.5], #Times 1.5 because that makes it still extend over the entire build volume if the nozzle offset is the entire machine width. - [-machine_width * 1.5, machine_depth * 1.5], - [-machine_width / 2 + border_size, machine_depth / 2 - border_size], - [-machine_width / 2 + border_size, -machine_depth / 2 + border_size] - ], numpy.float32))) - result.append(Polygon(numpy.array([ - [machine_width * 1.5, machine_depth * 1.5], - [machine_width * 1.5, -machine_depth * 1.5], - [machine_width / 2 - border_size, -machine_depth / 2 + border_size], - [machine_width / 2 - border_size, machine_depth / 2 - border_size] - ], numpy.float32))) - result.append(Polygon(numpy.array([ - [-machine_width * 1.5, machine_depth * 1.5], - [machine_width * 1.5, machine_depth * 1.5], - [machine_width / 2 - border_size, machine_depth / 2 - border_size], - [-machine_width / 2 + border_size, machine_depth / 2 - border_size] - ], numpy.float32))) - result.append(Polygon(numpy.array([ - [machine_width * 1.5, -machine_depth * 1.5], - [-machine_width * 1.5, -machine_depth * 1.5], - [-machine_width / 2 + border_size, -machine_depth / 2 + border_size], - [machine_width / 2 - border_size, -machine_depth / 2 + border_size] - ], numpy.float32))) + for polygon in machine_disallowed_polygons: + result[extruder_id].append(polygon.translate(offset_x, offset_y)) #Compensate for the nozzle offset of this extruder. + + #Add the border around the edge of the build volume. + half_machine_width = self._global_container_stack.getProperty("machine_width", "value") + half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") + if border_size + offset_x > 0: + result[extruder_id].append(Polygon(numpy.array([ + [-half_machine_width, -half_machine_depth], + [-half_machine_width, half_machine_depth], + [-half_machine_width + border_size + offset_x, half_machine_depth - border_size + offset_y], + [-half_machine_width + border_size + offset_x, -half_machine_depth + border_size + offset_y] + ], numpy.float32))) + if border_size - offset_x > 0: + result[extruder_id].append(Polygon(numpy.array([ + [half_machine_width, half_machine_depth], + [half_machine_width, -half_machine_depth], + [half_machine_width - border_size + offset_x, -half_machine_depth + border_size + offset_y], + [half_machine_width - border_size + offset_x, half_machine_depth - border_size + offset_y] + ], numpy.float32))) + if border_size - offset_y > 0: + result[extruder_id].append(Polygon(numpy.array([ + [-half_machine_width, half_machine_depth], + [half_machine_width, half_machine_depth], + [half_machine_width - border_size, half_machine_depth - border_size], + [-half_machine_width + border_size, half_machine_depth - border_size] + ], numpy.float32))) + if border_size + offset_y > 0: + result[extruder_id].append(Polygon(numpy.array([ + [half_machine_width, -half_machine_depth], + [-half_machine_width, -half_machine_depth], + [-half_machine_width + border_size, -half_machine_depth + border_size], + [half_machine_width - border_size, -half_machine_depth + border_size] + ], numpy.float32))) return result From fb92e50262c481d990c88904265aaf4987b31d63 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Fri, 11 Nov 2016 16:28:43 +0100 Subject: [PATCH 37/72] JSON fix: fixed all start/end gcode references to settings and non-existent variables --- resources/definitions/innovo_inventor.def.json | 2 +- resources/definitions/julia.def.json | 4 ++-- resources/definitions/kupido.def.json | 4 ++-- resources/definitions/rigidbot.def.json | 4 ++-- resources/definitions/rigidbot_big.def.json | 4 ++-- resources/definitions/robo_3d_r1.def.json | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/resources/definitions/innovo_inventor.def.json b/resources/definitions/innovo_inventor.def.json index 48c3ace5d9..40a2849979 100644 --- a/resources/definitions/innovo_inventor.def.json +++ b/resources/definitions/innovo_inventor.def.json @@ -54,7 +54,7 @@ "default_value": "RepRap (Marlin/Sprinter)" }, "machine_start_gcode": { - "default_value": "G28 ; Home extruder\nM107 ; Turn off fan\nG90 ; Absolute positioning\nM82 ; Extruder in absolute mode\n{IF_BED}M190 S{BED}\n{IF_EXT0}M104 T0 S{TEMP0}\n{IF_EXT0}M109 T0 S{TEMP0}\n{IF_EXT1}M104 T1 S{TEMP1}\n{IF_EXT1}M109 T1 S{TEMP1}\nG32 S3 ; auto level\nG92 E0 ; Reset extruder position" + "default_value": "G28 ; Home extruder\nM107 ; Turn off fan\nG90 ; Absolute positioning\nM82 ; Extruder in absolute mode\nM190 S{material_bed_temperature}\nM104 T0 S{material_print_temperature}\nM109 T0 S{material_print_temperature}\nM104 T1 S{material_print_temperature}\nM109 T1 S{material_print_temperature}\nG32 S3 ; auto level\nG92 E0 ; Reset extruder position" }, "machine_end_gcode": { "default_value": "M104 S0 ; turn off extruders\nM140 S0 ; heated bed heater off\nG91 ; relative positioning\nG1 E-2 F5000; retract 2mm\nG28 Z; move bed down\nG90 ; absolute positioning\nM84 ; disable motors" diff --git a/resources/definitions/julia.def.json b/resources/definitions/julia.def.json index 8d908de5e0..a0eda65bb7 100644 --- a/resources/definitions/julia.def.json +++ b/resources/definitions/julia.def.json @@ -14,10 +14,10 @@ "overrides": { "machine_start_gcode": { - "default_value": " ;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\n ;Print time: {print_time}\n ;Filament used: {filament_amount}m {filament_weight}g\n ;Filament cost: {filament_cost}\n G21 ;metric values\n M107\n G28\n G29\n G90 ;absolute positioning\n G92 E0; reset extruder distance\n G1 Z5 F300 ;move nozzle up 5mm for safe homing\n G1 X0 Y0 Z0 F5000; move nozzle to home\n M300 S600P200\n M300 S800 P200\n M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n M109 S{print_temperature} ;Uncomment to add your own temperature line\n M82 ;set extruder to absolute mode\n M107 ;start with the fan off\n G1 Z15.0 F{travel_speed} ;move the platform down 15mm\n G92 E0 ;zero the extruded length\n G1 F200 E3 ;extrude 3mm of feed stock\n G92 E0 ;zero the extruded length again\n G1 F{travel_speed}\n ;Put printing message on LCD screen\n M117 Printing...\n" + "default_value": " ;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_sparse_density}\n ;metric values\n M107\n G28\n G29\n G90 ;absolute positioning\n G92 E0; reset extruder distance\n G1 Z5 F300 ;move nozzle up 5mm for safe homing\n G1 X0 Y0 Z0 F5000; move nozzle to home\n M300 S600P200\n M300 S800 P200\n M190 S{material_bed_temperature} ;Uncomment to add your own bed temperature line\n M109 S{material_print_temperature} ;Uncomment to add your own temperature line\n M82 ;set extruder to absolute mode\n M107 ;start with the fan off\n G1 Z15.0 F{speed_travel} ;move the platform down 15mm\n G92 E0 ;zero the extruded length\n G1 F200 E3 ;extrude 3mm of feed stock\n G92 E0 ;zero the extruded length again\n G1 F{speed_travel}\n ;Put printing message on LCD screen\n M117 Printing...\n" }, "machine_end_gcode": { - "default_value": " M104 S0 ;extruder heater off\n M140 S0 ;heated bed heater off (if you have it)\n G91 ;relative positioning\n G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\n G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\n G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\n M84 ;steppers off\n G90 ;absolute positioning\n ;{profile_string}\n" + "default_value": " M104 S0 ;extruder heater off\n M140 S0 ;heated bed heater off (if you have it)\n G91 ;relative positioning\n G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\n G1 Z+0.5 E-5 X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\n G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\n M84 ;steppers off\n G90 ;absolute positioning\n" }, "material_bed_temperature": { "default_value": 100 }, "layer_height": { "default_value": 0.2 }, diff --git a/resources/definitions/kupido.def.json b/resources/definitions/kupido.def.json index 2555a14e89..97be1a0152 100644 --- a/resources/definitions/kupido.def.json +++ b/resources/definitions/kupido.def.json @@ -15,10 +15,10 @@ "overrides": { "machine_name": { "default_value": "Kupido" }, "machine_start_gcode": { - "default_value": " ;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\n ;Print time: {print_time}\n ;Filament used: {filament_amount}m {filament_weight}g\n ;Filament cost: {filament_cost}\n ;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n ;M109 S{print_temperature} ;Uncomment to add your own temperature line\n G21 ;metric values\n G90 ;absolute positioning\n M82 ;set extruder to absolute mode\n M107 ;start with the fan off\n G28 X0 Y0 ;move X Y to endstops\n G28 Z0 ;move Z to endstops\n G1 Z20.0 F{40} ;move the platform down 20mm\n G1 Y0 X170 F{travel_speed}\n G92 E0 ;zero the extruded length\n G1 F200 E10 ;extrude 3mm of feed stock\n G92 E0 ;zero the extruded length again\n G4 P7000\n G1 F{travel_speed}\n ;Put printing message on LCD screen\n M117 Printing...\n" + "default_value": " ;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_sparse_density}\n ;M190 S{material_bed_temperature} ;Uncomment to add your own bed temperature line\n ;M109 S{material_print_temperature} ;Uncomment to add your own temperature line\n G21 ;metric values\n G90 ;absolute positioning\n M82 ;set extruder to absolute mode\n M107 ;start with the fan off\n G28 X0 Y0 ;move X Y to endstops\n G28 Z0 ;move Z to endstops\n G1 Z20.0 F40 ;move the platform down 20mm\n G1 Y0 X170 F{speed_travel}\n G92 E0 ;zero the extruded length\n G1 F200 E10 ;extrude 3mm of feed stock\n G92 E0 ;zero the extruded length again\n G4 P7000\n G1 F{speed_travel}\n ;Put printing message on LCD screen\n M117 Printing...\n" }, "machine_end_gcode": { - "default_value": " M104 S0 ;extruder heater off\n M140 S0 ;heated bed heater off (if you have it)\n G91 ;relative positioning\n G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\n G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\n G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\n M84 ;steppers off\n G90 ;absolute positioning\n ;{profile_string}\n" + "default_value": " M104 S0 ;extruder heater off\n M140 S0 ;heated bed heater off (if you have it)\n G91 ;relative positioning\n G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\n G1 Z+0.5 E-5 X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\n G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\n M84 ;steppers off\n G90 ;absolute positioning\n" }, "prime_tower_size": { "default_value": 8.660254037844387 }, "retraction_speed": { "default_value": 60 }, diff --git a/resources/definitions/rigidbot.def.json b/resources/definitions/rigidbot.def.json index 8b268410f9..9dbde35921 100644 --- a/resources/definitions/rigidbot.def.json +++ b/resources/definitions/rigidbot.def.json @@ -39,10 +39,10 @@ "default_value": "RepRap (Marlin/Sprinter)" }, "machine_start_gcode": { - "default_value": ";Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_sparse_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\n;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n;M109 S{print_temperature} ;Uncomment to add your own temperature line\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nM205 X8 ;X/Y Jerk settings\nG1 Z15.0 F{travel_speed} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E7 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{travel_speed}\n;Put printing message on LCD screen\nM117 Rigibot Printing..." + "default_value": ";Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_sparse_density}\n;M190 S{material_bed_temperature} ;Uncomment to add your own bed temperature line\n;M109 S{material_print_temperature} ;Uncomment to add your own temperature line\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nM205 X8 ;X/Y Jerk settings\nG1 Z15.0 F{travel_speed} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E7 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{speed_travel}\n;Put printing message on LCD screen\nM117 Rigibot Printing..." }, "machine_end_gcode": { - "default_value": ";End GCode\nM104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+10 E-1 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG1 Y230 F3000 ;move Y so the head is out of the way and Plate is moved forward\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}" + "default_value": ";End GCode\nM104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+10 E-1 X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG1 Y230 F3000 ;move Y so the head is out of the way and Plate is moved forward\nM84 ;steppers off\nG90 ;absolute positioning" }, "layer_height": { "default_value": 0.2 diff --git a/resources/definitions/rigidbot_big.def.json b/resources/definitions/rigidbot_big.def.json index f8cf1e1da0..6ac84cbde1 100644 --- a/resources/definitions/rigidbot_big.def.json +++ b/resources/definitions/rigidbot_big.def.json @@ -42,10 +42,10 @@ "default_value": "RepRap (Marlin/Sprinter)" }, "machine_start_gcode": { - "default_value": ";Sliced at: {day} {date} {time}\n;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_sparse_density}\n;Print time: {print_time}\n;Filament used: {filament_amount}m {filament_weight}g\n;Filament cost: {filament_cost}\n;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line\n;M109 S{print_temperature} ;Uncomment to add your own temperature line\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nM205 X8 ;X/Y Jerk settings\nG1 Z15.0 F{travel_speed} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E7 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{travel_speed}\n;Put printing message on LCD screen\nM117 Rigibot Printing..." + "default_value": ";Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {infill_sparse_density}\n;Print time: {print_time}\n;M190 S{material_bed_temperature} ;Uncomment to add your own bed temperature line\n;M109 S{material_print_temperature} ;Uncomment to add your own temperature line\nG21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nM205 X8 ;X/Y Jerk settings\nG1 Z15.0 F{speed_travel} ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E7 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F{speed_travel}\n;Put printing message on LCD screen\nM117 Rigibot Printing..." }, "machine_end_gcode": { - "default_value": ";End GCode\nM104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+10 E-1 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG1 Y230 F3000 ;move Y so the head is out of the way and Plate is moved forward\nM84 ;steppers off\nG90 ;absolute positioning\n;{profile_string}" + "default_value": ";End GCode\nM104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+10 E-1 X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nG1 Y230 F3000 ;move Y so the head is out of the way and Plate is moved forward\nM84 ;steppers off\nG90 ;absolute positioning" }, "layer_height": { "default_value": 0.2 diff --git a/resources/definitions/robo_3d_r1.def.json b/resources/definitions/robo_3d_r1.def.json index 320eea613e..a566ba9f23 100644 --- a/resources/definitions/robo_3d_r1.def.json +++ b/resources/definitions/robo_3d_r1.def.json @@ -17,7 +17,7 @@ "default_value": " G92 E0 ;\n M565 Z-1 ;\n G1 Z5 F5000 ;\n G29 ;\n" }, "machine_end_gcode": { - "default_value": " M104 S0 ;extruder heater off\n M140 S0 ;heated bed heater off (if you have it)\n G91 ;relative positioning\n G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\n G1 Z+0.5 E-5 X-20 Y-20 F{travel_speed} ;move Z up a bit and retract filament even more\n G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\n M84 ;steppers off\n G90 ;absolute positioning\n ;{profile_string}\n" + "default_value": " M104 S0 ;extruder heater off\n M140 S0 ;heated bed heater off (if you have it)\n G91 ;relative positioning\n G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\n G1 Z+0.5 E-5 X-20 Y-20 F{speed_travel} ;move Z up a bit and retract filament even more\n G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\n M84 ;steppers off\n G90 ;absolute positioning\n" }, "cool_min_layer_time": { "default_value": 7 }, "speed_topbottom": { "default_value": 40 }, From 1c445a151281f42b0de128dbe5374d9b9de95b3c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 16:55:07 +0100 Subject: [PATCH 38/72] Move computing disallowed areas to separate function The results are checked for intersection in the main update function, and then it crashes because the main function doesn't expect per-extruder disallowed areas yet from the rest. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 95 ++++++++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 41 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 928785d553..9b67072e0e 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -381,55 +381,41 @@ class BuildVolume(SceneNode): extruder_manager = ExtruderManager.getInstance() used_extruders = extruder_manager.getUsedExtruderStacks() disallowed_border_size = self._getEdgeDisallowedSize() - result_areas = self._computeDisallowedAreasStatic(disallowed_border_size, used_extruders) - machine_width = self._global_container_stack.getProperty("machine_width", "value") - machine_depth = self._global_container_stack.getProperty("machine_depth", "value") + result_areas = self._computeDisallowedAreasStatic(disallowed_border_size, used_extruders) #Normal machine disallowed areas can always be added. + prime_areas = self._computeDisallowedAreasPrime(disallowed_border_size, used_extruders) + prime_disallowed_areas = self._computeDisallowedAreasStatic(0, used_extruders) #Where the priming is not allowed to happen. This is not added to the result, just for collision checking. - disallowed_polygons = [] + #Check if prime positions intersect with disallowed areas. + for extruder in used_extruders: + extruder_id = extruder.getId() - # Check if prime positions intersect with disallowed areas - for area in self._global_container_stack.getProperty("machine_disallowed_areas", "value"): - poly = Polygon(numpy.array(area, numpy.float32)) - - # Minkowski with zero, to ensure that the polygon is correct & watertight. - poly = poly.getMinkowskiHull(Polygon.approximatedCircle(0)) - disallowed_polygons.append(poly) - - if disallowed_polygons: - extruders = extruder_manager.getMachineExtruders(self._global_container_stack.getId()) - prime_polygons = [] - # Each extruder has it's own prime location - for extruder in extruders: - prime_x = extruder.getProperty("extruder_prime_pos_x", "value") - machine_width / 2 - prime_y = machine_depth / 2 - extruder.getProperty("extruder_prime_pos_y", "value") - - prime_polygon = Polygon.approximatedCircle(PRIME_CLEARANCE) - prime_polygon = prime_polygon.translate(prime_x, prime_y) - prime_polygon = prime_polygon.getMinkowskiHull(Polygon.approximatedCircle(disallowed_border_size)) - collision = False - - # Check if prime polygon is intersecting with any of the other disallowed areas. - # Note that we check the prime area without bed adhesion. - for poly in disallowed_polygons: - if prime_polygon.intersectsPolygon(poly) is not None: + collision = False + for prime_polygon in prime_areas[extruder_id]: + for disallowed_polygon in prime_disallowed_areas: + if prime_polygon.intersectsPolygon(disallowed_polygon) is not None: collision = True break + if collision: + break - # Also collide with other prime positions - for poly in prime_polygons: - if prime_polygon.intersectsPolygon(poly) is not None: - collision = True + #Also check other prime positions (without additional offset). + for other_extruder_id in prime_areas: + if extruder_id == other_extruder_id: #It is allowed to collide with itself. + continue + for other_prime_polygon in prime_areas[other_extruder_id]: + if prime_polygon.intersectsPolygon(other_prime_polygon): + collision = True + break + if collision: break + if collision: + break - if not collision: - # Prime area is valid. Add as normal. - # Once it's added like this, it will recieve a bed adhesion offset, just like the others. - prime_polygons.append(prime_polygon) - else: - self._error_areas.append(prime_polygon) - result_areas.extend(prime_polygons) + if not collision: + #Prime areas are valid. Add as normal. + result_areas[extruder_id].extend(prime_areas[extruder_id]) # Add prime tower location as disallowed area. prime_tower_collision = False @@ -467,7 +453,7 @@ class BuildVolume(SceneNode): prime_tower_size = self._global_container_stack.getProperty("prime_tower_size", "value") machine_width = self._global_container_stack.getProperty("machine_width", "value") machine_depth = self._global_container_stack.getProperty("machine_depth", "value") - prime_tower_x = self._global_container_stack.getProperty("prime_tower_position_x", "value") - machine_width / 2 + prime_tower_x = self._global_container_stack.getProperty("prime_tower_position_x", "value") - machine_width / 2 #Offset by half machine_width and _depth to put the origin in the front-left. prime_tower_y = - self._global_container_stack.getProperty("prime_tower_position_y", "value") + machine_depth / 2 prime_tower_area = Polygon([ @@ -482,6 +468,33 @@ class BuildVolume(SceneNode): return result + ## Computes the disallowed areas for the prime locations. + # + # These are special because they are not subject to things like brim or + # travel avoidance. They do get a dilute with the border size though + # because they may not intersect with brims and such of other objects. + # + # \param border_size The size with which to offset the disallowed areas + # due to skirt, brim, travel avoid distance, etc. + # \param used_extruders The extruder stacks to generate disallowed areas + # for. + # \return A dictionary with for each used extruder ID the prime areas. + def _computeDisallowedAreasPrime(self, border_size, used_extruders): + result = {} + + machine_width = self._global_container_stack.getProperty("machine_width", "value") + machine_depth = self._global_container_stack.getProperty("machine_depth", "value") + for extruder in used_extruders: + prime_x = extruder.getProperty("extruder_prime_pos_x", "value") - machine_width / 2 #Offset by half machine_width and _depth to put the origin in the front-left. + prime_y = machine_depth / 2 - extruder.getProperty("extruder_prime_pos_y", "value") + + prime_polygon = Polygon.approximatedCircle(PRIME_CLEARANCE) + prime_polygon = prime_polygon.translate(prime_x, prime_y) + prime_polygon = prime_polygon.getMinkowskiHull(Polygon.approximatedCircle(border_size)) + result[extruder.getId()] = [prime_polygon] + + return result + ## Computes the disallowed areas that are statically placed in the machine. # # It computes different disallowed areas depending on the offset of the From a8d36c9116b146caf280ed18f895ac580f07a76a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 16:58:25 +0100 Subject: [PATCH 39/72] Fix iteration over prime-disallowed areas Oops. prime_disallowed_areas is a dictionary per extruder. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 9b67072e0e..5c4dcaa1d9 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -392,7 +392,7 @@ class BuildVolume(SceneNode): collision = False for prime_polygon in prime_areas[extruder_id]: - for disallowed_polygon in prime_disallowed_areas: + for disallowed_polygon in prime_disallowed_areas[extruder_id]: if prime_polygon.intersectsPolygon(disallowed_polygon) is not None: collision = True break From edcf7320f0fea5451d7a931b8af0cbb71ebbfeec Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 17:00:32 +0100 Subject: [PATCH 40/72] Interpret prime tower areas per extruder The function gives results per extruder now, so we should interpret that instead of crashing. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 5c4dcaa1d9..0080ecfd81 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -420,17 +420,18 @@ class BuildVolume(SceneNode): # Add prime tower location as disallowed area. prime_tower_collision = False prime_tower_areas = self._computeDisallowedAreasPrinted(used_extruders) - for prime_tower_area in prime_tower_areas: - for area in result_areas: - if prime_tower_area.intersectsPolygon(area) is not None: - prime_tower_collision = True + for extruder_id in prime_tower_areas: + for prime_tower_area in prime_tower_areas[extruder_id]: + for area in result_areas[extruder_id]: + if prime_tower_area.intersectsPolygon(area) is not None: + prime_tower_collision = True + break + if prime_tower_collision: #Already found a collision. break - if prime_tower_collision: #Already found a collision. - break - if not prime_tower_collision: - result_areas.extend(prime_tower_areas) - else: - self._error_areas.extend(prime_tower_areas) + if not prime_tower_collision: + result_areas[extruder_id].extend(prime_tower_areas) + else: + self._error_areas.extend(prime_tower_areas) self._has_errors = len(self._error_areas) > 0 self._disallowed_areas = result_areas From 57f88ea0483edbf55b158d326cb179bd78549b7b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 17:02:01 +0100 Subject: [PATCH 41/72] Mush disallowed areas of all extruders together The final result needs to be just a list. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 0080ecfd81..16dfd680c2 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -434,7 +434,10 @@ class BuildVolume(SceneNode): self._error_areas.extend(prime_tower_areas) self._has_errors = len(self._error_areas) > 0 - self._disallowed_areas = result_areas + + self._disallowed_areas = [] + for extruder_id in result_areas: + self._disallowed_areas.extend(result_areas[extruder_id]) ## Computes the disallowed areas for objects that are printed with print # features. From a72d47c2a424d65df1f3d37ecc290bfff24e577e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 17:06:47 +0100 Subject: [PATCH 42/72] Fix adding prime tower locations to disallowed areas Otherwise just a string gets added, which gives an error when the disallowed areas are being built as meshes. The front-end runs again, though the disallowed areas seem to be wrong now. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 16dfd680c2..97ab5fae18 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -429,9 +429,9 @@ class BuildVolume(SceneNode): if prime_tower_collision: #Already found a collision. break if not prime_tower_collision: - result_areas[extruder_id].extend(prime_tower_areas) + result_areas[extruder_id].extend(prime_tower_areas[extruder_id]) else: - self._error_areas.extend(prime_tower_areas) + self._error_areas.extend(prime_tower_areas[extruder_id]) self._has_errors = len(self._error_areas) > 0 From 066ccc4e51a4d6398350f158c155995e604ec85e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 17:10:23 +0100 Subject: [PATCH 43/72] Remove superfluous disabling of prime location settings These are already disabled in the definitions of fdmprinter and fdmextruder. It doesn't need to be disabled again. Contributes to issue CURA-2625. --- resources/definitions/ultimaker3.def.json | 2 -- .../extruders/ultimaker3_extended_extruder_left.def.json | 6 +++--- .../extruders/ultimaker3_extended_extruder_right.def.json | 6 +++--- resources/extruders/ultimaker3_extruder_left.def.json | 6 +++--- resources/extruders/ultimaker3_extruder_right.def.json | 6 +++--- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index 653185b9ca..342c5c4a8e 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -74,8 +74,6 @@ "prime_tower_position_x": { "default_value": 175 }, "prime_tower_position_y": { "default_value": 179 }, - "extruder_prime_pos_x": { "enabled": false }, - "extruder_prime_pos_y": { "enabled": false }, "print_sequence": {"enabled": false}, "acceleration_enabled": { "value": "True" }, diff --git a/resources/extruders/ultimaker3_extended_extruder_left.def.json b/resources/extruders/ultimaker3_extended_extruder_left.def.json index 918d544fd9..81b5e5c1a2 100644 --- a/resources/extruders/ultimaker3_extended_extruder_left.def.json +++ b/resources/extruders/ultimaker3_extended_extruder_left.def.json @@ -23,8 +23,8 @@ "machine_extruder_end_pos_x": { "default_value": 213 }, "machine_extruder_end_pos_y": { "default_value": 207 }, "machine_nozzle_head_distance": { "default_value": 2.7 }, - "extruder_prime_pos_x": { "default_value": 170, "enabled": false }, - "extruder_prime_pos_y": { "default_value": 6, "enabled": false }, - "extruder_prime_pos_z": { "default_value": 2, "enabled": false } + "extruder_prime_pos_x": { "default_value": 170 }, + "extruder_prime_pos_y": { "default_value": 6 }, + "extruder_prime_pos_z": { "default_value": 2 } } } diff --git a/resources/extruders/ultimaker3_extended_extruder_right.def.json b/resources/extruders/ultimaker3_extended_extruder_right.def.json index 130f31deaa..c98ad46c52 100644 --- a/resources/extruders/ultimaker3_extended_extruder_right.def.json +++ b/resources/extruders/ultimaker3_extended_extruder_right.def.json @@ -23,8 +23,8 @@ "machine_extruder_end_pos_x": { "default_value": 213 }, "machine_extruder_end_pos_y": { "default_value": 189 }, "machine_nozzle_head_distance": { "default_value": 4.2 }, - "extruder_prime_pos_x": { "default_value": 182, "enabled": false }, - "extruder_prime_pos_y": { "default_value": 6, "enabled": false }, - "extruder_prime_pos_z": { "default_value": 2, "enabled": false } + "extruder_prime_pos_x": { "default_value": 182 }, + "extruder_prime_pos_y": { "default_value": 6 }, + "extruder_prime_pos_z": { "default_value": 2 } } } diff --git a/resources/extruders/ultimaker3_extruder_left.def.json b/resources/extruders/ultimaker3_extruder_left.def.json index 7e7b77fcb6..95407726cf 100644 --- a/resources/extruders/ultimaker3_extruder_left.def.json +++ b/resources/extruders/ultimaker3_extruder_left.def.json @@ -23,8 +23,8 @@ "machine_extruder_end_pos_x": { "default_value": 213 }, "machine_extruder_end_pos_y": { "default_value": 207 }, "machine_nozzle_head_distance": { "default_value": 2.7 }, - "extruder_prime_pos_x": { "default_value": 170, "enabled": false }, - "extruder_prime_pos_y": { "default_value": 6, "enabled": false }, - "extruder_prime_pos_z": { "default_value": 2, "enabled": false } + "extruder_prime_pos_x": { "default_value": 170 }, + "extruder_prime_pos_y": { "default_value": 6 }, + "extruder_prime_pos_z": { "default_value": 2 } } } diff --git a/resources/extruders/ultimaker3_extruder_right.def.json b/resources/extruders/ultimaker3_extruder_right.def.json index ff616572ee..564ffc599c 100644 --- a/resources/extruders/ultimaker3_extruder_right.def.json +++ b/resources/extruders/ultimaker3_extruder_right.def.json @@ -23,8 +23,8 @@ "machine_extruder_end_pos_x": { "default_value": 213 }, "machine_extruder_end_pos_y": { "default_value": 189 }, "machine_nozzle_head_distance": { "default_value": 4.2 }, - "extruder_prime_pos_x": { "default_value": 182, "enabled": false }, - "extruder_prime_pos_y": { "default_value": 6, "enabled": false }, - "extruder_prime_pos_z": { "default_value": 2, "enabled": false } + "extruder_prime_pos_x": { "default_value": 182 }, + "extruder_prime_pos_y": { "default_value": 6 }, + "extruder_prime_pos_z": { "default_value": 2 } } } From ee9caa80a82c0d1131a9023e81c25393793bdbe1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 17:15:09 +0100 Subject: [PATCH 44/72] Remove dual-extrusion disallowed areas The idea is that these are now computed through combining the disallowed areas of the two extruders (though that doesn't quite work yet). Contributes to issue CURA-2625. --- resources/definitions/ultimaker3.def.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index 342c5c4a8e..996037f12f 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -58,13 +58,11 @@ "gantry_height": { "default_value": 60 }, "machine_disallowed_areas": { "default_value": [ [[-91.5, -115], [-115, -115], [-115, -104.6], [-91.5, -104.6]], - [[-99.5, -104.6], [-115, -104.6], [-115, 104.6], [-99.5, 104.6]], [[-94.5, 104.6], [-115, 104.6], [-115, 105.5], [-94.5, 105.5]], [[-91.4, 105.5], [-115, 105.5], [-115, 115], [-91.4, 115]], [[77.3, -115], [77.3, -98.6], [115, -98.6], [115, -115]], [[97.2, -98.6], [97.2, -54.5], [113, -54.5], [113, -98.6]], - [[100.5, -54.5], [100.5, 99.3], [115, 99.3], [115, -54.5]], [[77, 99.3], [77, 115], [115, 115], [115, 99.3]] ]}, "machine_extruder_count": { "default_value": 2 }, From 8d43f1c5f763d522af4c4665612f3ff781c3074c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Nov 2016 17:18:15 +0100 Subject: [PATCH 45/72] Take first layer extruder into account Forgot about that one earlier. Contributes to issue CURA-2625. --- cura/Settings/ExtruderManager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index 30370e417f..22a335aae6 100644 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -332,6 +332,7 @@ class ExtruderManager(QObject): #The support extruders. if support_enabled: used_extruder_stack_ids.add(self.extruderIds[str(global_stack.getProperty("support_infill_extruder_nr", "value"))]) + used_extruder_stack_ids.add(self.extruderIds[str(global_stack.getProperty("support_extruder_nr_layer_0", "value"))]) if support_interface_enabled: used_extruder_stack_ids.add(self.extruderIds[str(global_stack.getProperty("support_interface_extruder_nr", "value"))]) From 6f3b8a7fa1853915262af2954f4516fb5a1bbdd0 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 14 Nov 2016 10:30:59 +0100 Subject: [PATCH 46/72] renamed ORD to RoVa3D --- resources/definitions/ord.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/ord.def.json b/resources/definitions/ord.def.json index 7b954298f7..bedd8c3121 100644 --- a/resources/definitions/ord.def.json +++ b/resources/definitions/ord.def.json @@ -1,6 +1,6 @@ { "id": "ord", - "name": "ORD", + "name": "RoVa3D", "version": 2, "inherits": "fdmprinter", "metadata": { @@ -36,6 +36,6 @@ "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, "machine_depth": { "default_value": 250 }, "machine_width": { "default_value": 215 }, - "machine_name": { "default_value": "Ord" } + "machine_name": { "default_value": "RoVa3D" } } } From 48134619ebe9f03b54c8b6b19cbccbc431beead4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Nov 2016 10:31:11 +0100 Subject: [PATCH 47/72] Fix checking if we're single extrusion We are single extrusion if the extruder count is less than or equal to 1, like in other places throughout Cura. Contributes to issue CURA-2625. --- cura/Settings/ExtruderManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index 22a335aae6..5517830141 100644 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -303,7 +303,7 @@ class ExtruderManager(QObject): global_stack = UM.Application.getInstance().getGlobalContainerStack() container_registry = UM.Settings.ContainerRegistry.getInstance() - if global_stack.getProperty("machine_extruder_count", "value") == 0: #For single extrusion. + if global_stack.getProperty("machine_extruder_count", "value") <= 1: #For single extrusion. return [global_stack] used_extruder_stack_ids = set() From 5ddc1d9d71dddead16ca3d7e5904c5ed942d5a68 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Nov 2016 10:47:38 +0100 Subject: [PATCH 48/72] Fix offsetting polygon in single extrusion In single extrusion, the machine_nozzle_offset_x and machine_nozzle_offset_y were not defined in the used extruder stacks, because the used extruder stack is the global stack. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 97ab5fae18..327f79f67b 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -523,7 +523,11 @@ class BuildVolume(SceneNode): for extruder in used_extruders: extruder_id = extruder.getId() offset_x = extruder.getProperty("machine_nozzle_offset_x", "value") + if not offset_x: + offset_x = 0 offset_y = extruder.getProperty("machine_nozzle_offset_y", "value") + if not offset_y: + offset_y = 0 result[extruder_id] = [] for polygon in machine_disallowed_polygons: From 98089e702c96be7598934907009755cdead58bdb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Nov 2016 11:28:32 +0100 Subject: [PATCH 49/72] Also offset inner corners of the Y-borders These should coincide with the inner corners of the X-borders. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 327f79f67b..db2b95908b 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -554,15 +554,15 @@ class BuildVolume(SceneNode): result[extruder_id].append(Polygon(numpy.array([ [-half_machine_width, half_machine_depth], [half_machine_width, half_machine_depth], - [half_machine_width - border_size, half_machine_depth - border_size], - [-half_machine_width + border_size, half_machine_depth - border_size] + [half_machine_width - border_size + offset_x, half_machine_depth - border_size + offset_y], + [-half_machine_width + border_size + offset_x, half_machine_depth - border_size + offset_y] ], numpy.float32))) if border_size + offset_y > 0: result[extruder_id].append(Polygon(numpy.array([ [half_machine_width, -half_machine_depth], [-half_machine_width, -half_machine_depth], - [-half_machine_width + border_size, -half_machine_depth + border_size], - [half_machine_width - border_size, -half_machine_depth + border_size] + [-half_machine_width + border_size + offset_x, -half_machine_depth + border_size + offset_y], + [half_machine_width - border_size + offset_x, -half_machine_depth + border_size + offset_y] ], numpy.float32))) return result From 52ab3766161baab2e613988d2025e68363b19dc9 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 14 Nov 2016 11:34:49 +0100 Subject: [PATCH 50/72] removed duplicate Pruse i3 --- .../definitions/prusa_mendel_i3.def.json | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 resources/definitions/prusa_mendel_i3.def.json diff --git a/resources/definitions/prusa_mendel_i3.def.json b/resources/definitions/prusa_mendel_i3.def.json deleted file mode 100644 index a17678d65c..0000000000 --- a/resources/definitions/prusa_mendel_i3.def.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": "prusa_mendel_i3", - "name": "Prusa Mendel i3", - "version": 2, - "inherits": "fdmprinter", - "metadata": { - "visible": true, - "author": "Ultimaker", - "manufacturer": "Unknown", - "category": "Other", - "file_formats": "text/x-gcode", - "platform_offset": [ 0, 0, 0] - }, - - "overrides": { - "prime_tower_size": { "default_value": 8.660254037844387 }, - "machine_nozzle_size": { "default_value": 0.5 }, - "material_print_temperature": { "default_value": 240 }, - "layer_height": { "default_value": 0.2 }, - "speed_travel": { "default_value": 150 }, - "machine_extruder_count": { "default_value": 1 }, - "machine_heated_bed": { "default_value": true }, - "machine_center_is_zero": { "default_value": false }, - "machine_height": { "default_value": 200 }, - "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, - "machine_depth": { "default_value": 185 }, - "machine_width": { "default_value": 198 }, - "machine_name": { "default_value": "Prusa Mendel i3" } - } -} From 11f6494baff4197262d7ddbf6a2503c9beeafa5e Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 14 Nov 2016 11:35:37 +0100 Subject: [PATCH 51/72] capitalized Punchtech Connect XL --- resources/definitions/punchtec_connect_xl.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/punchtec_connect_xl.def.json b/resources/definitions/punchtec_connect_xl.def.json index e9d63cbb33..23c288eaaf 100644 --- a/resources/definitions/punchtec_connect_xl.def.json +++ b/resources/definitions/punchtec_connect_xl.def.json @@ -1,6 +1,6 @@ { "id": "punchtec_connect_xl", - "name": "punchtec Connect XL", + "name": "Punchtec Connect XL", "version": 2, "inherits": "fdmprinter", "metadata": { @@ -31,6 +31,6 @@ "machine_gcode_flavor": { "default_value": "RepRap (Marlin/Sprinter)" }, "machine_depth": { "default_value": 304 }, "machine_width": { "default_value": 304 }, - "machine_name": { "default_value": "Connect XL" } + "machine_name": { "default_value": "Punchtec Connect XL" } } } From ed1670caef5511c84cbb4b05f4da1736e4799bc4 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 14 Nov 2016 11:37:01 +0100 Subject: [PATCH 52/72] connected extruder trains to punchtec connect xl --- resources/definitions/punchtec_connect_xl.def.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/definitions/punchtec_connect_xl.def.json b/resources/definitions/punchtec_connect_xl.def.json index 23c288eaaf..ce4245a04f 100644 --- a/resources/definitions/punchtec_connect_xl.def.json +++ b/resources/definitions/punchtec_connect_xl.def.json @@ -9,6 +9,11 @@ "manufacturer": "Punchtec", "category": "Other", "file_formats": "text/x-gcode", + "machine_extruder_trains": + { + "0": "punchtec_connect_xl_extruder_0", + "1": "punchtec_connect_xl_extruder_1" + }, "platform_offset": [ 0, 0, 0] }, From 1cc323eddd89c51dd0bfe31de2583b3d74ca4c78 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Mon, 14 Nov 2016 11:37:54 +0100 Subject: [PATCH 53/72] changed machine name to Robo 3D R1 --- resources/definitions/robo_3d_r1.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/robo_3d_r1.def.json b/resources/definitions/robo_3d_r1.def.json index a566ba9f23..b137b2054b 100644 --- a/resources/definitions/robo_3d_r1.def.json +++ b/resources/definitions/robo_3d_r1.def.json @@ -1,6 +1,6 @@ { "id": "robo_3d_r1", - "name": "Robo R1", + "name": "Robo 3D R1", "version": 2, "inherits": "fdmprinter", "metadata": { From 18b2834091255ac9a70d45baea1821327ba1e1a1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Nov 2016 11:38:47 +0100 Subject: [PATCH 54/72] half_machine_width should be halved Shoot me before I do any further damage, please. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index db2b95908b..26bb3aeaa8 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -438,6 +438,7 @@ class BuildVolume(SceneNode): self._disallowed_areas = [] for extruder_id in result_areas: self._disallowed_areas.extend(result_areas[extruder_id]) + print("FINAL:", self._disallowed_areas) ## Computes the disallowed areas for objects that are printed with print # features. @@ -534,8 +535,8 @@ class BuildVolume(SceneNode): result[extruder_id].append(polygon.translate(offset_x, offset_y)) #Compensate for the nozzle offset of this extruder. #Add the border around the edge of the build volume. - half_machine_width = self._global_container_stack.getProperty("machine_width", "value") - half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") + half_machine_width = self._global_container_stack.getProperty("machine_width", "value") / 2 + half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") / 2 if border_size + offset_x > 0: result[extruder_id].append(Polygon(numpy.array([ [-half_machine_width, -half_machine_depth], From 519f6e58d22ddd058825e79032db3858f4006805 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Nov 2016 11:40:25 +0100 Subject: [PATCH 55/72] Remove debug print This is why it's wise to do a git diff --cached before you commit. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 26bb3aeaa8..fd7b7f196b 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -438,7 +438,6 @@ class BuildVolume(SceneNode): self._disallowed_areas = [] for extruder_id in result_areas: self._disallowed_areas.extend(result_areas[extruder_id]) - print("FINAL:", self._disallowed_areas) ## Computes the disallowed areas for objects that are printed with print # features. From ef601812324c13443d605dd3e7b6ee8a739bbf15 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Nov 2016 15:51:40 +0100 Subject: [PATCH 56/72] Change dimensions of Ultimaker 3 and reset nozzle origins The left nozzle is at the origin again now. And the right nozzle is at an offset of 18mm of that. Contributes to issue CURA-2625. --- resources/definitions/fdmprinter.def.json | 12 +++++++++ resources/definitions/ultimaker3.def.json | 25 ++++++++++--------- ...ultimaker3_extended_extruder_left.def.json | 4 +-- ...ltimaker3_extended_extruder_right.def.json | 4 +-- .../ultimaker3_extruder_left.def.json | 4 +-- .../ultimaker3_extruder_right.def.json | 4 +-- 6 files changed, 33 insertions(+), 20 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index ce6a341467..5e41011963 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -283,6 +283,18 @@ "settable_per_extruder": false, "settable_per_meshgroup": false }, + "nozzle_disallowed_areas": + { + "label": "Nozzle Disallowed Areas", + "description": "A list of polygons with areas the nozzle is not allowed to enter.", + "type": "polygons", + "default_value": + [ + ], + "settable_per_mesh": false, + "settable_per_extruder": false, + "settable_per_meshgroup": false + }, "machine_head_polygon": { "label": "Machine head polygon", diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index 996037f12f..0a76e07814 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -34,7 +34,7 @@ "overrides": { "machine_name": { "default_value": "Ultimaker 3" }, - "machine_width": { "default_value": 215 }, + "machine_width": { "default_value": 233 }, "machine_depth": { "default_value": 215 }, "machine_height": { "default_value": 200 }, "machine_heated_bed": { "default_value": true }, @@ -44,10 +44,10 @@ { "default_value": [ - [ -40, 10 ], - [ -40, -30 ], - [ 60, 10 ], - [ 60, -30 ] + [ -29, 6.1 ], + [ -29, -33.9 ], + [ 71, 6.1 ], + [ 71, -33.9 ] ] }, "machine_gcode_flavor": { "default_value": "Griffin" }, @@ -57,13 +57,14 @@ "machine_acceleration": { "default_value": 3000 }, "gantry_height": { "default_value": 60 }, "machine_disallowed_areas": { "default_value": [ - [[-91.5, -115], [-115, -115], [-115, -104.6], [-91.5, -104.6]], - [[-94.5, 104.6], [-115, 104.6], [-115, 105.5], [-94.5, 105.5]], - [[-91.4, 105.5], [-115, 105.5], [-115, 115], [-91.4, 115]], - - [[77.3, -115], [77.3, -98.6], [115, -98.6], [115, -115]], - [[97.2, -98.6], [97.2, -54.5], [113, -54.5], [113, -98.6]], - [[77, 99.3], [77, 115], [115, 115], [115, 99.3]] + [[92.8, -53.4], [92.8, -97.5], [116.5, -97.5], [116.5, -53.4]], + [[74.9, 107.5], [74.9, 100.5], [116.5, 100.5], [116.5, 107.5]] + ]}, + "nozzle_disallowed_areas": { "default_value": [ + [[-116.5, -103.5], [-116.5, -107.5], [-100.9, -107.5], [-100.9, -103.5]], + [[-116.5, 105.8], [-96.9, 105.8], [-96.9, 107.5], [-116.5, 107.5]], + [[74.6, 107.5], [74.6, 101.4], [116.5, 101.4], [116.5, 107.5]], + [[74.9, -97.5], [74.9, -107.5], [116.5, -107.5], [116.5, -97.5]] ]}, "machine_extruder_count": { "default_value": 2 }, "extruder_prime_pos_abs": { "default_value": true }, diff --git a/resources/extruders/ultimaker3_extended_extruder_left.def.json b/resources/extruders/ultimaker3_extended_extruder_left.def.json index 81b5e5c1a2..202272b096 100644 --- a/resources/extruders/ultimaker3_extended_extruder_left.def.json +++ b/resources/extruders/ultimaker3_extended_extruder_left.def.json @@ -13,8 +13,8 @@ "default_value": 0, "maximum_value": "1" }, - "machine_nozzle_offset_x": { "default_value": -11.0 }, - "machine_nozzle_offset_y": { "default_value": 3.9 }, + "machine_nozzle_offset_x": { "default_value": 0 }, + "machine_nozzle_offset_y": { "default_value": 0 }, "machine_extruder_start_pos_abs": { "default_value": true }, "machine_extruder_start_pos_x": { "default_value": 213 }, diff --git a/resources/extruders/ultimaker3_extended_extruder_right.def.json b/resources/extruders/ultimaker3_extended_extruder_right.def.json index c98ad46c52..0f85b2dd09 100644 --- a/resources/extruders/ultimaker3_extended_extruder_right.def.json +++ b/resources/extruders/ultimaker3_extended_extruder_right.def.json @@ -13,8 +13,8 @@ "default_value": 1, "maximum_value": "1" }, - "machine_nozzle_offset_x": { "default_value": 7.0 }, - "machine_nozzle_offset_y": { "default_value": 3.9 }, + "machine_nozzle_offset_x": { "default_value": 18 }, + "machine_nozzle_offset_y": { "default_value": 0 }, "machine_extruder_start_pos_abs": { "default_value": true }, "machine_extruder_start_pos_x": { "default_value": 213 }, diff --git a/resources/extruders/ultimaker3_extruder_left.def.json b/resources/extruders/ultimaker3_extruder_left.def.json index 95407726cf..83efa25dbb 100644 --- a/resources/extruders/ultimaker3_extruder_left.def.json +++ b/resources/extruders/ultimaker3_extruder_left.def.json @@ -13,8 +13,8 @@ "default_value": 0, "maximum_value": "1" }, - "machine_nozzle_offset_x": { "default_value": -11.0 }, - "machine_nozzle_offset_y": { "default_value": 3.9 }, + "machine_nozzle_offset_x": { "default_value": 0 }, + "machine_nozzle_offset_y": { "default_value": 0 }, "machine_extruder_start_pos_abs": { "default_value": true }, "machine_extruder_start_pos_x": { "default_value": 213 }, diff --git a/resources/extruders/ultimaker3_extruder_right.def.json b/resources/extruders/ultimaker3_extruder_right.def.json index 564ffc599c..4a75059c40 100644 --- a/resources/extruders/ultimaker3_extruder_right.def.json +++ b/resources/extruders/ultimaker3_extruder_right.def.json @@ -13,8 +13,8 @@ "default_value": 1, "maximum_value": "1" }, - "machine_nozzle_offset_x": { "default_value": 7.0 }, - "machine_nozzle_offset_y": { "default_value": 3.9 }, + "machine_nozzle_offset_x": { "default_value": 18 }, + "machine_nozzle_offset_y": { "default_value": 0 }, "machine_extruder_start_pos_abs": { "default_value": true }, "machine_extruder_start_pos_x": { "default_value": 213 }, From 17ade396d79bef3f54f2c7f0bde186242bbf1b35 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Nov 2016 16:36:47 +0100 Subject: [PATCH 57/72] Move right two clips to head disallowed areas It turns out that the right nozzle, if lifted, can still hit the clips in very rare cases. But the left nozzle, if the right nozzle is down, will not hit the clips. So the right clips are now part of the static areas just like the switching bay and camera, but the left clips are not. Contributes to issue CURA-2625. --- resources/definitions/ultimaker3.def.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index 0a76e07814..f3783ac2e2 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -58,13 +58,13 @@ "gantry_height": { "default_value": 60 }, "machine_disallowed_areas": { "default_value": [ [[92.8, -53.4], [92.8, -97.5], [116.5, -97.5], [116.5, -53.4]], - [[74.9, 107.5], [74.9, 100.5], [116.5, 100.5], [116.5, 107.5]] + [[73.8, 107.5], [73.8, 100.5], [116.5, 100.5], [116.5, 107.5]], + [[92.6, 107.5], [92.6, 100.5], [116.5, 100.5], [116.5, 107.5]], + [[92.9, -97.5], [92.9, -107.5], [116.5, -107.5], [116.5, -97.5]] ]}, "nozzle_disallowed_areas": { "default_value": [ [[-116.5, -103.5], [-116.5, -107.5], [-100.9, -107.5], [-100.9, -103.5]], - [[-116.5, 105.8], [-96.9, 105.8], [-96.9, 107.5], [-116.5, 107.5]], - [[74.6, 107.5], [74.6, 101.4], [116.5, 101.4], [116.5, 107.5]], - [[74.9, -97.5], [74.9, -107.5], [116.5, -107.5], [116.5, -97.5]] + [[-116.5, 105.8], [-96.9, 105.8], [-96.9, 107.5], [-116.5, 107.5]] ]}, "machine_extruder_count": { "default_value": 2 }, "extruder_prime_pos_abs": { "default_value": true }, From e9ced745fadeb952dcc140cb9d57a21335bd53b9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Nov 2016 17:00:09 +0100 Subject: [PATCH 58/72] Undo compensation for nozzle offset on right clips These clips were offset in the measurements because of the problem with the right nozzle not lifting high enough. This undoes that change. Contributes to issue CURA-2625. --- resources/definitions/ultimaker3.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index f3783ac2e2..fe5a9153e5 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -59,8 +59,8 @@ "machine_disallowed_areas": { "default_value": [ [[92.8, -53.4], [92.8, -97.5], [116.5, -97.5], [116.5, -53.4]], [[73.8, 107.5], [73.8, 100.5], [116.5, 100.5], [116.5, 107.5]], - [[92.6, 107.5], [92.6, 100.5], [116.5, 100.5], [116.5, 107.5]], - [[92.9, -97.5], [92.9, -107.5], [116.5, -107.5], [116.5, -97.5]] + [[74.6, 107.5], [74.6, 100.5], [116.5, 100.5], [116.5, 107.5]], + [[74.9, -97.5], [74.9, -107.5], [116.5, -107.5], [116.5, -97.5]] ]}, "nozzle_disallowed_areas": { "default_value": [ [[-116.5, -103.5], [-116.5, -107.5], [-100.9, -107.5], [-100.9, -103.5]], From f0d92873a3770d290774bff71f044689e02b52a3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Nov 2016 17:13:24 +0100 Subject: [PATCH 59/72] Add nozzle disallowed areas These disallowed areas are only at nozzle-height, not at head-height. They therefore won't move along with the nozzle offset. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index fd7b7f196b..cabf84377a 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -417,6 +417,12 @@ class BuildVolume(SceneNode): #Prime areas are valid. Add as normal. result_areas[extruder_id].extend(prime_areas[extruder_id]) + nozzle_disallowed_areas = extruder.getProperty("nozzle_disallowed_areas", "value") + for area in nozzle_disallowed_areas: + polygon = Polygon(numpy.array(area, numpy.float32)) + polygon = polygon.getMinkowskiHull(Polygon.approximatedCircle(disallowed_border_size)) + result_areas[extruder_id].append(polygon) #Don't perform the offset on these. + # Add prime tower location as disallowed area. prime_tower_collision = False prime_tower_areas = self._computeDisallowedAreasPrinted(used_extruders) From 47bb8f9601799282b499b37a438aa8fe7caf2b52 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Nov 2016 17:17:55 +0100 Subject: [PATCH 60/72] Compute disallowed borders with all extruders It's a bit counter-intuitive, so let me explain. The total build volume is defined as the rectangle around the union of the areas that all extruders can reach. The nozzle offset for the left extruder though is 0,0, so what should the border on the right side be? It should be 18 since there is a nozzle to the right of the left nozzle which has a relative x-offset of 18mm. Therefore we need to compute the relative offsets with each of the other nozzles and create sort of a bounding box around it, and the distance to the edge of that bounding box is the unreachable border on each of the sides. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index cabf84377a..048190ff0f 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -540,35 +540,47 @@ class BuildVolume(SceneNode): result[extruder_id].append(polygon.translate(offset_x, offset_y)) #Compensate for the nozzle offset of this extruder. #Add the border around the edge of the build volume. + left_unreachable_border = 0 + right_unreachable_border = 0 + top_unreachable_border = 0 + bottom_unreachable_border = 0 + #The build volume is defined as the union of the area that all extruders can reach, so we need to know the relative offset to all extruders. + for other_extruder in ExtruderManager.getInstance().getActiveExtruderStacks(): + other_offset_x = other_extruder.getProperty("machine_nozzle_offset_x", "value") + other_offset_y = other_extruder.getProperty("machine_nozzle_offset_y", "value") + left_unreachable_border = min(left_unreachable_border, other_offset_x - offset_x) + right_unreachable_border = max(right_unreachable_border, other_offset_x - offset_x) + top_unreachable_border = min(top_unreachable_border, other_offset_y - offset_y) + bottom_unreachable_border = max(bottom_unreachable_border, other_offset_y - offset_y) half_machine_width = self._global_container_stack.getProperty("machine_width", "value") / 2 half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") / 2 - if border_size + offset_x > 0: + if border_size - left_unreachable_border > 0: result[extruder_id].append(Polygon(numpy.array([ [-half_machine_width, -half_machine_depth], [-half_machine_width, half_machine_depth], - [-half_machine_width + border_size + offset_x, half_machine_depth - border_size + offset_y], - [-half_machine_width + border_size + offset_x, -half_machine_depth + border_size + offset_y] + [-half_machine_width + border_size - left_unreachable_border, half_machine_depth - border_size - bottom_unreachable_border], + [-half_machine_width + border_size - left_unreachable_border, -half_machine_depth + border_size - top_unreachable_border] ], numpy.float32))) - if border_size - offset_x > 0: + if border_size + right_unreachable_border > 0: result[extruder_id].append(Polygon(numpy.array([ [half_machine_width, half_machine_depth], [half_machine_width, -half_machine_depth], - [half_machine_width - border_size + offset_x, -half_machine_depth + border_size + offset_y], - [half_machine_width - border_size + offset_x, half_machine_depth - border_size + offset_y] + [half_machine_width - border_size - right_unreachable_border, -half_machine_depth + border_size - top_unreachable_border], + [half_machine_width - border_size - right_unreachable_border, half_machine_depth - border_size - bottom_unreachable_border] ], numpy.float32))) - if border_size - offset_y > 0: + if border_size + bottom_unreachable_border > 0: result[extruder_id].append(Polygon(numpy.array([ [-half_machine_width, half_machine_depth], [half_machine_width, half_machine_depth], - [half_machine_width - border_size + offset_x, half_machine_depth - border_size + offset_y], - [-half_machine_width + border_size + offset_x, half_machine_depth - border_size + offset_y] + [half_machine_width - border_size - right_unreachable_border, half_machine_depth - border_size - bottom_unreachable_border], + [-half_machine_width + border_size - left_unreachable_border, half_machine_depth - border_size - bottom_unreachable_border] ], numpy.float32))) - if border_size + offset_y > 0: + if border_size - top_unreachable_border > 0: result[extruder_id].append(Polygon(numpy.array([ [half_machine_width, -half_machine_depth], [-half_machine_width, -half_machine_depth], - [-half_machine_width + border_size + offset_x, -half_machine_depth + border_size + offset_y], - [half_machine_width - border_size + offset_x, -half_machine_depth + border_size + offset_y] + [-half_machine_width + border_size - left_unreachable_border, -half_machine_depth + border_size - top_unreachable_border], + [half_machine_width - border_size - right_unreachable_border, -half_machine_depth + border_size - top_unreachable_border] ], numpy.float32))) return result From 6bb82eeefeb02f5522db6be5bcb7bdb7247925a2 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Tue, 15 Nov 2016 11:42:08 +0100 Subject: [PATCH 61/72] Fix problem registering Actions.qml which resulted in empty menu items. --- cura/CuraApplication.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 532a60b58c..80fee88201 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -558,7 +558,9 @@ class CuraApplication(QtApplication): qmlRegisterSingletonType(cura.Settings.ContainerManager, "Cura", 1, 0, "ContainerManager", cura.Settings.ContainerManager.createContainerManager) - qmlRegisterSingletonType(QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, "Actions.qml")), "Cura", 1, 0, "Actions") + # As of Qt5.7, it is necessary to get rid of any ".." in the path for the singleton to work. + actions_url = QUrl.fromLocalFile(os.path.abspath(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, "Actions.qml"))) + qmlRegisterSingletonType(actions_url, "Cura", 1, 0, "Actions") engine.rootContext().setContextProperty("ExtruderManager", cura.Settings.ExtruderManager.getInstance()) From 9be02fb31f575258d0fd48698f2f53d3d8eccb6d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 15 Nov 2016 11:08:47 +0100 Subject: [PATCH 62/72] Recalculate disallowed borders when adding or removing objects Because the new object may use an extruder that wasn't used so far, and if you remove an object it may remove the need for a certain extruder. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 048190ff0f..29dc4fd9bc 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -104,9 +104,7 @@ class BuildVolume(SceneNode): root = Application.getInstance().getController().getScene().getRoot() new_number_of_objects = len([node for node in BreadthFirstIterator(root) if node.getMeshData() and type(node) is SceneNode]) if new_number_of_objects != self._number_of_objects: - recalculate = False - if self._global_container_stack.getProperty("print_sequence", "value") == "one_at_a_time": - recalculate = (new_number_of_objects < 2 and self._number_of_objects > 1) or (new_number_of_objects > 1 and self._number_of_objects < 2) + recalculate = new_number_of_objects != self._number_of_objects self._number_of_objects = new_number_of_objects if recalculate: self._onSettingPropertyChanged("print_sequence", "value") # Create fake event, so right settings are triggered. From 747ade2382859478609451908c888e7e2da2fca1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 15 Nov 2016 11:15:40 +0100 Subject: [PATCH 63/72] Remove now-useless variable I just realised that there were two if statements below each other with the same condition. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 29dc4fd9bc..76e6c53810 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -104,10 +104,8 @@ class BuildVolume(SceneNode): root = Application.getInstance().getController().getScene().getRoot() new_number_of_objects = len([node for node in BreadthFirstIterator(root) if node.getMeshData() and type(node) is SceneNode]) if new_number_of_objects != self._number_of_objects: - recalculate = new_number_of_objects != self._number_of_objects self._number_of_objects = new_number_of_objects - if recalculate: - self._onSettingPropertyChanged("print_sequence", "value") # Create fake event, so right settings are triggered. + self._onSettingPropertyChanged("print_sequence", "value") # Create fake event, so right settings are triggered. def setWidth(self, width): if width: self._width = width From f0766cbaf3f62e2939c803290f006f1a0b5e3258 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 15 Nov 2016 11:52:04 +0100 Subject: [PATCH 64/72] Update build volume when per-object settings change Requires some multi-levelled trickery to get the event listeners working. This also assumes that the per-object stack decorator is not deleted at any point unless the mesh is deleted (which is currently a correct assumption). If that ever changes though, the harm is just that the update function is still listening on the deleted decorator's stack. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 76e6c53810..b9252dce94 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -75,8 +75,8 @@ class BuildVolume(SceneNode): self._has_errors = False Application.getInstance().getController().getScene().sceneChanged.connect(self._onSceneChanged) - # Number of objects loaded at the moment. - self._number_of_objects = 0 + #Objects loaded at the moment. We are connected to the property changed events of these objects. + self._scene_objects = set() self._change_timer = QTimer() self._change_timer.setInterval(100) @@ -102,11 +102,28 @@ class BuildVolume(SceneNode): def _onChangeTimerFinished(self): root = Application.getInstance().getController().getScene().getRoot() - new_number_of_objects = len([node for node in BreadthFirstIterator(root) if node.getMeshData() and type(node) is SceneNode]) - if new_number_of_objects != self._number_of_objects: - self._number_of_objects = new_number_of_objects + new_scene_objects = set(node for node in BreadthFirstIterator(root) if node.getMeshData() and type(node) is SceneNode) + if new_scene_objects != self._scene_objects: + for node in new_scene_objects - self._scene_objects: #Nodes that were added to the scene. + node.decoratorsChanged.connect(self._onNodeDecoratorChanged) + for node in self._scene_objects - new_scene_objects: #Nodes that were removed from the scene. + per_mesh_stack = node.callDecoration("getStack") + if per_mesh_stack: + per_mesh_stack.propertyChanged.disconnect(self._onSettingPropertyChanged) + node.decoratorsChanged.disconnect(self._onNodeDecoratorChanged) + + self._scene_objects = new_scene_objects self._onSettingPropertyChanged("print_sequence", "value") # Create fake event, so right settings are triggered. + ## Updates the listeners that listen for changes in per-mesh stacks. + # + # \param node The node for which the decorators changed. + def _onNodeDecoratorChanged(self, node): + print("NODE DECORATOR CHANGED!", node) + per_mesh_stack = node.callDecoration("getStack") + if per_mesh_stack: + per_mesh_stack.propertyChanged.connect(self._onSettingPropertyChanged) + def setWidth(self, width): if width: self._width = width @@ -320,7 +337,7 @@ class BuildVolume(SceneNode): self._width = self._global_container_stack.getProperty("machine_width", "value") machine_height = self._global_container_stack.getProperty("machine_height", "value") - if self._global_container_stack.getProperty("print_sequence", "value") == "one_at_a_time" and self._number_of_objects > 1: + if self._global_container_stack.getProperty("print_sequence", "value") == "one_at_a_time" and len(self._scene_objects) > 1: self._height = min(self._global_container_stack.getProperty("gantry_height", "value"), machine_height) if self._height < machine_height: self._build_volume_message.show() @@ -343,7 +360,7 @@ class BuildVolume(SceneNode): rebuild_me = False if setting_key == "print_sequence": machine_height = self._global_container_stack.getProperty("machine_height", "value") - if Application.getInstance().getGlobalContainerStack().getProperty("print_sequence", "value") == "one_at_a_time" and self._number_of_objects > 1: + if Application.getInstance().getGlobalContainerStack().getProperty("print_sequence", "value") == "one_at_a_time" and len(self._scene_objects) > 1: self._height = min(self._global_container_stack.getProperty("gantry_height", "value"), machine_height) if self._height < machine_height: self._build_volume_message.show() @@ -354,7 +371,7 @@ class BuildVolume(SceneNode): self._build_volume_message.hide() rebuild_me = True - if setting_key in self._skirt_settings or setting_key in self._prime_settings or setting_key in self._tower_settings or setting_key == "print_sequence" or setting_key in self._ooze_shield_settings or setting_key in self._distance_settings: + if setting_key in self._skirt_settings or setting_key in self._prime_settings or setting_key in self._tower_settings or setting_key == "print_sequence" or setting_key in self._ooze_shield_settings or setting_key in self._distance_settings or setting_key in self._extruder_settings: self._updateDisallowedAreas() rebuild_me = True @@ -703,3 +720,4 @@ class BuildVolume(SceneNode): _tower_settings = ["prime_tower_enable", "prime_tower_size", "prime_tower_position_x", "prime_tower_position_y"] _ooze_shield_settings = ["ooze_shield_enabled", "ooze_shield_dist"] _distance_settings = ["infill_wipe_dist", "travel_avoid_distance", "support_offset", "support_enable", "travel_avoid_other_parts"] + _extruder_settings = ["support_enable", "support_interface_enable", "support_infill_extruder_nr", "support_extruder_nr_layer_0", "support_interface_extruder_nr", "brim_line_count", "adhesion_extruder_nr", "adhesion_type"] #Settings that can affect which extruders are used. \ No newline at end of file From 60c89339068099285c100fa25cd1f5a96d717817 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 15 Nov 2016 11:57:58 +0100 Subject: [PATCH 65/72] Remove debug print Oops. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index b9252dce94..fd25e344e4 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -119,7 +119,6 @@ class BuildVolume(SceneNode): # # \param node The node for which the decorators changed. def _onNodeDecoratorChanged(self, node): - print("NODE DECORATOR CHANGED!", node) per_mesh_stack = node.callDecoration("getStack") if per_mesh_stack: per_mesh_stack.propertyChanged.connect(self._onSettingPropertyChanged) From 2492b03c4f6bac606d96b2e261ba30a6b0ba949b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 15 Nov 2016 13:05:15 +0100 Subject: [PATCH 66/72] Update disallowed area when object's extruder is changed This calls _updateDisallowedAreas() but not rebuild(), so the change is not visible at this moment. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 7 +++++++ cura/Settings/SettingOverrideDecorator.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index fd25e344e4..42ec6886f7 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -110,6 +110,9 @@ class BuildVolume(SceneNode): per_mesh_stack = node.callDecoration("getStack") if per_mesh_stack: per_mesh_stack.propertyChanged.disconnect(self._onSettingPropertyChanged) + active_extruder_changed = node.callDecoration("getActiveExtruderChangedSignal") + if active_extruder_changed is not None: + node.callDecoration("getActiveExtruderChangedSignal").disconnect(self._updateDisallowedAreas) node.decoratorsChanged.disconnect(self._onNodeDecoratorChanged) self._scene_objects = new_scene_objects @@ -122,6 +125,10 @@ class BuildVolume(SceneNode): per_mesh_stack = node.callDecoration("getStack") if per_mesh_stack: per_mesh_stack.propertyChanged.connect(self._onSettingPropertyChanged) + active_extruder_changed = node.callDecoration("getActiveExtruderChangedSignal") + if active_extruder_changed is not None: + active_extruder_changed.connect(self._updateDisallowedAreas) + self._updateDisallowedAreas() def setWidth(self, width): if width: self._width = width diff --git a/cura/Settings/SettingOverrideDecorator.py b/cura/Settings/SettingOverrideDecorator.py index a8cfcd8d80..d38dac565b 100644 --- a/cura/Settings/SettingOverrideDecorator.py +++ b/cura/Settings/SettingOverrideDecorator.py @@ -61,6 +61,12 @@ class SettingOverrideDecorator(SceneNodeDecorator): def getActiveExtruder(self): return self._extruder_stack + ## Gets the signal that emits if the active extruder changed. + # + # This can then be accessed via a decorator. + def getActiveExtruderChangedSignal(self): + return self.activeExtruderChanged + ## Gets the currently active extruders position # # \return An extruder's position, or None if no position info is available. From 35a01435d59499b9471c9063eb9d8b5ffa36aa80 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 15 Nov 2016 13:10:48 +0100 Subject: [PATCH 67/72] Also rebuild when mesh extruder changes I do not want to add the rebuild() call to the update function itself since there may be other changes to the build volume before we should rebuild (such as raft). Contributes to issue CURA-2625. --- cura/BuildVolume.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 42ec6886f7..b45f878a36 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -112,7 +112,7 @@ class BuildVolume(SceneNode): per_mesh_stack.propertyChanged.disconnect(self._onSettingPropertyChanged) active_extruder_changed = node.callDecoration("getActiveExtruderChangedSignal") if active_extruder_changed is not None: - node.callDecoration("getActiveExtruderChangedSignal").disconnect(self._updateDisallowedAreas) + node.callDecoration("getActiveExtruderChangedSignal").disconnect(self._updateDisallowedAreasAndRebuild) node.decoratorsChanged.disconnect(self._onNodeDecoratorChanged) self._scene_objects = new_scene_objects @@ -127,8 +127,8 @@ class BuildVolume(SceneNode): per_mesh_stack.propertyChanged.connect(self._onSettingPropertyChanged) active_extruder_changed = node.callDecoration("getActiveExtruderChangedSignal") if active_extruder_changed is not None: - active_extruder_changed.connect(self._updateDisallowedAreas) - self._updateDisallowedAreas() + active_extruder_changed.connect(self._updateDisallowedAreasAndRebuild) + self._updateDisallowedAreasAndRebuild() def setWidth(self, width): if width: self._width = width @@ -391,6 +391,17 @@ class BuildVolume(SceneNode): def hasErrors(self): return self._has_errors + ## Calls _updateDisallowedAreas and makes sure the changes appear in the + # scene. + # + # This is required for a signal to trigger the update in one go. The + # ``_updateDisallowedAreas`` method itself shouldn't call ``rebuild``, + # since there may be other changes before it needs to be rebuilt, which + # would hit performance. + def _updateDisallowedAreasAndRebuild(self): + self._updateDisallowedAreas() + self.rebuild() + def _updateDisallowedAreas(self): if not self._global_container_stack: return From 707b38431bc927203d4729bc27b8f1cd599c103b Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Tue, 15 Nov 2016 13:19:24 +0100 Subject: [PATCH 68/72] JSON fix: double text in combing mode (CURA-2959) --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 5e41011963..1962476424 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -2246,7 +2246,7 @@ "retraction_combing": { "label": "Combing Mode", - "description": "Combing keeps the nozzle within already printed areas when traveling. This results in slightly longer travel moves but reduces the need for retractions. If combing is off, the material will retract and the nozzle moves in a straight line to the next point. It is also possible to avoid combing over top/bottom skin areas by combing within the infill only. It is also possible to avoid combing over top/bottom skin areas by combing within the infill only.", + "description": "Combing keeps the nozzle within already printed areas when traveling. This results in slightly longer travel moves but reduces the need for retractions. If combing is off, the material will retract and the nozzle moves in a straight line to the next point. It is also possible to avoid combing over top/bottom skin areas by combing within the infill only.", "type": "enum", "options": { From a68d96fb60202a71731e4fdbdc9675f6f602b962 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Wed, 16 Nov 2016 09:42:04 +0100 Subject: [PATCH 69/72] Per model settings panel is now closed when the tool gets disabled. CURA-2287 --- cura/CuraApplication.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 80fee88201..da1a0688e2 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -573,11 +573,17 @@ class CuraApplication(QtApplication): def onSelectionChanged(self): if Selection.hasSelection(): - if not self.getController().getActiveTool(): + if self.getController().getActiveTool(): + # If the tool has been disabled by the new selection + if not self.getController().getActiveTool().getEnabled(): + # Default + self.getController().setActiveTool("TranslateTool") + else: if self._previous_active_tool: self.getController().setActiveTool(self._previous_active_tool) self._previous_active_tool = None else: + # Default self.getController().setActiveTool("TranslateTool") if Preferences.getInstance().getValue("view/center_on_select"): self._center_after_select = True From 042141413a6f883f14714b23a8be916e6a1592a8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 16 Nov 2016 17:22:06 +0100 Subject: [PATCH 70/72] Fixed mergeSelected My previous fix was wrong; It only worked on what I wanted to fix (and broke the normal behavior). The current fix should fix both issues (merging works & merging groups works) CURA-2932 --- cura/CuraApplication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index da1a0688e2..0216bacce4 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -873,7 +873,7 @@ class CuraApplication(QtApplication): return # Compute the center of the objects when their origins are aligned. - object_centers = [node.getBoundingBox().center for node in group_node.getChildren()] + object_centers = [node.getMeshData().getCenterPosition().scale(node.getScale()) for node in group_node.getAllChildren() if node.getMeshData()] if object_centers and len(object_centers) > 0: middle_x = sum([v.x for v in object_centers]) / len(object_centers) middle_y = sum([v.y for v in object_centers]) / len(object_centers) @@ -884,7 +884,7 @@ class CuraApplication(QtApplication): # Move each node to the same position. for center, node in zip(object_centers, group_node.getChildren()): # Align the object and also apply the offset to center it inside the group. - node.translate(-1 * (center - offset), SceneNode.TransformSpace.World) + node.setPosition(center - offset) # Use the previously found center of the group bounding box as the new location of the group group_node.setPosition(group_node.getBoundingBox().center) From 8879021d53311c32942b4e7bb303c54df3a6a046 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 17 Nov 2016 09:48:29 +0100 Subject: [PATCH 71/72] Make left build plate clips static disallowed areas It turns out that even though it far exceeds the tolerances, the build plate clips have such high variation that the left clips also hit the nozzle sometimes. Contributes to issue CURA-2625. --- resources/definitions/ultimaker3.def.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index fe5a9153e5..16feda7d64 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -60,9 +60,7 @@ [[92.8, -53.4], [92.8, -97.5], [116.5, -97.5], [116.5, -53.4]], [[73.8, 107.5], [73.8, 100.5], [116.5, 100.5], [116.5, 107.5]], [[74.6, 107.5], [74.6, 100.5], [116.5, 100.5], [116.5, 107.5]], - [[74.9, -97.5], [74.9, -107.5], [116.5, -107.5], [116.5, -97.5]] - ]}, - "nozzle_disallowed_areas": { "default_value": [ + [[74.9, -97.5], [74.9, -107.5], [116.5, -107.5], [116.5, -97.5]], [[-116.5, -103.5], [-116.5, -107.5], [-100.9, -107.5], [-100.9, -103.5]], [[-116.5, 105.8], [-96.9, 105.8], [-96.9, 107.5], [-116.5, 107.5]] ]}, From 41825231ad8a78f7a850c056d9b3d63b5f54d5d9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 17 Nov 2016 09:54:00 +0100 Subject: [PATCH 72/72] Fix check for if nozzle offset exists Because an offset of 0 results in False as well. Contributes to issue CURA-2625. --- cura/BuildVolume.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index b45f878a36..5c147d2006 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -559,10 +559,10 @@ class BuildVolume(SceneNode): for extruder in used_extruders: extruder_id = extruder.getId() offset_x = extruder.getProperty("machine_nozzle_offset_x", "value") - if not offset_x: + if offset_x is None: offset_x = 0 offset_y = extruder.getProperty("machine_nozzle_offset_y", "value") - if not offset_y: + if offset_y is None: offset_y = 0 result[extruder_id] = []