Skip to content

Instantly share code, notes, and snippets.

@HaleyLou
Forked from ChipCE/readme.md
Created April 5, 2023 15:21
Show Gist options
  • Select an option

  • Save HaleyLou/06b89a61373ee1b4e8db3ee9fba19822 to your computer and use it in GitHub Desktop.

Select an option

Save HaleyLou/06b89a61373ee1b4e8db3ee9fba19822 to your computer and use it in GitHub Desktop.

Revisions

  1. @ChipCE ChipCE revised this gist Mar 6, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -122,11 +122,11 @@ Ideal maker
    Cura slicer
    <code>BED_MESH_CALIBRATE AREA_START=%MINX%,%MINY% AREA_END=%MAXX%,%MAXY%</code>

    *(Cura slicer plugin) To make the macro to work in Cura slicer, you need to install the [post process plugin by frankbags](https://gist.github.com/frankbags/c85d37d9faff7bce67b6d18ec4e716ff)
    *(Cura slicer plugin) To make the macro to work in Cura slicer, you need to install the [post process plugin by frankbags](https://raw.githubusercontent.com/ChipCE/Slicer-profile/master/cura-slicer/scripts/KlipperPrintArea.py)
    - In cura menu <code>Help</code> -> <code>Show configuration folder</code>.
    - Copy the python script from the above link in to <code>scripts</code> folder.
    - Restart Cura
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> -> <code>Modify G-Code</code> and select <code>Mesh Print Size</code>
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> -> <code>Modify G-Code</code> and select <code>Klipper print area mesh</code>

    ## For user using single command START_PRINT

  2. @ChipCE ChipCE revised this gist Mar 6, 2023. 1 changed file with 7 additions and 4 deletions.
    11 changes: 7 additions & 4 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ variable_mesh_area_offset : 5.0
    ; number of sample per probe point
    variable_probe_samples : 2
    ; minimum probe count
    variable_min_probe_count : 3
    variable_min_probe_count : 4
    ; scale up the probe count, should be 1.0 ~ < variable_max_probe_count/variable_min_probe_count
    variable_probe_count_scale_factor : 1.0
    ; enable preference index
    @@ -89,9 +89,12 @@ gcode:
    {% set meshPointY = meshMaxPointY %}
    {% endif %}

    {% set algorithm = "lagrange" %}
    {% if "algorithm" in bedMeshConfig and meshPointX >=4 and meshPointY >=4 %}
    {% set algorithm = bedMeshConfig.algorithm %}
    {% set algorithm = "bicubic" %}
    {% if "algorithm" in bedMeshConfig %}
    {% set algorithm = bedMeshConfig.algorithm %}
    {% endif %}
    {% if meshPointX >=7 or meshPointY >=7 %}
    {% set algorithm = "bicubic" %}
    {% endif %}

    {% if enable_reference_index %}
  3. @ChipCE ChipCE revised this gist Feb 16, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    ## What this macro do

    - This macro will dymanic change the bed_mesh area based on the size of the printed part. The fw will only probe on the area that the part will be printed (plus mesh_area_offset value)
    - This macro will dynamically changing the bed mesh area based on the size of the parts will be printed. The fw will only probe on the area that the part will be printed (plus mesh_area_offset value)

    ## Setup guide

  4. @ChipCE ChipCE revised this gist Jan 17, 2023. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -150,4 +150,8 @@ And you will need to change Slicer start gcode to this
    ## change logs
    - 2022/07/21
    - Added force lagrange algorithm for mesh with lower than 3 points
    - Added <code>enable_reference_index</code> config flag
    - Added <code>enable_reference_index</code> config flag

    ## The code does not work?
    - I will try to help if possible, you will have to post ALL of your configs, your slicer start gcode and your sliced gcode.
    - If I'm cannot or too slow to respose, our discord members might help you. [Check our discord here](https://discord.gg/WZVP2HuAag)
  5. @ChipCE ChipCE revised this gist Jul 21, 2022. 1 changed file with 11 additions and 3 deletions.
    14 changes: 11 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,8 @@ variable_probe_samples : 2
    variable_min_probe_count : 3
    ; scale up the probe count, should be 1.0 ~ < variable_max_probe_count/variable_min_probe_count
    variable_probe_count_scale_factor : 1.0
    ; enable preference index
    variable_enable_reference_index : False
    gcode:
    {% if params.AREA_START and params.AREA_END %}
    {% set bedMeshConfig = printer["configfile"].config["bed_mesh"] %}
    @@ -92,8 +94,9 @@ gcode:
    {% set algorithm = bedMeshConfig.algorithm %}
    {% endif %}

    {% if "relative_reference_index" in bedMeshConfig %}
    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm} relative_reference_index={bedMeshConfig.relative_reference_index}
    {% if enable_reference_index %}
    {% set referenceIndex = (meshPointX * meshPointY / 2 - 1 )|round(0)|int %}
    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm} relative_reference_index={referenceIndex}
    {% else %}
    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm}
    {% endif %}
    @@ -142,4 +145,9 @@ gcode:
    And you will need to change Slicer start gcode to this

    - Cura: <code>START_PRINT EXTRUDER_TEMP={material_print_temperature_layer_0} BED_TEMP={material_bed_temperature_layer_0} AREA_START=%MINX%,%MINY% AREA_END=%MAXX%,%MAXY%</code>
    - Prusa slicer: <code>START_PRINT EXTRUDER_TEMP=[first_layer_temperature] BED_TEMP=[first_layer_bed_temperature] AREA_START={first_layer_print_min[0]},{first_layer_print_min[1]} AREA_END={first_layer_print_max[0]},{first_layer_print_max[1]}</code>
    - Prusa slicer: <code>START_PRINT EXTRUDER_TEMP=[first_layer_temperature] BED_TEMP=[first_layer_bed_temperature] AREA_START={first_layer_print_min[0]},{first_layer_print_min[1]} AREA_END={first_layer_print_max[0]},{first_layer_print_max[1]}</code>

    ## change logs
    - 2022/07/21
    - Added force lagrange algorithm for mesh with lower than 3 points
    - Added <code>enable_reference_index</code> config flag
  6. @ChipCE ChipCE revised this gist Jul 21, 2022. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -87,12 +87,12 @@ gcode:
    {% set meshPointY = meshMaxPointY %}
    {% endif %}

    {% set algorithm = "lagrange" %}
    {% if "algorithm" in bedMeshConfig and meshPointX >=4 and meshPointY >=4 %}
    {% set algorithm = "lagrange" %}
    {% if "algorithm" in bedMeshConfig and meshPointX >=4 and meshPointY >=4 %}
    {% set algorithm = bedMeshConfig.algorithm %}
    {% endif %}

    {% if "relative_reference_index" in bedMeshConfig %}
    {% if "relative_reference_index" in bedMeshConfig %}
    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm} relative_reference_index={bedMeshConfig.relative_reference_index}
    {% else %}
    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm}
  7. @ChipCE ChipCE revised this gist Jul 21, 2022. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -87,7 +87,16 @@ gcode:
    {% set meshPointY = meshMaxPointY %}
    {% endif %}

    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int}
    {% set algorithm = "lagrange" %}
    {% if "algorithm" in bedMeshConfig and meshPointX >=4 and meshPointY >=4 %}
    {% set algorithm = bedMeshConfig.algorithm %}
    {% endif %}

    {% if "relative_reference_index" in bedMeshConfig %}
    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm} relative_reference_index={bedMeshConfig.relative_reference_index}
    {% else %}
    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm}
    {% endif %}
    {% else %}
    BED_MESH_CALIBRATE_BASE
    {% endif %}
  8. @ChipCE ChipCE revised this gist Feb 24, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -109,7 +109,7 @@ Cura slicer

    *(Cura slicer plugin) To make the macro to work in Cura slicer, you need to install the [post process plugin by frankbags](https://gist.github.com/frankbags/c85d37d9faff7bce67b6d18ec4e716ff)
    - In cura menu <code>Help</code> -> <code>Show configuration folder</code>.
    - Copy the python script from the above link in to <code>plugins</code> folder.
    - Copy the python script from the above link in to <code>scripts</code> folder.
    - Restart Cura
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> -> <code>Modify G-Code</code> and select <code>Mesh Print Size</code>

  9. @ChipCE ChipCE revised this gist Jan 31, 2022. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -34,9 +34,14 @@ gcode:
    {% set area_max_x = params.AREA_END.split(",")[0]|float %}
    {% set area_max_y = params.AREA_END.split(",")[1]|float %}

    {% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|int %}
    {% set meshPointY = bedMeshConfig.probe_count.split(",")[1]|int %}

    {% if bedMeshConfig.probe_count.split(",")|length == 2 %}
    {% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|int %}
    {% set meshPointY = bedMeshConfig.probe_count.split(",")[1]|int %}
    {% else %}
    {% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|int %}
    {% set meshPointY = bedMeshConfig.probe_count.split(",")[0]|int %}
    {% endif %}

    {% set meshMaxPointX = meshPointX %}
    {% set meshMaxPointY = meshPointY %}

  10. @ChipCE ChipCE revised this gist Dec 25, 2021. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -128,5 +128,4 @@ gcode:
    And you will need to change Slicer start gcode to this

    - Cura: <code>START_PRINT EXTRUDER_TEMP={material_print_temperature_layer_0} BED_TEMP={material_bed_temperature_layer_0} AREA_START=%MINX%,%MINY% AREA_END=%MAXX%,%MAXY%</code>
    - Prusa slicer: <code>START_PRINT EXTRUDER_TEMP=[first_layer_temperature] BED_TEMP=[first_layer_bed_temperature] AREA_START={first_layer_print_min[0]},{first_layer_print_min[1]} AREA_END={first_layer_print_max[0]},{first_layer_print_max[1]}
    </code>
    - Prusa slicer: <code>START_PRINT EXTRUDER_TEMP=[first_layer_temperature] BED_TEMP=[first_layer_bed_temperature] AREA_START={first_layer_print_min[0]},{first_layer_print_min[1]} AREA_END={first_layer_print_max[0]},{first_layer_print_max[1]}</code>
  11. @ChipCE ChipCE revised this gist Dec 25, 2021. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -125,7 +125,8 @@ gcode:
    # the rest of your start macro here
    </pre>

    - And you will need to change Slicer start gcode to this
    - Cura: <code>START_PRINT EXTRUDER_TEMP={material_print_temperature_layer_0} BED_TEMP={material_bed_temperature_layer_0} AREA_START=%MINX%,%MINY% AREA_END=%MAXX%,%MAXY%</code>
    - Prusa slicer: <code>START_PRINT EXTRUDER_TEMP=[first_layer_temperature] BED_TEMP=[first_layer_bed_temperature] AREA_START={first_layer_print_min[0]},{first_layer_print_min[1]} AREA_END={first_layer_print_max[0]},{first_layer_print_max[1]}
    And you will need to change Slicer start gcode to this

    - Cura: <code>START_PRINT EXTRUDER_TEMP={material_print_temperature_layer_0} BED_TEMP={material_bed_temperature_layer_0} AREA_START=%MINX%,%MINY% AREA_END=%MAXX%,%MAXY%</code>
    - Prusa slicer: <code>START_PRINT EXTRUDER_TEMP=[first_layer_temperature] BED_TEMP=[first_layer_bed_temperature] AREA_START={first_layer_print_min[0]},{first_layer_print_min[1]} AREA_END={first_layer_print_max[0]},{first_layer_print_max[1]}
    </code>
  12. @ChipCE ChipCE revised this gist Dec 25, 2021. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -126,6 +126,6 @@ gcode:
    </pre>

    - And you will need to change Slicer start gcode to this
    Cura: <code>a</code>
    Prusa slicer: <code>b</code>
    Super slicer: <code>c</code>
    - Cura: <code>START_PRINT EXTRUDER_TEMP={material_print_temperature_layer_0} BED_TEMP={material_bed_temperature_layer_0} AREA_START=%MINX%,%MINY% AREA_END=%MAXX%,%MAXY%</code>
    - Prusa slicer: <code>START_PRINT EXTRUDER_TEMP=[first_layer_temperature] BED_TEMP=[first_layer_bed_temperature] AREA_START={first_layer_print_min[0]},{first_layer_print_min[1]} AREA_END={first_layer_print_max[0]},{first_layer_print_max[1]}
    </code>
  13. @ChipCE ChipCE revised this gist Dec 25, 2021. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -107,7 +107,9 @@ Cura slicer
    - Copy the python script from the above link in to <code>plugins</code> folder.
    - Restart Cura
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> -> <code>Modify G-Code</code> and select <code>Mesh Print Size</code>


    ## For user using single command START_PRINT

    - (*) If you use single command start gcode like <code>START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}</code> .You might need to add parameter parsing to BED_MESH_CALIBRATE inside START_PRINT. This is an example, also check [my macro sample](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)

    <pre>
    @@ -121,6 +123,9 @@ gcode:
    # preheat, homing, etc
    BED_MESH_CALIBRATE AREA_START={params.AREA_START|default("0,0")} AREA_END={params.AREA_END|default("0,0")}
    # the rest of your start macro here
    <pre>
    </pre>

    Slicer config
    - And you will need to change Slicer start gcode to this
    Cura: <code>a</code>
    Prusa slicer: <code>b</code>
    Super slicer: <code>c</code>
  14. @ChipCE ChipCE revised this gist Dec 25, 2021. 1 changed file with 16 additions and 1 deletion.
    17 changes: 16 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -108,4 +108,19 @@ Cura slicer
    - Restart Cura
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> -> <code>Modify G-Code</code> and select <code>Mesh Print Size</code>

    - (*) If you use single command start gcode like <code>START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}</code> .You might need to add parameter parsing to BED_MESH_CALIBRATE inside START_PRINT. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
    - (*) If you use single command start gcode like <code>START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}</code> .You might need to add parameter parsing to BED_MESH_CALIBRATE inside START_PRINT. This is an example, also check [my macro sample](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)

    <pre>
    [gcode_macro START_PRINT]
    variable_parameter_EXTRUDER_TEMP: 190
    variable_parameter_BED_TEMP: 60
    ; gcode parameters for area bed mesh
    variable_parameter_AREA_START : 0,0
    variable_parameter_AREA_END : 0,0
    gcode:
    # preheat, homing, etc
    BED_MESH_CALIBRATE AREA_START={params.AREA_START|default("0,0")} AREA_END={params.AREA_END|default("0,0")}
    # the rest of your start macro here
    <pre>

    Slicer config
  15. @ChipCE ChipCE revised this gist Dec 2, 2021. 1 changed file with 9 additions and 7 deletions.
    16 changes: 9 additions & 7 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,6 @@ variable_mesh_area_offset : 5.0
    variable_probe_samples : 2
    ; minimum probe count
    variable_min_probe_count : 3
    variable_max_probe_count : 6
    ; scale up the probe count, should be 1.0 ~ < variable_max_probe_count/variable_min_probe_count
    variable_probe_count_scale_factor : 1.0
    gcode:
    @@ -35,8 +34,11 @@ gcode:
    {% set area_max_x = params.AREA_END.split(",")[0]|float %}
    {% set area_max_y = params.AREA_END.split(",")[1]|float %}

    {% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|float %}
    {% set meshPointY = bedMeshConfig.probe_count.split(",")[1]|float %}
    {% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|int %}
    {% set meshPointY = bedMeshConfig.probe_count.split(",")[1]|int %}

    {% set meshMaxPointX = meshPointX %}
    {% set meshMaxPointY = meshPointY %}


    {% if (area_min_x < area_max_x) and (area_min_y < area_max_y) %}
    @@ -68,16 +70,16 @@ gcode:
    {% if meshPointX < min_probe_count %}
    {% set meshPointX = min_probe_count %}
    {% endif %}
    {% if meshPointX > max_probe_count %}
    {% set meshPointX = max_probe_count %}
    {% if meshPointX > meshMaxPointX %}
    {% set meshPointX = meshMaxPointX %}
    {% endif %}

    {% set meshPointY = (meshPointY * (area_max_y -area_min_y ) / (safe_max_y - safe_min_y) * probe_count_scale_factor )|round(0)|int %}
    {% if meshPointY < min_probe_count %}
    {% set meshPointY = min_probe_count %}
    {% endif %}
    {% if meshPointY > max_probe_count %}
    {% set meshPointY = max_probe_count %}
    {% if meshPointY > meshMaxPointY %}
    {% set meshPointY = meshMaxPointY %}
    {% endif %}

    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int}
  16. @ChipCE ChipCE revised this gist Dec 2, 2021. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,9 @@ variable_mesh_area_offset : 5.0
    variable_probe_samples : 2
    ; minimum probe count
    variable_min_probe_count : 3
    variable_max_probe_count : 6
    ; scale up the probe count, should be 1.0 ~ < variable_max_probe_count/variable_min_probe_count
    variable_probe_count_scale_factor : 1.0
    gcode:
    {% if params.AREA_START and params.AREA_END %}
    {% set bedMeshConfig = printer["configfile"].config["bed_mesh"] %}
    @@ -61,15 +64,21 @@ gcode:
    {% set area_max_y = safe_max_y %}
    {% endif %}

    {% set meshPointX = (meshPointX * (area_max_x - area_min_x) / (safe_max_x - safe_min_x))|int %}
    {% set meshPointX = (meshPointX * (area_max_x - area_min_x) / (safe_max_x - safe_min_x) * probe_count_scale_factor)|round(0)|int %}
    {% if meshPointX < min_probe_count %}
    {% set meshPointX = min_probe_count %}
    {% endif %}
    {% if meshPointX > max_probe_count %}
    {% set meshPointX = max_probe_count %}
    {% endif %}

    {% set meshPointY = (meshPointY * (area_max_y -area_min_y ) / (safe_max_y - safe_min_y))|int %}
    {% set meshPointY = (meshPointY * (area_max_y -area_min_y ) / (safe_max_y - safe_min_y) * probe_count_scale_factor )|round(0)|int %}
    {% if meshPointY < min_probe_count %}
    {% set meshPointY = min_probe_count %}
    {% endif %}
    {% if meshPointY > max_probe_count %}
    {% set meshPointY = max_probe_count %}
    {% endif %}

    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int}
    {% else %}
  17. @ChipCE ChipCE revised this gist Nov 22, 2021. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -37,8 +37,6 @@ gcode:


    {% if (area_min_x < area_max_x) and (area_min_y < area_max_y) %}
    {% set max_mesh_area = (safe_max_x - safe_min_x)*(safe_max_y - safe_min_y) %}

    {% if area_min_x - mesh_area_offset >= safe_min_x %}
    {% set area_min_x = area_min_x - mesh_area_offset %}
    {% else %}
  18. @ChipCE ChipCE revised this gist Nov 22, 2021. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -28,9 +28,9 @@ gcode:
    {% set safe_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %}

    {% set area_min_x = params.AREA_START.split(",")[0]|float %}
    {% set area_min_y = params.AREA_START.split(",")[1]|float %}
    {% set area_max_x = params.AREA_END.split(",")[0]|float %}
    {% set area_max_y = params.AREA_END.split(",")[1]|float %}
    {% set area_min_y = params.AREA_START.split(",")[1]|float %}
    {% set area_max_x = params.AREA_END.split(",")[0]|float %}
    {% set area_max_y = params.AREA_END.split(",")[1]|float %}

    {% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|float %}
    {% set meshPointY = bedMeshConfig.probe_count.split(",")[1]|float %}
  19. @ChipCE ChipCE revised this gist Nov 22, 2021. 1 changed file with 0 additions and 9 deletions.
    9 changes: 0 additions & 9 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -63,8 +63,6 @@ gcode:
    {% set area_max_y = safe_max_y %}
    {% endif %}

    PRINT MSG="Set custom mesh area to ({area_min_x},{area_min_y}),({area_max_x},{area_max_y})" OUTPUT_TARGET=1

    {% set meshPointX = (meshPointX * (area_max_x - area_min_x) / (safe_max_x - safe_min_x))|int %}
    {% if meshPointX < min_probe_count %}
    {% set meshPointX = min_probe_count %}
    @@ -75,18 +73,11 @@ gcode:
    {% set meshPointY = min_probe_count %}
    {% endif %}

    PRINT MSG="Set custom mesh matrix to {meshPointX}x{meshPointY}" OUTPUT_TARGET=1
    PRINT MSG="Mesh: {meshPointX}x{meshPointY}" OUTPUT_TARGET=2

    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int}
    {% else %}
    PRINT MSG="Invalid custom mesh parameters, probe using default setting" OUTPUT_TARGET=1
    PRINT MSG="Mesh: default" OUTPUT_TARGET=2
    BED_MESH_CALIBRATE_BASE
    {% endif %}
    {% else %}
    PRINT MSG="Invalid custom mesh parameters, probe using default setting" OUTPUT_TARGET=1
    PRINT MSG="Mesh: default" OUTPUT_TARGET=2
    BED_MESH_CALIBRATE_BASE
    {% endif %}
    </pre>
  20. @ChipCE ChipCE revised this gist Nov 22, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -106,6 +106,6 @@ Cura slicer
    - In cura menu <code>Help</code> -> <code>Show configuration folder</code>.
    - Copy the python script from the above link in to <code>plugins</code> folder.
    - Restart Cura
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> and select <code>Mesh Print Size</code>
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> -> <code>Modify G-Code</code> and select <code>Mesh Print Size</code>

    - (*) If you use single command start gcode like <code>START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}</code> .You might need to add parameter parsing to BED_MESH_CALIBRATE inside START_PRINT. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
  21. @ChipCE ChipCE revised this gist Nov 22, 2021. 1 changed file with 67 additions and 40 deletions.
    107 changes: 67 additions & 40 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -6,79 +6,106 @@

    ## Setup guide

    - (1) Add the following macrro to your printer config and set the parameters to match you bed_mesh setting
    - (1) Add the following macrro to your printer config, this will replace the default <code>BED_MESH_CALIBRATE</code> command.
    <pre>
    [gcode_macro BED_MESH_PRINT_AREA]
    [gcode_macro BED_MESH_CALIBRATE]
    rename_existing: BED_MESH_CALIBRATE_BASE
    ; gcode parameters
    variable_parameter_AREA_START_X : 0
    variable_parameter_AREA_START_Y : 0
    variable_parameter_AREA_END_X : 150
    variable_parameter_AREA_END_Y : 180
    ; the "safe" area that the probe can reach, use value in config->[bed_mesh]
    variable_mesh_min_x :0
    variable_mesh_min_y :0
    variable_mesh_max_x :150
    variable_mesh_max_y :180
    variable_parameter_AREA_START : 0,0
    variable_parameter_AREA_END : 0,0
    ; the clearance between print area and probe area
    variable_mesh_area_offset : 5
    variable_mesh_area_offset : 5.0
    ; number of sample per probe point
    variable_probe_samples : 2
    ; mesh matrix size
    variable_mesh_size : 6
    ; minimum probe count
    variable_min_probe_count : 3
    gcode:
    {% if (params.AREA_START_X|default(0)|float < params.AREA_END_X|default(0)|float) and (params.AREA_START_Y|default(0)|float < params.AREA_END_Y|default(0)|float) %}
    {% set max_mesh_area = (mesh_max_x|float - mesh_min_x|float)*(mesh_max_y|float - mesh_min_y|float) %}
    {% if params.AREA_START and params.AREA_END %}
    {% set bedMeshConfig = printer["configfile"].config["bed_mesh"] %}
    {% set safe_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %}
    {% set safe_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %}
    {% set safe_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %}
    {% set safe_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %}

    {% if params.AREA_START_X|default(0)|float - mesh_area_offset >= mesh_min_x %}
    {% set mesh_min_x = params.AREA_START_X|default(0)|float - mesh_area_offset %}
    {% set area_min_x = params.AREA_START.split(",")[0]|float %}
    {% set area_min_y = params.AREA_START.split(",")[1]|float %}
    {% set area_max_x = params.AREA_END.split(",")[0]|float %}
    {% set area_max_y = params.AREA_END.split(",")[1]|float %}

    {% set meshPointX = bedMeshConfig.probe_count.split(",")[0]|float %}
    {% set meshPointY = bedMeshConfig.probe_count.split(",")[1]|float %}


    {% if (area_min_x < area_max_x) and (area_min_y < area_max_y) %}
    {% set max_mesh_area = (safe_max_x - safe_min_x)*(safe_max_y - safe_min_y) %}

    {% if area_min_x - mesh_area_offset >= safe_min_x %}
    {% set area_min_x = area_min_x - mesh_area_offset %}
    {% else %}
    {% set area_min_x = safe_min_x %}
    {% endif %}

    {% if params.AREA_START_Y|default(0)|float - mesh_area_offset >= mesh_min_y %}
    {% set mesh_min_y = params.AREA_START_Y|default(0)|float - mesh_area_offset %}
    {% if area_min_y - mesh_area_offset >= safe_min_y %}
    {% set area_min_y = area_min_y - mesh_area_offset %}
    {% else %}
    {% set area_min_y = safe_min_y %}
    {% endif %}

    {% if params.AREA_END_X|default(0)|float + mesh_area_offset <= mesh_max_x %}
    {% set mesh_max_x = params.AREA_END_X|default(0)|float + mesh_area_offset %}
    {% if area_max_x + mesh_area_offset <= safe_max_x %}
    {% set area_max_x = area_max_x + mesh_area_offset %}
    {% else %}
    {% set area_max_x = safe_max_x %}
    {% endif %}

    {% if params.AREA_END_Y|default(0)|float + mesh_area_offset <= mesh_max_y %}
    {% set mesh_max_y = params.AREA_END_Y|default(0)|float + mesh_area_offset %}
    {% if area_max_y + mesh_area_offset <= safe_max_y %}
    {% set area_max_y = area_max_y + mesh_area_offset %}
    {% else %}
    {% set area_max_y = safe_max_y %}
    {% endif %}

    PRINT MSG="Set custom mesh area to ({mesh_min_x},{mesh_min_y}),({mesh_max_x},{mesh_max_y})"
    PRINT MSG="Set custom mesh area to ({area_min_x},{area_min_y}),({area_max_x},{area_max_y})" OUTPUT_TARGET=1

    {% if (params.AREA_END_X|float - params.AREA_START_X|float)*(params.AREA_END_Y|float - params.AREA_START_Y|float) < (max_mesh_area * 0.85) %}
    {% set mesh_size = 5 %}
    {% elif (params.AREA_END_X|float - params.AREA_START_X|float)*(params.AREA_END_Y|float - params.AREA_START_Y|float) < (max_mesh_area * 0.65) %}
    {% set mesh_size = 4 %}
    {% elif (params.AREA_END_X|float - params.AREA_START_X|float)*(params.AREA_END_Y|float - params.AREA_START_Y|float) < (max_mesh_area * 0.50) %}
    {% set mesh_size = 3 %}
    {% set meshPointX = (meshPointX * (area_max_x - area_min_x) / (safe_max_x - safe_min_x))|int %}
    {% if meshPointX < min_probe_count %}
    {% set meshPointX = min_probe_count %}
    {% endif %}
    PRINT MSG="Set custom mesh matrix to {mesh_size}x{mesh_size}"

    BED_MESH_CALIBRATE mesh_min={mesh_min_x|float},{mesh_min_y|float} mesh_max={mesh_max_x|float},{mesh_max_y|float} probe_count={mesh_size|int},{mesh_size|int} samples={probe_samples|int}
    {% set meshPointY = (meshPointY * (area_max_y -area_min_y ) / (safe_max_y - safe_min_y))|int %}
    {% if meshPointY < min_probe_count %}
    {% set meshPointY = min_probe_count %}
    {% endif %}

    PRINT MSG="Set custom mesh matrix to {meshPointX}x{meshPointY}" OUTPUT_TARGET=1
    PRINT MSG="Mesh: {meshPointX}x{meshPointY}" OUTPUT_TARGET=2

    BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int}
    {% else %}
    PRINT MSG="Invalid custom mesh parameters, probe using default setting"
    BED_MESH_CALIBRATE
    PRINT MSG="Invalid custom mesh parameters, probe using default setting" OUTPUT_TARGET=1
    PRINT MSG="Mesh: default" OUTPUT_TARGET=2
    BED_MESH_CALIBRATE_BASE
    {% endif %}

    {% else %}
    PRINT MSG="Invalid custom mesh parameters, probe using default setting" OUTPUT_TARGET=1
    PRINT MSG="Mesh: default" OUTPUT_TARGET=2
    BED_MESH_CALIBRATE_BASE
    {% endif %}
    </pre>

    - (2) Go to slicer setting and replace the old bed mesh gcode the following command.

    Prusa Slicer
    <code>BED_MESH_PRINT_AREA AREA_START_X={first_layer_print_min[0]} AREA_START_Y={first_layer_print_min[1]} AREA_END_X={first_layer_print_max[0]} AREA_END_Y={first_layer_print_max[1]}</code>
    <code>BED_MESH_CALIBRATE AREA_START={first_layer_print_min[0]},{first_layer_print_min[1]} AREA_END={first_layer_print_max[0]},{first_layer_print_max[1]}</code>

    Ideal maker
    <code>BED_MESH_PRINT_AREA AREA_START_X={print_pos_min_x} AREA_START_Y={print_pos_min_y} AREA_END_X={print_pos_max_x} AREA_END_Y={print_pos_max_y}</code>
    <code>BED_MESH_CALIBRATE AREA_START={print_pos_min_x},{print_pos_min_y} AREA_END={print_pos_max_x},{print_pos_max_y}</code>

    Cura slicer
    <code>BED_MESH_PRINT_AREA AREA_START_X=%MINX% AREA_START_Y=%MINY% AREA_END_X=%MAXX% AREA_END_Y=%MAXY%</code>
    <code>BED_MESH_CALIBRATE AREA_START=%MINX%,%MINY% AREA_END=%MAXX%,%MAXY%</code>

    *(Cura slicer plugin) To make the macro to work in Cura slicer, you need to install the [post process plugin by frankbags](https://gist.github.com/frankbags/c85d37d9faff7bce67b6d18ec4e716ff)
    - In cura menu <code>Help</code> -> <code>Show configuration folder</code>.
    - Copy the python script from the above link in to <code>plugins</code> folder.
    - Restart Cura
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> and select <code>Mesh Print Size</code>

    - (*) If you use single command start gcode like <code>START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}</code> .You might need to add parameter parsing to BED_MESH_PRINT_AREA inside START_PRINT. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
    - (*) If you use single command start gcode like <code>START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}</code> .You might need to add parameter parsing to BED_MESH_CALIBRATE inside START_PRINT. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
  22. @ChipCE ChipCE revised this gist Nov 21, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -72,7 +72,7 @@ Prusa Slicer
    Ideal maker
    <code>BED_MESH_PRINT_AREA AREA_START_X={print_pos_min_x} AREA_START_Y={print_pos_min_y} AREA_END_X={print_pos_max_x} AREA_END_Y={print_pos_max_y}</code>

    Cura slicer
    Cura slicer
    <code>BED_MESH_PRINT_AREA AREA_START_X=%MINX% AREA_START_Y=%MINY% AREA_END_X=%MAXX% AREA_END_Y=%MAXY%</code>

    *(Cura slicer plugin) To make the macro to work in Cura slicer, you need to install the [post process plugin by frankbags](https://gist.github.com/frankbags/c85d37d9faff7bce67b6d18ec4e716ff)
  23. @ChipCE ChipCE revised this gist Nov 21, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -64,7 +64,7 @@ gcode:

    </pre>

    - (2) Go to slicer setting and change the start gcode to
    - (2) Go to slicer setting and replace the old bed mesh gcode the following command.

    Prusa Slicer
    <code>BED_MESH_PRINT_AREA AREA_START_X={first_layer_print_min[0]} AREA_START_Y={first_layer_print_min[1]} AREA_END_X={first_layer_print_max[0]} AREA_END_Y={first_layer_print_max[1]}</code>
  24. @ChipCE ChipCE revised this gist Nov 21, 2021. 1 changed file with 8 additions and 19 deletions.
    27 changes: 8 additions & 19 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -64,32 +64,21 @@ gcode:

    </pre>

    - (2) Edit your START_PRINT macro and add the following parameter under [gcode_macro START_PRINT]. The start and end xy position should match the bed_mesh setting

    <pre>
    variable_parameter_AREA_START_X : 0
    variable_parameter_AREA_START_Y : 0
    variable_parameter_AREA_END_X : 150
    variable_parameter_AREA_END_Y : 180
    </pre>

    - (3) Add the following line into you START_MACRO print. The position should be after G28 and Z_TILT_ADJUST/QUAD_GANTRY_LEVEL
    <code>BED_MESH_PRINT_AREA AREA_START_X={params.AREA_START_X|float} AREA_START_Y={params.AREA_START_Y|float} AREA_END_X={params.AREA_END_X|float} AREA_END_Y={params.AREA_END_Y|float}</code>
    - (4) Go to slicer setting and change the start gcode to
    - (2) Go to slicer setting and change the start gcode to

    Prusa Slicer
    <code>START_PRINT T_BED=[first_layer_bed_temperature] T_EXTRUDER=[first_layer_temperature] AREA_START_X={first_layer_print_min[0]} AREA_START_Y={first_layer_print_min[1]} AREA_END_X={first_layer_print_max[0]} AREA_END_Y={first_layer_print_max[1]}</code>
    <code>BED_MESH_PRINT_AREA AREA_START_X={first_layer_print_min[0]} AREA_START_Y={first_layer_print_min[1]} AREA_END_X={first_layer_print_max[0]} AREA_END_Y={first_layer_print_max[1]}</code>

    Ideal maker
    <code>START_PRINT T_BED=[first_layer_bed_temperature] T_EXTRUDER=[first_layer_temperature] AREA_START_X={print_pos_min_x} AREA_START_Y={print_pos_min_y} AREA_END_X={print_pos_max_x} AREA_END_Y={print_pos_max_y}</code>
    <code>BED_MESH_PRINT_AREA AREA_START_X={print_pos_min_x} AREA_START_Y={print_pos_min_y} AREA_END_X={print_pos_max_x} AREA_END_Y={print_pos_max_y}</code>

    Cura slicer
    <code>START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0} AREA_START_X=%MINX% AREA_START_Y=%MINY% AREA_END_X=%MAXX% AREA_END_Y=%MAXY%</code>

    - (5) You might need to adjust your START_PRINT macro if it not in the same style as mine. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
    <code>BED_MESH_PRINT_AREA AREA_START_X=%MINX% AREA_START_Y=%MINY% AREA_END_X=%MAXX% AREA_END_Y=%MAXY%</code>

    - (Cura slicer plugin) To make the macro to work in Cura slicer, you need to install the [post process plugin by frankbags](https://gist.github.com/frankbags/c85d37d9faff7bce67b6d18ec4e716ff)
    *(Cura slicer plugin) To make the macro to work in Cura slicer, you need to install the [post process plugin by frankbags](https://gist.github.com/frankbags/c85d37d9faff7bce67b6d18ec4e716ff)
    - In cura menu <code>Help</code> -> <code>Show configuration folder</code>.
    - Copy the python script from the above link in to <code>plugins</code> folder.
    - Restart Cura
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> and select <code>Mesh Print Size</code>
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> and select <code>Mesh Print Size</code>

    - (*) If you use single command start gcode like <code>START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0}</code> .You might need to add parameter parsing to BED_MESH_PRINT_AREA inside START_PRINT. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
  25. @ChipCE ChipCE revised this gist Nov 21, 2021. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -83,4 +83,13 @@ Prusa Slicer
    Ideal maker
    <code>START_PRINT T_BED=[first_layer_bed_temperature] T_EXTRUDER=[first_layer_temperature] AREA_START_X={print_pos_min_x} AREA_START_Y={print_pos_min_y} AREA_END_X={print_pos_max_x} AREA_END_Y={print_pos_max_y}</code>

    - (5) You might need to adjust your START_PRINT macro if it not in the same style as mine. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
    Cura slicer
    <code>START_PRINT BED_TEMP={material_bed_temperature_layer_0} EXTRUDER_TEMP={material_print_temperature_layer_0} AREA_START_X=%MINX% AREA_START_Y=%MINY% AREA_END_X=%MAXX% AREA_END_Y=%MAXY%</code>

    - (5) You might need to adjust your START_PRINT macro if it not in the same style as mine. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)

    - (Cura slicer plugin) To make the macro to work in Cura slicer, you need to install the [post process plugin by frankbags](https://gist.github.com/frankbags/c85d37d9faff7bce67b6d18ec4e716ff)
    - In cura menu <code>Help</code> -> <code>Show configuration folder</code>.
    - Copy the python script from the above link in to <code>plugins</code> folder.
    - Restart Cura
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> and select <code>Mesh Print Size</code>
  26. @ChipCE ChipCE revised this gist Nov 20, 2021. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ variable_probe_samples : 2
    variable_mesh_size : 6
    gcode:
    {% if (params.AREA_START_X|default(0)|float < params.AREA_END_X|default(0)|float) and (params.AREA_START_Y|default(0)|float < params.AREA_END_Y|default(0)|float) %}
    {% set max_mesh_area = (mesh_max_x|float - mesh_min_x|float)*(pmesh_max_y|float - mesh_min_y|float) %}
    {% set max_mesh_area = (mesh_max_x|float - mesh_min_x|float)*(mesh_max_y|float - mesh_min_y|float) %}

    {% if params.AREA_START_X|default(0)|float - mesh_area_offset >= mesh_min_x %}
    {% set mesh_min_x = params.AREA_START_X|default(0)|float - mesh_area_offset %}
    @@ -61,6 +61,7 @@ gcode:
    PRINT MSG="Invalid custom mesh parameters, probe using default setting"
    BED_MESH_CALIBRATE
    {% endif %}

    </pre>

    - (2) Edit your START_PRINT macro and add the following parameter under [gcode_macro START_PRINT]. The start and end xy position should match the bed_mesh setting
  27. @ChipCE ChipCE revised this gist Nov 20, 2021. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -82,5 +82,4 @@ Prusa Slicer
    Ideal maker
    <code>START_PRINT T_BED=[first_layer_bed_temperature] T_EXTRUDER=[first_layer_temperature] AREA_START_X={print_pos_min_x} AREA_START_Y={print_pos_min_y} AREA_END_X={print_pos_max_x} AREA_END_Y={print_pos_max_y}</code>

    - (5) You might need to adjust your START_PRINT macro if it not in the same style as mine. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
    - (optional) In the macro, there is a section to auto scale down the number of probe points based on the size of the print. You can change the number <code>20250.0</code> and <code>13500.0</code> to match your need. The value is in mm^2
    - (5) You might need to adjust your START_PRINT macro if it not in the same style as mine. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
  28. @ChipCE ChipCE revised this gist Nov 20, 2021. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -21,10 +21,14 @@ variable_mesh_max_x :150
    variable_mesh_max_y :180
    ; the clearance between print area and probe area
    variable_mesh_area_offset : 5
    ; number of sample per probe point
    variable_probe_samples : 2
    ; mesh matrix size
    variable_mesh_size : 6
    gcode:
    {% if (params.AREA_START_X|default(0)|float < params.AREA_END_X|default(0)|float) and (params.AREA_START_Y|default(0)|float < params.AREA_END_Y|default(0)|float) %}
    {% set max_mesh_area = (mesh_max_x|float - mesh_min_x|float)*(pmesh_max_y|float - mesh_min_y|float) %}

    {% if params.AREA_START_X|default(0)|float - mesh_area_offset >= mesh_min_x %}
    {% set mesh_min_x = params.AREA_START_X|default(0)|float - mesh_area_offset %}
    {% endif %}
    @@ -43,9 +47,11 @@ gcode:

    PRINT MSG="Set custom mesh area to ({mesh_min_x},{mesh_min_y}),({mesh_max_x},{mesh_max_y})"

    {% if (params.AREA_END_X|float - params.AREA_START_X|float)*(params.AREA_END_Y|float - params.AREA_START_Y|float) < 20250.0 %}
    {% if (params.AREA_END_X|float - params.AREA_START_X|float)*(params.AREA_END_Y|float - params.AREA_START_Y|float) < (max_mesh_area * 0.85) %}
    {% set mesh_size = 5 %}
    {% elif (params.AREA_END_X|float - params.AREA_START_X|float)*(params.AREA_END_Y|float - params.AREA_START_Y|float) < (max_mesh_area * 0.65) %}
    {% set mesh_size = 4 %}
    {% elif (params.AREA_END_X|float - params.AREA_START_X|float)*(params.AREA_END_Y|float - params.AREA_START_Y|float) < 13500.0 %}
    {% elif (params.AREA_END_X|float - params.AREA_START_X|float)*(params.AREA_END_Y|float - params.AREA_START_Y|float) < (max_mesh_area * 0.50) %}
    {% set mesh_size = 3 %}
    {% endif %}
    PRINT MSG="Set custom mesh matrix to {mesh_size}x{mesh_size}"
    @@ -55,7 +61,6 @@ gcode:
    PRINT MSG="Invalid custom mesh parameters, probe using default setting"
    BED_MESH_CALIBRATE
    {% endif %}

    </pre>

    - (2) Edit your START_PRINT macro and add the following parameter under [gcode_macro START_PRINT]. The start and end xy position should match the bed_mesh setting
  29. @ChipCE ChipCE revised this gist Nov 19, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -71,10 +71,10 @@ variable_parameter_AREA_END_Y : 180
    <code>BED_MESH_PRINT_AREA AREA_START_X={params.AREA_START_X|float} AREA_START_Y={params.AREA_START_Y|float} AREA_END_X={params.AREA_END_X|float} AREA_END_Y={params.AREA_END_Y|float}</code>
    - (4) Go to slicer setting and change the start gcode to

    Prusa Slicer
    Prusa Slicer
    <code>START_PRINT T_BED=[first_layer_bed_temperature] T_EXTRUDER=[first_layer_temperature] AREA_START_X={first_layer_print_min[0]} AREA_START_Y={first_layer_print_min[1]} AREA_END_X={first_layer_print_max[0]} AREA_END_Y={first_layer_print_max[1]}</code>

    Ideal maker
    Ideal maker
    <code>START_PRINT T_BED=[first_layer_bed_temperature] T_EXTRUDER=[first_layer_temperature] AREA_START_X={print_pos_min_x} AREA_START_Y={print_pos_min_y} AREA_END_X={print_pos_max_x} AREA_END_Y={print_pos_max_y}</code>

    - (5) You might need to adjust your START_PRINT macro if it not in the same style as mine. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
  30. @ChipCE ChipCE revised this gist Nov 19, 2021. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -69,7 +69,13 @@ variable_parameter_AREA_END_Y : 180

    - (3) Add the following line into you START_MACRO print. The position should be after G28 and Z_TILT_ADJUST/QUAD_GANTRY_LEVEL
    <code>BED_MESH_PRINT_AREA AREA_START_X={params.AREA_START_X|float} AREA_START_Y={params.AREA_START_Y|float} AREA_END_X={params.AREA_END_X|float} AREA_END_Y={params.AREA_END_Y|float}</code>
    - (4) Go to prusa slicer config, printer setting -> Custom G-code -> Start G-code and change the start gcode to
    - (4) Go to slicer setting and change the start gcode to

    Prusa Slicer
    <code>START_PRINT T_BED=[first_layer_bed_temperature] T_EXTRUDER=[first_layer_temperature] AREA_START_X={first_layer_print_min[0]} AREA_START_Y={first_layer_print_min[1]} AREA_END_X={first_layer_print_max[0]} AREA_END_Y={first_layer_print_max[1]}</code>

    Ideal maker
    <code>START_PRINT T_BED=[first_layer_bed_temperature] T_EXTRUDER=[first_layer_temperature] AREA_START_X={print_pos_min_x} AREA_START_Y={print_pos_min_y} AREA_END_X={print_pos_max_x} AREA_END_Y={print_pos_max_y}</code>

    - (5) You might need to adjust your START_PRINT macro if it not in the same style as mine. This is an example [example macro](https://github.com/ChipCE/Slicer-profile/blob/master/klipper/snakeoilxy-180/macro.cfg)
    - (optional) In the macro, there is a section to auto scale down the number of probe points based on the size of the print. You can change the number <code>20250.0</code> and <code>13500.0</code> to match your need. The value is in mm^2