Stephan3 / dwc2-for-klipper

A translator between DWC2 and Klipper
GNU General Public License v3.0
160 stars 38 forks source link

Add support for Slic3r++ #67

Closed guestisp closed 4 years ago

guestisp commented 4 years ago

This add supports for Slic3r++ by Supermerill just a strangeness (it's the same for all slicers): the object max height shown will report the Z max height not the object height. In example, if you have a end gcode that raise Z axis after the print to Z max (in example 250mm) , the object max height is reported as 250mm this because you are looking for the higher number found in G1 Z gcode command.

Stephan3 commented 4 years ago

pls provide a example gcode. I will look into it. Thanks.

guestisp commented 4 years ago

I've extracted the comments from a gcode made with Slic3r++ (now SuperSlicer, maybe a new fix is needed)

; generated by Slic3r++ 2.2.50 on 2020-05-12 at 12:00:11 UTC

; 

; external perimeters extrusion width = 1.00mm
; perimeters extrusion width = 1.00mm
; infill extrusion width = 1.00mm
; solid infill extrusion width = 1.00mm
; top infill extrusion width = 1.00mm

; object:{"name":"cube-40-40-40","id":"cube-40-40-40.stl id:0 copy 0","object_center":[165.000000,165.000000,165.000000],"boundingbox_center":[165.000000,2.500000,5.000000],"boundingbox_size":[5.000000,5.000000,0.000000]}

; filament used [mm] = 35.7
; filament used [cm3] = 0.1
; filament used [g] = 0.1
; filament cost = 0.0

; total filament used [g] = 0.1
; total filament cost = 0.0
; estimated printing time (normal mode) = 1m 9s

; allow_empty_layers = 1
; avoid_crossing_not_first_layer = 1
; avoid_crossing_perimeters = 0
; bed_custom_model = 
; bed_custom_texture = 
; bed_shape = 0x0,330x0,330x330,0x330
; bed_temperature = 60
; before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;[layer_z]\n\n
; between_objects_gcode = 
; bottom_fill_pattern = rectilinear
; bottom_solid_layers = 0
; bottom_solid_min_thickness = 0
; bridge_acceleration = 0
; bridge_angle = 0
; bridge_fan_speed = 100
; bridge_flow_ratio = 35%
; bridge_overlap = 100%
; bridge_speed = 20
; bridged_infill_margin = 200%
; brim_ears = 0
; brim_ears_max_angle = 125
; brim_inside_holes = 0
; brim_offset = 0
; brim_width = 0
; brim_width_interior = 0
; chamber_temperature = 0
; clip_multipart_objects = 1
; complete_objects = 0
; complete_objects_one_skirt = 0
; cooling = 0
; cooling_tube_length = 5
; cooling_tube_retraction = 91.5
; curve_smoothing_angle_concave = 0
; curve_smoothing_angle_convex = 0
; curve_smoothing_cutoff_dist = 2
; curve_smoothing_precision = 0
; default_acceleration = 0
; default_filament_profile = "Creality PLA"
; default_print_profile = 0.32mm NORMAL 0.6 nozzle
; deretract_speed = 0
; disable_fan_first_layers = 2
; dont_support_bridges = 1
; draft_shield = 0
; duplicate_distance = 6
; elefant_foot_compensation = 0
; end_filament_gcode = "; Filament-specific end gcode"
; end_gcode = M104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\n{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+10, max_print_height)} F600{endif} ; Move print head up\nG1 X0 Y330\nM84 X Y E ; disable motors
; enforce_full_fill_volume = 1
; ensure_vertical_shell_thickness = 0
; exact_last_layer_height = 0
; external_infill_margin = 150%
; external_perimeter_extrusion_width = 0
; external_perimeter_speed = 50
; external_perimeters_first = 1
; external_perimeters_hole = 1
; external_perimeters_nothole = 1
; external_perimeters_vase = 1
; extra_loading_move = -2
; extra_perimeters = 0
; extra_perimeters_odd_layers = 0
; extruder_clearance_height = 20
; extruder_clearance_radius = 20
; extruder_colour = #FFFF00
; extruder_offset = 0x0
; extrusion_axis = E
; extrusion_multiplier = 1
; extrusion_width = 1
; fan_always_on = 1
; fan_below_layer_time = 100
; fan_speedup_time = 0
; feature_gcode = 
; filament_colour = #39FF00
; filament_cooling_final_speed = 3.4
; filament_cooling_initial_speed = 2.2
; filament_cooling_moves = 4
; filament_cooling_zone_pause = 0
; filament_cost = 20
; filament_density = 1.24
; filament_diameter = 1.75
; filament_dip_extraction_speed = 70
; filament_dip_insertion_speed = 33
; filament_enable_toolchange_part_fan = 0
; filament_enable_toolchange_temp = 0
; filament_load_time = 0
; filament_loading_speed = 28
; filament_loading_speed_start = 3
; filament_max_volumetric_speed = 16
; filament_max_wipe_tower_speed = 0
; filament_melt_zone_pause = 0
; filament_minimal_purge_on_wipe_tower = 15
; filament_notes = ""
; filament_ramming_parameters = "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0| 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6"
; filament_settings_id = "AzureFilm - PETG - Light Green"
; filament_skinnydip_distance = 31
; filament_soluble = 0
; filament_toolchange_delay = 0
; filament_toolchange_part_fan_speed = 50
; filament_toolchange_temp = 200
; filament_type = PET
; filament_unload_time = 0
; filament_unloading_speed = 90
; filament_unloading_speed_start = 100
; filament_use_fast_skinnydip = 0
; filament_use_skinnydip = 0
; filament_vendor = (Unknown)
; filament_wipe_advanced_pigment = 0.5
; fill_angle = 45
; fill_density = 0%
; fill_pattern = stars
; fill_smooth_distribution = 10%
; fill_smooth_width = 50%
; fill_top_flow_ratio = 100%
; first_layer_acceleration = 0
; first_layer_bed_temperature = 60
; first_layer_extrusion_width = 0
; first_layer_flow_ratio = 100%
; first_layer_height = 0.3
; first_layer_infill_speed = 30
; first_layer_speed = 30
; first_layer_temperature = 225
; gap_fill = 0
; gap_fill_min_area = 100%
; gap_fill_speed = 20
; gcode_comments = 0
; gcode_flavor = lerdge
; gcode_label_objects = 1
; high_current_on_filament_swap = 0
; hole_size_compensation = 0
; hole_to_polyhole = 0
; host_type = duet
; infill_acceleration = 0
; infill_dense = 0
; infill_dense_algo = automatic
; infill_every_layers = 1
; infill_extruder = 1
; infill_extrusion_width = 0
; infill_first = 0
; infill_not_connected = 0
; infill_only_where_needed = 0
; infill_overlap = 25%
; infill_speed = 80
; inherits_cummulative = ;"Creality PLA";"ENDER-3 0.6 nozzle"
; interface_shells = 0
; layer_gcode = ;AFTER_LAYER_CHANGE\n;[layer_z]
; layer_height = 0.3
; machine_max_acceleration_e = 5000
; machine_max_acceleration_extruding = 500
; machine_max_acceleration_retracting = 1000
; machine_max_acceleration_x = 500
; machine_max_acceleration_y = 500
; machine_max_acceleration_z = 100
; machine_max_feedrate_e = 60
; machine_max_feedrate_x = 500
; machine_max_feedrate_y = 500
; machine_max_feedrate_z = 10
; machine_max_jerk_e = 5
; machine_max_jerk_x = 8
; machine_max_jerk_y = 8
; machine_max_jerk_z = 0.4
; machine_min_extruding_rate = 0
; machine_min_travel_rate = 0
; max_fan_speed = 100
; max_layer_height = 0.48
; max_print_height = 440
; max_print_speed = 80
; max_volumetric_speed = 0
; min_fan_speed = 50
; min_layer_height = 0.08
; min_print_speed = 10
; min_skirt_length = 0
; model_precision = 0.0001
; no_perimeter_unsupported_algo = none
; notes = 
; nozzle_diameter = 0.6
; only_one_perimeter_top = 0
; only_retract_when_crossing_perimeters = 1
; ooze_prevention = 0
; output_filename_format = [input_filename_base].gcode
; over_bridge_flow_ratio = 100%
; overhangs = 1
; overhangs_width = 50%
; parking_pos_retraction = 92
; perimeter_acceleration = 0
; perimeter_extruder = 1
; perimeter_extrusion_width = 0
; perimeter_loop = 0
; perimeter_loop_seam = rear
; perimeter_speed = 60
; perimeters = 1
; post_process = 
; print_settings_id = Banda Elastica - Layer 0.30 - Width 1
; printer_model = ENDER-3
; printer_notes = 
; printer_settings_id = BLV - Nozzle 0.6
; printer_technology = FFF
; printer_variant = 0.6
; printer_vendor = 
; raft_layers = 0
; remaining_times = 0
; resolution = 0
; retract_before_travel = 2
; retract_before_wipe = 0%
; retract_layer_change = 0
; retract_length = 6
; retract_length_toolchange = 1
; retract_lift = 0
; retract_lift_above = 0
; retract_lift_below = 0
; retract_lift_not_last_layer = 0
; retract_restart_extra = 0
; retract_restart_extra_toolchange = 0
; retract_speed = 40
; seam_position = near
; seam_travel = 1
; serial_port = 
; serial_speed = 250000
; silent_mode = 0
; single_extruder_multi_material = 0
; single_extruder_multi_material_priming = 1
; skirt_distance = 2
; skirt_height = 1
; skirts = 1
; slice_closing_radius = 0.049
; slowdown_below_layer_time = 20
; small_perimeter_speed = 15
; solid_fill_pattern = rectilineargapfill
; solid_infill_below_area = 70
; solid_infill_every_layers = 0
; solid_infill_extruder = 1
; solid_infill_extrusion_width = 0
; solid_infill_speed = 20
; spiral_vase = 0
; standby_temperature_delta = -5
; start_filament_gcode = ""
; start_gcode = G90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S[first_layer_temperature] ; set extruder temp\nM140 S[first_layer_bed_temperature] ; set bed temp\n\nG28 ; home\nG29 ; auto bed level\nG28 ; home\n\n; continuo a scaldare ed aspetto\nM190 S[first_layer_bed_temperature] ; wait for bed temp\nM109 S[first_layer_temperature] ; wait for extruder temp\n\nG1 Z2 F240\nG1 X2 Y20 F3000\nG1 Z0.28 F240\nG92 E0.0\nG1 Y190 E15.0 F1500.0 ; intro line\nG1 X2.3 F5000\nG1 Y20 E30 F1200.0 ; intro line\nG92 E0.0
; support_material = 0
; support_material_angle = 0
; support_material_auto = 1
; support_material_buildplate_only = 0
; support_material_contact_distance_bottom = 0.2
; support_material_contact_distance_top = 0.2
; support_material_contact_distance_type = plane
; support_material_enforce_layers = 0
; support_material_extruder = 1
; support_material_extrusion_width = 0
; support_material_interface_contact_loops = 0
; support_material_interface_extruder = 1
; support_material_interface_layers = 3
; support_material_interface_pattern = rectilinear
; support_material_interface_spacing = 0
; support_material_interface_speed = 100%
; support_material_pattern = rectilinear
; support_material_solid_first_layer = 0
; support_material_spacing = 2.5
; support_material_speed = 60
; support_material_synchronize_layers = 0
; support_material_threshold = 0
; support_material_with_sheath = 1
; support_material_xy_spacing = 50%
; temperature = 220
; thin_perimeters = 1
; thin_walls = 0
; thin_walls_min_width = 33%
; thin_walls_overlap = 50%
; thin_walls_speed = 30
; threads = 8
; thumbnails = 
; time_estimation_compensation = 100%
; toolchange_gcode = 
; top_fan_speed = 100
; top_fill_pattern = rectilinear
; top_infill_extrusion_width = 0
; top_solid_infill_speed = 15
; top_solid_layers = 0
; top_solid_min_thickness = 0
; travel_speed = 130
; use_firmware_retraction = 0
; use_relative_e_distances = 1
; use_volumetric_e = 0
; variable_layer_height = 1
; wipe = 1
; wipe_advanced = 0
; wipe_advanced_algo = linear
; wipe_advanced_multiplier = 60
; wipe_advanced_nozzle_melted_volume = 120
; wipe_into_infill = 0
; wipe_into_objects = 0
; wipe_tower = 0
; wipe_tower_bridging = 10
; wipe_tower_brim = 150%
; wipe_tower_no_sparse_layers = 0
; wipe_tower_rotation_angle = 0
; wipe_tower_width = 60
; wipe_tower_x = 180
; wipe_tower_y = 140
; wiping_volumes_extruders = 70,70
; wiping_volumes_matrix = 0
; xy_size_compensation = 0
; z_offset = 0
exxperto commented 4 years ago

SuperSlicer already done. But sometimes it's got not a correct print height in DWC2

guestisp commented 4 years ago

I've look at current changes and they seems identical to mine in this PR, so probably, superslicer is already supported. But I would keep the Slic3r++ version too, in case someone is still using Slic3r++ before renaming.