{
    "name": "Mingda Base Printer",
    "version": 2,
    "inherits": "fdmprinter",
    "metadata": {
        "visible": false,
        "author": "Cataclism",
        "manufacturer": "Mingda",
        "file_formats": "text/x-gcode",
        "first_start_actions": ["MachineSettingsAction"],

        "machine_extruder_trains": {
            "0": "mingda_base_extruder_0"
        },

        "has_materials": true,
        "has_variants": true,
        "has_machine_quality": true,
        "variants_name": "Nozzle Size",

        "preferred_variant_name": "0.4mm Nozzle",
        "preferred_quality_type": "standard",
        "preferred_material": "generic_pla",
        "exclude_materials": [
            "Vertex_Delta_ABS",
            "Vertex_Delta_PET",
            "Vertex_Delta_PLA",
            "Vertex_Delta_TPU",
            "chromatik_pla",
            "dsm_arnitel2045_175",
            "dsm_novamid1070_175",
            "fabtotum_abs",
            "fabtotum_nylon",
            "fabtotum_pla",
            "fabtotum_tpu",
            "fiberlogy_hd_pla",
            "filo3d_pla",
            "filo3d_pla_green",
            "filo3d_pla_red",
            "generic_bam",
            "generic_cffcpe",
            "generic_cffpa",
            "generic_cpe",
            "generic_cpe_plus",
            "generic_gffcpe",
            "generic_gffpa",
            "generic_hips",
            "generic_nylon",
            "generic_pc",
            "generic_pp",
            "generic_pva",
            "generic_tough_pla",
            "imade3d_petg_green",
            "imade3d_petg_pink",
            "imade3d_pla_green",
            "imade3d_pla_pink",
            "innofill_innoflex60_175",
            "octofiber_pla",
            "polyflex_pla",
            "polymax_pla",
            "polyplus_pla",
            "polywood_pla",
            "structur3d_dap100silicone",
            "tizyx_abs",
            "tizyx_pla",
            "tizyx_pla_bois",
            "ultimaker_abs_black",
            "ultimaker_abs_blue",
            "ultimaker_abs_green",
            "ultimaker_abs_grey",
            "ultimaker_abs_orange",
            "ultimaker_abs_pearl-gold",
            "ultimaker_abs_red",
            "ultimaker_abs_silver-metallic",
            "ultimaker_abs_white",
            "ultimaker_abs_yellow",
            "ultimaker_bam",
            "ultimaker_cpe_black",
            "ultimaker_cpe_blue",
            "ultimaker_cpe_dark-grey",
            "ultimaker_cpe_green",
            "ultimaker_cpe_light-grey",
            "ultimaker_cpe_plus_black",
            "ultimaker_cpe_plus_transparent",
            "ultimaker_cpe_plus_white",
            "ultimaker_cpe_red",
            "ultimaker_cpe_transparent",
            "ultimaker_cpe_white",
            "ultimaker_cpe_yellow",
            "ultimaker_nylon_black",
            "ultimaker_nylon_transparent",
            "ultimaker_pc_black",
            "ultimaker_pc_transparent",
            "ultimaker_pc_white",
            "ultimaker_pla_black",
            "ultimaker_pla_blue",
            "ultimaker_pla_green",
            "ultimaker_pla_magenta",
            "ultimaker_pla_orange",
            "ultimaker_pla_pearl-white",
            "ultimaker_pla_red",
            "ultimaker_pla_silver-metallic",
            "ultimaker_pla_transparent",
            "ultimaker_pla_white",
            "ultimaker_pla_yellow",
            "ultimaker_pp_transparent",
            "ultimaker_pva",
            "ultimaker_tough_pla_black",
            "ultimaker_tough_pla_green",
            "ultimaker_tough_pla_red",
            "ultimaker_tough_pla_white",
            "ultimaker_tpu_black",
            "ultimaker_tpu_blue",
            "ultimaker_tpu_red",
            "ultimaker_tpu_white",
            "verbatim_bvoh_175",
            "zyyx_pro_flex",
            "zyyx_pro_pla"
        ]
    },
    "overrides": {
        "machine_name": { "default_value": "MINGDA Base Printer" },
        "machine_start_gcode": { "default_value": "G28 ; home all axes\n M117 Purge extruder\n G92 E0 ; reset extruder\n G1 Z1.0 F3000 ; move z up little to prevent scratching of surface\n G1 X2 Y20 Z0.3 F5000.0 ; move to start-line position\n G1 X2 Y200.0 Z0.3 F1500.0 E15 ; draw 1st line\n G1 X2 Y200.0 Z0.4 F5000.0 ; move to side a little\n G1 X2 Y20 Z0.4 F1500.0 E30 ; draw 2nd line\n G92 E0 ; reset extruder\n G1 Z1.0 F3000 ; move z up little to prevent scratching of surface"},
        "machine_end_gcode": { "default_value": "G91; relative positioning\n G1 Z1.0 F3000 ; move z up little to prevent scratching of print\n G90; absolute positioning\n G1 X0 Y200 F1000 ; prepare for part removal\n M104 S0; turn off extruder\n M140 S0 ; turn off bed\n G1 X0 Y300 F1000 ; prepare for part removal\n M84 ; disable motors\n M106 S0 ; turn off fan" },

        "machine_max_feedrate_x": { "value": 500 },
        "machine_max_feedrate_y": { "value": 500 },
        "machine_max_feedrate_z": { "value": 10 },
        "machine_max_feedrate_e": { "value": 50 },

        "machine_max_acceleration_x": { "value": 500 },
        "machine_max_acceleration_y": { "value": 500 },
        "machine_max_acceleration_z": { "value": 100 },
        "machine_max_acceleration_e": { "value": 5000 },
        "machine_acceleration": { "value": 500 },

        "machine_max_jerk_xy": { "value": 10 },
        "machine_max_jerk_z": { "value": 0.4 },
        "machine_max_jerk_e": { "value": 5 },

        "machine_heated_bed": { "default_value": true },

        "material_diameter": { "default_value": 1.75 },

        "acceleration_print": { "value": 500 },
        "acceleration_travel": { "value": 500 },
        "acceleration_travel_layer_0": { "value": "acceleration_travel" },
        "acceleration_roofing": { "enabled": "acceleration_enabled and roofing_layer_count > 0 and top_layers > 0" },

        "jerk_print": { "value": 8 },
        "jerk_travel": { "value": "jerk_print" },
        "jerk_travel_layer_0": { "value": "jerk_travel" },

        "acceleration_enabled": { "value": false },
        "jerk_enabled": { "value": false },

        "speed_print": { "value": 60.0 } ,
        "speed_infill": { "value": "speed_print" },
        "speed_wall": { "value": "speed_print / 2" },
        "speed_wall_0": { "value": "speed_wall" },
        "speed_wall_x": { "value": "speed_wall" },
        "speed_topbottom": { "value": "speed_print / 2" },
        "speed_roofing": { "value": "speed_topbottom" },
        "speed_travel": { "value": "150.0 if speed_print < 60 else 250.0 if speed_print > 100 else speed_print * 2.5" },
        "speed_layer_0": { "value": 20.0 },
        "speed_print_layer_0": { "value": "speed_layer_0" },
        "speed_travel_layer_0": { "value": "100 if speed_layer_0 < 20 else 150 if speed_layer_0 > 30 else speed_layer_0 * 5" },
        "speed_prime_tower": { "value": "speed_topbottom" },
        "speed_support": { "value": "speed_wall_0" },
        "speed_support_interface": { "value": "speed_topbottom" },
        "speed_z_hop": { "value": 5 },

        "skirt_brim_speed": { "value": "speed_layer_0" },

        "line_width": { "value": "machine_nozzle_size * 1.1" },

        "optimize_wall_printing_order": { "value": true },

        "material_initial_print_temperature": { "value": "material_print_temperature" },
        "material_final_print_temperature": { "value": "material_print_temperature" },
        "material_flow": { "value": 100 },
        "travel_compensate_overlapping_walls_0_enabled": { "value": false },

        "z_seam_type": { "value": "'back'" },
        "z_seam_corner": { "value": "'z_seam_corner_none'" },
        
        "infill_sparse_density": { "value": "15" },
        "infill_pattern": { "value": "'lines' if infill_sparse_density > 50 else 'cubic'" },
        "infill_before_walls": { "value": false },
        "infill_overlap": { "value": 30.0 },
        "skin_overlap": { "value": 10.0 },
        "infill_wipe_dist": { "value": 0.0 },
        "wall_0_wipe_dist": { "value": 0.0 },

        "fill_perimeter_gaps": { "value": "'everywhere'" },
        "fill_outline_gaps": { "value": false },
        "filter_out_tiny_gaps": { "value": false },

        "retraction_speed": {
            "maximum_value_warning": "machine_max_feedrate_e if retraction_enable else float('inf')",
            "maximum_value": 200
        },
        "retraction_retract_speed": {
            "maximum_value_warning": "machine_max_feedrate_e if retraction_enable else float('inf')",
            "maximum_value": 200
        },
        "retraction_prime_speed": {
            "maximum_value_warning": "machine_max_feedrate_e if retraction_enable else float('inf')",
            "maximum_value": 200
        },
        
        "retraction_hop_enabled": { "value": true },
        "retraction_hop": { "value": "layer_height*2" },
        "retraction_combing": { "value": "'off' if retraction_hop_enabled else 'infill'" },
        "retraction_combing_max_distance": { "value": 30 },
        "travel_avoid_other_parts": { "value": true },
        "travel_avoid_supports": { "value": true },
        "travel_retract_before_outer_wall": { "value": true },
        
		"retraction_amount": { "value": 2 },
        "retraction_enable": { "value": true },
        "retraction_count_max": { "value": 100 },
        "retraction_extrusion_window": { "value": 10 },
        "retraction_min_travel": { "value": 1.5 },

        "cool_fan_full_at_height": { "value": "layer_height_0 + 2 * layer_height" },
        "cool_fan_enabled": { "value": true },
        "cool_min_layer_time": { "value": 10 },

        "adhesion_type": { "value": "'none' if support_enable else 'skirt'" },
        "brim_replaces_support": { "value": false },
        "skirt_gap": { "value": 10.0 },
        "skirt_line_count": { "value": 4 },

        "adaptive_layer_height_variation": { "value": 0.04 },
        "adaptive_layer_height_variation_step": { "value": 0.04 },

        "meshfix_maximum_resolution": { "value": "0.05" },
        "meshfix_maximum_travel_resolution": { "value": "meshfix_maximum_resolution" },

		"support_angle": { "value": "math.floor(math.degrees(math.atan(line_width / 2.0 / layer_height)))" },        
		"support_pattern": { "value": "'zigzag'" },
        "support_infill_rate": { "value": "0 if support_enable and support_structure == 'tree' else 20" },
        "support_use_towers": { "value": false },
        "support_xy_distance": { "value": "wall_line_width_0 * 2" },
        "support_xy_distance_overhang": { "value": "wall_line_width_0" },
        "support_z_distance": { "value": "layer_height if layer_height >= 0.16 else layer_height * 2" },
        "support_xy_overrides_z": { "value": "'xy_overrides_z'" },
        "support_wall_count": { "value": 1 },
        "support_brim_enable": { "value": true },
        "support_brim_width": { "value": 4 },

        "support_interface_enable": { "value": true },
        "support_interface_height": { "value": "layer_height * 4" },
        "support_interface_density": { "value": 33.333 },
        "support_interface_pattern": { "value": "'grid'" },
        "support_interface_skip_height": { "value": 0.2 },
        "minimum_support_area": { "value": 2 },
        "minimum_interface_area": { "value": 10 },
        "top_bottom_thickness": {"value":  "layer_height_0 + layer_height * 3" },
        "wall_thickness": {"value": "line_width * 2" }

    }
}
