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

        "machine_extruder_trains": { "0": "flyingbear_base_extruder_0" },

        "has_materials": true,
        "preferred_material": "generic_pla",

        "has_variants": true,
        "variants_name": "Nozzle Size",
        "preferred_variant_name": "0.4mm Nozzle",

        "has_machine_quality": true,
        "preferred_quality_type": "normal",

        "exclude_materials": [
            "3D-Fuel_PLA_PRO_Black",
            "3D-Fuel_PLA_SnapSupport",
            "chromatik_pla",
            "dsm_arnitel2045_175",
            "dsm_novamid1070_175",
            "emotiontech_abs",
            "emotiontech_absx",
            "emotiontech_acetate",
            "emotiontech_asax",
            "emotiontech_bvoh",
            "emotiontech_hips",
            "emotiontech_petg",
            "emotiontech_pla",
            "emotiontech_pva-m",
            "emotiontech_pva-s",
            "emotiontech_tpu98a",
            "fabtotum_abs",
            "fabtotum_nylon",
            "fabtotum_pla",
            "fabtotum_tpu",
            "fiberlogy_hd_pla",
            "filo3d_pla",
            "filo3d_pla_green",
            "filo3d_pla_red",
            "generic_abs",
            "generic_bam",
            "generic_cffcpe",
            "generic_cffpa",
            "generic_cpe",
            "generic_cpe_plus",
            "generic_gffcpe",
            "generic_gffpa",
            "generic_hips",
            "generic_nylon",
            "generic_pc",
            "generic_petg",
            "generic_pla",
            "generic_pp",
            "generic_pva",
            "generic_tough_pla",
            "generic_tpu",
            "imade3d_petg_175",
            "imade3d_pla_175",
            "innofill_innoflex60_175",
            "leapfrog_abs_natural",
            "leapfrog_epla_natural",
            "leapfrog_pva_natural",
            "octofiber_pla",
            "polyflex_pla",
            "polymax_pla",
            "polyplus_pla",
            "polywood_pla",
            "redd_abs",
            "redd_asa",
            "redd_hips",
            "redd_nylon",
            "redd_petg",
            "redd_pla",
            "redd_tpe",
            "structur3d_dap100silicone",
            "tizyx_abs",
            "tizyx_flex",
            "tizyx_petg",
            "tizyx_pla",
            "tizyx_pla_bois",
            "tizyx_pva",
            "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",
            "Vertex_Delta_ABS",
            "Vertex_Delta_PET",
            "Vertex_Delta_PLA",
            "Vertex_Delta_PLA_Glitter",
            "Vertex_Delta_PLA_Mat",
            "Vertex_Delta_PLA_Satin",
            "Vertex_Delta_PLA_Wood",
            "Vertex_Delta_TPU",
            "zyyx_pro_flex",
            "zyyx_pro_pla"
        ]
    },
    "overrides": {
        "machine_name": { "default_value": "Flying Bear Base Printer" },

        "machine_start_gcode": { "default_value": "M220 S100 ;reset feedrate\nM221 S100 ;reset flowrate\nG90 ;use absolute coordinates\nM82 ;absolute extrusion mode\nG28 ;home\nG1 Z2 F1500 ;raise z\nG92 E0 ;reset extruder\n\nG1 X75 Y5 F5000 ;start position\nG1 Z0.28 F1500 ;lower z\nG1 E4 F500 ;prime the filament\nG1 X180 E10 F500 ;1st line\nG1 Y5.4 F5000\nG1 X75 E20 F500 ;2nd line\nG1 Z2 F1500 ;raise z\nG92 E0 ;reset extruder" },

        "machine_end_gcode": { "default_value": "G91 ;use relative coordinates\nG1 E-4 F1500 ;retract the filament\nG1 X5 Y5 Z0.2 F5000 ;wipe\nG1 Z5 F1500 ;raise z\nG90 ;use absolute coordinates\nG1 X10 Y{machine_depth} F5000 ;park print head\n\nM107 ;turn off fan\nM104 S0 ;turn off hotend\nM140 S0 ;turn off heatbed\nM84 ;disable motors" },

        "machine_heated_bed": { "default_value": true },
        "machine_shape": { "default_value": "rectangular" },
        "machine_buildplate_type": { "value": "glass" },
        "machine_center_is_zero": { "default_value": false },

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

        "layer_height_0": { "value": 0.2 },
        "line_width": { "value": "machine_nozzle_size" },
        "skin_line_width": { "value": "machine_nozzle_size" },
        "infill_line_width": { "value": "line_width + 0.1" },
        "skirt_brim_line_width": { "value": "line_width + 0.1" },
        "support_interface_line_width": { "value": "line_width - 0.1" },

        "wall_thickness": { "value": "line_width * 3" },
        "wall_0_wipe_dist": { "value": 0.0 },
        "top_bottom_thickness": { "value":  "layer_height_0 + layer_height * 3 if layer_height > 0.15 else 0.8" },
        "optimize_wall_printing_order": { "value": true },
        "travel_compensate_overlapping_walls_0_enabled": { "value": false },
        "fill_perimeter_gaps": { "value": "'everywhere'" },
        "filter_out_tiny_gaps": { "value": false },
        "fill_outline_gaps": { "value": false },
        "z_seam_type": { "value": "'sharpest_corner'" },
        "z_seam_corner": { "value": "'z_seam_corner_weighted'" },

        "infill_sparse_density": { "value": 20 },
        "infill_pattern": { "value": "'lines' if infill_sparse_density > 50 else 'cubic'" },
        "infill_overlap": { "value": 30 },
        "skin_overlap": { "value": 10 },
        "infill_wipe_dist": { "value": 0.0 },
        "infill_before_walls": { "value": false },
        "infill_enable_travel_optimization": { "value": true },

        "material_initial_print_temperature": { "value": "material_print_temperature" },
        "material_final_print_temperature": { "value": "material_print_temperature" },
        "material_flow": { "value": 100 },
        "retraction_enable": { "value": true },
        "retraction_min_travel": { "value": 1.5 },
        "retraction_count_max": { "value": 100 },
        "retraction_extrusion_window": { "value": 10 },

        "speed_print": { "value": 60 } ,
        "speed_infill": { "value": "speed_print * 1.5" },
        "speed_wall": { "value": "speed_print / 2" },
        "speed_wall_0": { "value": "speed_wall" },
        "speed_wall_x": { "value": "speed_print" },
        "speed_roofing": { "value": "speed_topbottom" },
        "speed_topbottom": { "value": "speed_print / 2" },
        "speed_support": { "value": "speed_print" },
        "speed_support_interface": { "value": "speed_topbottom" },
        "speed_prime_tower": { "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": "speed_print / 2" },
        "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" },
        "skirt_brim_speed": { "value": "speed_layer_0" },
        "speed_z_hop": { "value": 5 },

        "retraction_combing": { "value": "'off' if retraction_hop_enabled else 'noskin'" },
        "travel_retract_before_outer_wall": { "value": true },
        "retraction_combing_max_distance": { "value": 30 },
        "travel_avoid_other_parts": { "value": true },
        "travel_avoid_supports": { "value": true },
        "retraction_hop_enabled": { "value": false },
        "retraction_hop": { "value": 0.2 },

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

        "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_z_distance": { "value": "layer_height if layer_height >= 0.16 else layer_height*2" },
        "support_xy_distance": { "value": "wall_line_width_0 * 2" },
        "support_xy_overrides_z": { "value": "'xy_overrides_z'" },
        "support_xy_distance_overhang": { "value": "wall_line_width_0" },
        "minimum_support_area": { "value": 5 },
        "minimum_interface_area": { "value": 10 },
        "support_interface_enable": { "value": true },
        "support_interface_height": { "value": "layer_height * 4" },
        "support_interface_skip_height": { "value": 0.2 },
        "support_interface_density": { "value": 33 },
        "support_interface_pattern": { "value": "'grid'" },
        "support_wall_count": { "value": 1 },
        "support_brim_enable": { "value": true },
        "support_brim_width": { "value": 4 },
        "support_use_towers": { "value": false },

        "adhesion_type": { "value": "'skirt'" },
        "skirt_line_count": { "value": 3 },
        "skirt_gap": { "value": 10 },
        "skirt_brim_minimal_length": { "value": 50 },
        "brim_replaces_support": { "value": false },
        "brim_gap": { "value": "line_width / 2 if line_width < 0.4 else 0.2" },

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

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