Skip to content

Instantly share code, notes, and snippets.

@boop5
Forked from ChipCE/readme.md
Created February 3, 2025 15:39
Show Gist options
  • Select an option

  • Save boop5/3875d620faff403eba02018c60e219f5 to your computer and use it in GitHub Desktop.

Select an option

Save boop5/3875d620faff403eba02018c60e219f5 to your computer and use it in GitHub Desktop.

Revisions

  1. @ChipCE ChipCE revised this gist Feb 17, 2024. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,7 @@
    # READ THIS
    # READ THIS FIRST

    Adaptive bed mesh is merged into klipper master branch. Yhou can use this feature without this custom macro.
    Adaptive bed mesh is merged into klipper master branch. You can use this feature without this custom macro.
    [Official klipper adaptive bed mesh](https://www.klipper3d.org/Bed_Mesh.html#adaptive-meshes)
    * Only work with Prusa slicer atm.
    * [Exclude object](https://docs.mainsail.xyz/overview/features/exclude-objects) also need to be enabled

    # Klipper mesh on print area only install guide

  2. @ChipCE ChipCE revised this gist Feb 17, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,8 @@

    Adaptive bed mesh is merged into klipper master branch. Yhou can use this feature without this custom macro.
    [Official klipper adaptive bed mesh](https://www.klipper3d.org/Bed_Mesh.html#adaptive-meshes)
    * Only work with Prusa slicer atm.
    * [Exclude object](https://docs.mainsail.xyz/overview/features/exclude-objects) also need to be enabled

    # Klipper mesh on print area only install guide

  3. @ChipCE ChipCE revised this gist Jan 28, 2024. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,8 @@
    # READ THIS

    Adaptive bed mesh is merged into klipper master branch. Yhou can use this feature without this custom macro.
    [Official klipper adaptive bed mesh](https://www.klipper3d.org/Bed_Mesh.html#adaptive-meshes)

    # Klipper mesh on print area only install guide

    ## What this macro do
  4. @ChipCE ChipCE revised this gist Oct 30, 2023. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -123,10 +123,10 @@ 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 [click here to download](https://raw.githubusercontent.com/ChipCE/Slicer-profile/master/cura-slicer/scripts/KlipperPrintArea.py) (based on [frankbags's script](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>scripts</code> folder.
    - Restart Cura
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> -> <code>Modify G-Code</code> and select <code>Klipper print area mesh</code>
    - 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>Klipper print area mesh</code>

    ## For user using single command START_PRINT

  5. @ChipCE ChipCE revised this gist Oct 30, 2023. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -123,10 +123,10 @@ 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 [click here to download](https://raw.githubusercontent.com/ChipCE/Slicer-profile/master/cura-slicer/scripts/KlipperPrintArea.py) (based on [frankbags's script](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>scripts</code> folder.
    - Restart Cura
    - In cura menu <code>Extensions</code> -> <code>Post processing</code> -> <code>Modify G-Code</code> and select <code>Klipper print area mesh</code>
    - 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>Klipper print area mesh</code>

    ## For user using single command START_PRINT

  6. @ChipCE ChipCE revised this gist Oct 30, 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
    @@ -122,7 +122,7 @@ 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 [click here to download](https://raw.githubusercontent.com/ChipCE/Slicer-profile/master/cura-slicer/scripts/KlipperPrintArea.py) (based on [frankbags's script](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 [click here to download](https://raw.githubusercontent.com/ChipCE/Slicer-profile/master/cura-slicer/scripts/KlipperPrintArea.py) (based on [frankbags's script](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>scripts</code> folder.
    - Restart Cura
  7. @ChipCE ChipCE revised this gist Oct 30, 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
    @@ -6,7 +6,7 @@

    ## Setup guide

    - (1) Add the following macrro to your printer config, this will replace the default <code>BED_MESH_CALIBRATE</code> command.
    - (1) Add the following macro to your printer config, this will replace the default <code>BED_MESH_CALIBRATE</code> command.
    <pre>
    [gcode_macro BED_MESH_CALIBRATE]
    rename_existing: BED_MESH_CALIBRATE_BASE
    @@ -122,7 +122,7 @@ 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://raw.githubusercontent.com/ChipCE/Slicer-profile/master/cura-slicer/scripts/KlipperPrintArea.py)
    *(Cura slicer plugin) To make the macro to work in Cura slicer, you need to install the post process plugin [click here to download](https://raw.githubusercontent.com/ChipCE/Slicer-profile/master/cura-slicer/scripts/KlipperPrintArea.py) (based on [frankbags's script](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>scripts</code> folder.
    - Restart Cura
  8. @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

  9. @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 %}
  10. @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

  11. @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)
  12. @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
  13. @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}
  14. @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 %}
  15. @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>

  16. @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 %}

  17. @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>
  18. @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>
  19. @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>
  20. @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>
  21. @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
  22. @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}
  23. @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 %}
  24. @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 %}
  25. @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 %}
  26. @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>
  27. @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)
  28. @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)
  29. @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)
  30. @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>