diff --git a/docs/Bed_Mesh.md b/docs/Bed_Mesh.md index d2a417dd4..ada3de29d 100644 --- a/docs/Bed_Mesh.md +++ b/docs/Bed_Mesh.md @@ -370,14 +370,68 @@ are identified in green.  +### Adaptive Meshes + +Adaptive bed meshing is a way to speed up the bed mesh generation by only probing +the area of the bed used by the objects being printed. When used, the method will +automatically adjust the mesh parameters based on the area occupied by the defined +print objects. + +The adapted mesh area will be computed from the area defined by the boundaries of all +the defined print objects so it covers every object, including any margins defined in +the configuration. After the area is computed, the number of probe points will be +scaled down based on the ratio of the default mesh area and the adapted mesh area. To +illustrate this consider the following example: + +For a 150mmx150mm bed with `mesh_min` set to `25,25` and `mesh_max` set to `125,125`, +the default mesh area is a 100mmx100mm square. An adapted mesh area of `50,50` +means a ratio of `0.5x0.5` between the adapted area and default mesh area. + +If the `bed_mesh` configuration specified `probe_count` as `7x7`, the adapted bed +mesh will use 4x4 probe points (7 * 0.5 rounded up). + + + +``` +[bed_mesh] +speed: 120 +horizontal_move_z: 5 +mesh_min: 35, 6 +mesh_max: 240, 198 +probe_count: 5, 3 +adaptive_margin: 5 +``` + +- `adaptive_margin` \ + _Default Value: 0_ \ + Margin (in mm) to add around the area of the bed used by the defined objects. The diagram + below shows the adapted bed mesh area with an `adaptive_margin` of 5mm. The adapted mesh + area (area in green) is computed as the used bed area (area in blue) plus the defined margin. + +  + +By nature, adaptive bed meshes use the objects defined by the Gcode file being printed. +Therefore, it is expected that each Gcode file will generate a mesh that probes a different +area of the print bed. Therefore, adapted bed meshes should not be re-used. The expectation +is that a new mesh will be generated for each print if adaptive meshing is used. + +It is also important to consider that adaptive bed meshing is best used on machines that can +normally probe the entire bed and achieve a maximum variance less than or equal to 1 layer +height. Machines with mechanical issues that a full bed mesh normally compensates for may +have undesirable results when attempting print moves **outside** of the probed area. If a +full bed mesh has a variance greater than 1 layer height, caution must be taken when using +adaptive bed meshes and attempting print moves outside of the meshed area. + ## Bed Mesh Gcodes ### Calibration `BED_MESH_CALIBRATE PROFILE=<name> METHOD=[manual | automatic] [<probe_parameter>=<value>] - [<mesh_parameter>=<value>]`\ + [<mesh_parameter>=<value>] [ADAPTIVE=[0|1] [ADAPTIVE_MARGIN=<value>]`\ _Default Profile: default_\ -_Default Method: automatic if a probe is detected, otherwise manual_ +_Default Method: automatic if a probe is detected, otherwise manual_ \ +_Default Adaptive: 0_ \ +_Default Adaptive Margin: 0_ Initiates the probing procedure for Bed Mesh Calibration. @@ -399,6 +453,8 @@ following parameters are available: - `ROUND_PROBE_COUNT` - All beds: - `ALGORITHM` + - `ADAPTIVE` + - `ADAPTIVE_MARGIN` See the configuration documentation above for details on how each parameter applies to the mesh. diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index 3b2f17709..985408091 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -991,6 +991,9 @@ Visual Examples: # Optional points that define a faulty region. See docs/Bed_Mesh.md # for details on faulty regions. Up to 99 faulty regions may be added. # By default no faulty regions are set. +#adaptive_margin: +# An optional margin (in mm) to be added around the bed area used by +# the defined print objects when generating an adaptive mesh. ``` ### [bed_tilt] diff --git a/docs/img/adaptive_bed_mesh.svg b/docs/img/adaptive_bed_mesh.svg new file mode 100644 index 000000000..954ca0b32 --- /dev/null +++ b/docs/img/adaptive_bed_mesh.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Do not edit this file with editors other than draw.io --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="891px" height="719px" viewBox="-0.5 -0.5 891 719" content="<mxfile host="app.diagrams.net" modified="2023-11-20T23:21:00.371Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36" etag="uzE3l4u1UXjvh0Ybzm1X" version="22.1.3" type="device"> <diagram name="Page-1" id="9aYWBSPtCap1D5Vuddur"> <mxGraphModel dx="2472" dy="813" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" background="#ffffff" math="0" shadow="0"> <root> <mxCell id="0" /> <mxCell id="1" parent="0" /> <mxCell id="sZqi1VJqUI8cdP5_EVks-16" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;opacity=50;" parent="1" vertex="1"> <mxGeometry x="109" y="241" width="300" height="290" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-2" value="&lt;b style=&quot;font-size: 20px;&quot;&gt;Origin&lt;br&gt;(0,0)&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> <mxGeometry x="-100" y="730" width="60" height="30" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-13" value="" style="group" parent="1" vertex="1" connectable="0"> <mxGeometry x="610" y="60" width="180" height="80" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-5" value="&lt;h1&gt;Legend&lt;/h1&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;" style="text;html=1;strokeColor=default;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="sZqi1VJqUI8cdP5_EVks-13" vertex="1"> <mxGeometry width="180" height="80" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-6" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" parent="sZqi1VJqUI8cdP5_EVks-13" vertex="1"> <mxGeometry x="9.473684210526317" y="44.8" width="28.42105263157894" height="8" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-8" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="sZqi1VJqUI8cdP5_EVks-13" vertex="1"> <mxGeometry x="9.473684210526317" y="59.2" width="28.42105263157894" height="8" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-9" value="Object Polygon" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="sZqi1VJqUI8cdP5_EVks-13" vertex="1"> <mxGeometry x="37.89473684210527" y="36.8" width="85.26315789473684" height="24" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-10" value="Used Bed Area" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="sZqi1VJqUI8cdP5_EVks-13" vertex="1"> <mxGeometry x="37.89473684210527" y="51.199999999999996" width="85.26315789473684" height="24" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-1" value="" style="whiteSpace=wrap;html=1;aspect=fixed;fillColor=none;strokeWidth=4;strokeColor=#000000;" parent="1" vertex="1"> <mxGeometry x="-70" y="60" width="660" height="660" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-24" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#eeeeee;strokeColor=#36393d;opacity=50;" vertex="1" parent="1"> <mxGeometry x="109" y="431.5" width="40" height="100" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-25" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#eeeeee;strokeColor=#36393d;opacity=50;" vertex="1" parent="1"> <mxGeometry x="308" y="430.5" width="100" height="100" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-35" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;endSize=2;" edge="1" parent="1" source="rSL1Pw579-r8zTYxRfB7-25" target="sZqi1VJqUI8cdP5_EVks-47"> <mxGeometry relative="1" as="geometry"> <Array as="points"> <mxPoint x="390" y="531" /> </Array> </mxGeometry> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-32" value="" style="group" parent="1" vertex="1" connectable="0"> <mxGeometry x="104" y="320.5" width="629" height="427.5" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-31" value="" style="group" parent="sZqi1VJqUI8cdP5_EVks-32" vertex="1" connectable="0"> <mxGeometry x="113" width="133" height="60" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-14" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#eeeeee;strokeColor=#36393d;opacity=50;rotation=90;" parent="sZqi1VJqUI8cdP5_EVks-31" vertex="1"> <mxGeometry x="84" y="-95" width="40" height="100" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-26" value="" style="group" parent="sZqi1VJqUI8cdP5_EVks-32" vertex="1" connectable="0"> <mxGeometry y="18" width="629" height="409.5" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-3" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#eeeeee;strokeColor=#36393d;opacity=50;" parent="sZqi1VJqUI8cdP5_EVks-26" vertex="1"> <mxGeometry x="5" y="-31" width="40" height="100" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-29" value="" style="group" parent="sZqi1VJqUI8cdP5_EVks-26" vertex="1" connectable="0"> <mxGeometry x="60" y="32" width="569" height="377.5" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-15" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#eeeeee;strokeColor=#36393d;opacity=50;" parent="sZqi1VJqUI8cdP5_EVks-29" vertex="1"> <mxGeometry x="17" y="-47" width="100" height="100" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-47" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" parent="sZqi1VJqUI8cdP5_EVks-29" vertex="1"> <mxGeometry x="238.19075000000004" y="153.49850000000004" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-45" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" parent="sZqi1VJqUI8cdP5_EVks-29" vertex="1"> <mxGeometry x="133.00075000000004" y="57.498500000000035" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-49" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" parent="sZqi1VJqUI8cdP5_EVks-26" vertex="1"> <mxGeometry x="-0.8092499999999632" y="186.49850000000004" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-44" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" parent="sZqi1VJqUI8cdP5_EVks-26" vertex="1"> <mxGeometry x="98.19075000000004" y="89.49850000000004" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-55" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;endSize=2;" parent="sZqi1VJqUI8cdP5_EVks-26" source="sZqi1VJqUI8cdP5_EVks-45" target="sZqi1VJqUI8cdP5_EVks-44" edge="1"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-30" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" vertex="1" parent="sZqi1VJqUI8cdP5_EVks-26"> <mxGeometry x="-0.8092499999999916" y="-7.0014999999999645" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endSize=2;" edge="1" parent="1" source="sZqi1VJqUI8cdP5_EVks-41" target="rSL1Pw579-r8zTYxRfB7-33"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-41" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" parent="1" vertex="1"> <mxGeometry x="403.19075000000004" y="331.18850000000003" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-58" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endSize=2;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="sZqi1VJqUI8cdP5_EVks-42" target="sZqi1VJqUI8cdP5_EVks-41" edge="1"> <mxGeometry relative="1" as="geometry"> <mxPoint x="-150" y="355.8837209302326" as="targetPoint" /> </mxGeometry> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-42" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" parent="1" vertex="1"> <mxGeometry x="296.09075" y="331.18850000000003" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-57" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endSize=2;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="sZqi1VJqUI8cdP5_EVks-43" target="sZqi1VJqUI8cdP5_EVks-42" edge="1"> <mxGeometry relative="1" as="geometry"> <mxPoint x="-190" y="355.8837209302326" as="targetPoint" /> </mxGeometry> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-43" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" parent="1" vertex="1"> <mxGeometry x="202.09075" y="331.18850000000003" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-54" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;endSize=2;" parent="1" source="sZqi1VJqUI8cdP5_EVks-46" target="sZqi1VJqUI8cdP5_EVks-45" edge="1"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-46" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" parent="1" vertex="1"> <mxGeometry x="402.19075000000004" y="428.34850000000006" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-53" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endSize=2;" parent="1" source="sZqi1VJqUI8cdP5_EVks-47" target="sZqi1VJqUI8cdP5_EVks-46" edge="1"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-34" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;startSize=1;endSize=2;" edge="1" parent="1" source="sZqi1VJqUI8cdP5_EVks-48" target="rSL1Pw579-r8zTYxRfB7-27"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-48" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" parent="1" vertex="1"> <mxGeometry x="202.09075" y="524.9985" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="sZqi1VJqUI8cdP5_EVks-51" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endSize=2;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="sZqi1VJqUI8cdP5_EVks-49" target="sZqi1VJqUI8cdP5_EVks-48" edge="1"> <mxGeometry relative="1" as="geometry"> <mxPoint x="-190" y="435.79999999999995" as="targetPoint" /> </mxGeometry> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-1" value="" style="group" vertex="1" connectable="0" parent="1"> <mxGeometry x="96" y="231.5" width="133" height="60" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-2" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#eeeeee;strokeColor=#36393d;opacity=50;rotation=90;" vertex="1" parent="rSL1Pw579-r8zTYxRfB7-1"> <mxGeometry x="43" y="-20" width="40" height="100" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-31" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" vertex="1" parent="rSL1Pw579-r8zTYxRfB7-1"> <mxGeometry x="8.00075000000001" y="4.4985000000000355" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-27" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" vertex="1" parent="1"> <mxGeometry x="296.09075" y="524.9985" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-42" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;endSize=2;" edge="1" parent="1" source="rSL1Pw579-r8zTYxRfB7-28" target="rSL1Pw579-r8zTYxRfB7-31"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-28" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" vertex="1" parent="1"> <mxGeometry x="202.09075" y="235.99850000000004" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-37" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endSize=2;" edge="1" parent="1" source="rSL1Pw579-r8zTYxRfB7-29" target="rSL1Pw579-r8zTYxRfB7-30"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-29" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" vertex="1" parent="1"> <mxGeometry x="103.09075000000001" y="427.99850000000004" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-41" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;endSize=2;" edge="1" parent="1" source="rSL1Pw579-r8zTYxRfB7-32" target="rSL1Pw579-r8zTYxRfB7-28"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-32" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" vertex="1" parent="1"> <mxGeometry x="296.09075" y="235.99850000000004" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-40" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;endSize=2;" edge="1" parent="1" source="rSL1Pw579-r8zTYxRfB7-33" target="rSL1Pw579-r8zTYxRfB7-32"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-33" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#0050ef;strokeColor=#001DBC;fontColor=#ffffff;snapToPoint=1;direction=east;" vertex="1" parent="1"> <mxGeometry x="403.19075" y="235.99850000000004" width="11.811" height="11.81" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-36" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;endSize=2;" edge="1" parent="1" source="sZqi1VJqUI8cdP5_EVks-44" target="rSL1Pw579-r8zTYxRfB7-29"> <mxGeometry relative="1" as="geometry" /> </mxCell> <mxCell id="rSL1Pw579-r8zTYxRfB7-38" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;endSize=2;" edge="1" parent="1" source="rSL1Pw579-r8zTYxRfB7-30" target="sZqi1VJqUI8cdP5_EVks-43"> <mxGeometry relative="1" as="geometry" /> </mxCell> </root> </mxGraphModel> </diagram> </mxfile> " style="background-color: rgb(255, 255, 255);"><defs/><g><rect x="209" y="191" width="300" height="290" fill-opacity="0.5" fill="#dae8fc" stroke="#6c8ebf" stroke-opacity="0.5" pointer-events="all"/><rect x="0" y="680" width="60" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 695px; margin-left: 1px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><b style="font-size: 20px;">Origin<br />(0,0)</b></div></div></div></foreignObject><text x="30" y="699" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Origin...</text></switch></g><rect x="710" y="10" width="180" height="80" fill="none" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 172px; height: 1px; padding-top: 0px; margin-left: 715px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 90px; overflow: hidden;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><h1>Legend</h1><p><br /></p></div></div></div></foreignObject><text x="715" y="12" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">Legend
</text></switch></g><rect x="719.47" y="54.8" width="28.42" height="8" fill="#f5f5f5" stroke="#666666" pointer-events="all"/><rect x="719.47" y="69.2" width="28.42" height="8" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><rect x="747.89" y="46.8" width="85.26" height="24" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 83px; height: 1px; padding-top: 59px; margin-left: 749px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Object Polygon</div></div></div></foreignObject><text x="791" y="62" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Object Polygon</text></switch></g><rect x="747.89" y="61.2" width="85.26" height="24" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 83px; height: 1px; padding-top: 73px; margin-left: 749px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Used Bed Area</div></div></div></foreignObject><text x="791" y="77" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Used Bed Area</text></switch></g><rect x="30" y="10" width="660" height="660" fill="none" stroke="#000000" stroke-width="4" pointer-events="all"/><rect x="209" y="381.5" width="40" height="100" fill-opacity="0.5" fill="#eeeeee" stroke="#36393d" stroke-opacity="0.5" pointer-events="all"/><rect x="408" y="380.5" width="100" height="100" fill-opacity="0.5" fill="#eeeeee" stroke="#36393d" stroke-opacity="0.5" pointer-events="all"/><path d="M 408 480.5 L 490 480.5 L 498.83 480.07" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 501.07 479.96 L 498.15 481.6 L 498.83 480.07 L 498 478.61 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="401" y="175.5" width="40" height="100" fill-opacity="0.5" fill="#eeeeee" stroke="#36393d" stroke-opacity="0.5" transform="rotate(90,421,225.5)" pointer-events="all"/><rect x="209" y="257.5" width="40" height="100" fill-opacity="0.5" fill="#eeeeee" stroke="#36393d" stroke-opacity="0.5" pointer-events="all"/><rect x="281" y="273.5" width="100" height="100" fill-opacity="0.5" fill="#eeeeee" stroke="#36393d" stroke-opacity="0.5" pointer-events="all"/><ellipse cx="508.1" cy="479.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><ellipse cx="402.91" cy="383.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><ellipse cx="209.1" cy="480.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><ellipse cx="308.1" cy="383.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 397 383.9 L 317.37 383.9" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 315.12 383.9 L 318.12 382.4 L 317.37 383.9 L 318.12 385.4 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="209.1" cy="287.4" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 509.1 281.19 L 509.1 201.18" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 509.1 198.93 L 510.6 201.93 L 509.1 201.18 L 507.6 201.93 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="509.1" cy="287.09" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 407.9 287.09 L 499.82 287.09" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 502.07 287.09 L 499.07 288.59 L 499.82 287.09 L 499.07 285.59 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="402" cy="287.09" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 313.9 287.09 L 392.72 287.09" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 394.97 287.09 L 391.97 288.59 L 392.72 287.09 L 391.97 285.59 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="308" cy="287.09" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 502.19 384.25 L 455.5 384.3 L 412.18 383.93" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 409.93 383.91 L 412.94 382.44 L 412.18 383.93 L 412.92 385.44 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="508.1" cy="384.25" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 508.1 474 L 508.1 393.53" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 508.1 391.28 L 509.6 394.28 L 508.1 393.53 L 506.6 394.28 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 313.9 480.9 L 392.72 480.9" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 394.97 480.9 L 391.97 482.4 L 392.72 480.9 L 391.97 479.4 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="308" cy="480.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 215 480.9 L 298.72 480.9" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 300.97 480.9 L 297.97 482.4 L 298.72 480.9 L 297.97 479.4 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="239" y="161.5" width="40" height="100" fill-opacity="0.5" fill="#eeeeee" stroke="#36393d" stroke-opacity="0.5" transform="rotate(90,259,211.5)" pointer-events="all"/><ellipse cx="209.91" cy="191.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><ellipse cx="402" cy="480.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 302.09 191.9 L 219.18 191.9" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 216.93 191.9 L 219.93 190.4 L 219.18 191.9 L 219.93 193.4 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="308" cy="191.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 209 378 L 209 335.7 L 209.09 296.68" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 209.09 294.43 L 210.59 297.43 L 209.09 296.68 L 207.59 297.42 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="209" cy="383.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 396.09 191.9 L 317.27 191.9" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 315.02 191.9 L 318.02 190.4 L 317.27 191.9 L 318.02 193.4 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="402" cy="191.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 503.19 191.9 L 411.27 191.9" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 409.02 191.9 L 412.02 190.4 L 411.27 191.9 L 412.02 193.4 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="509.1" cy="191.9" rx="5.9055" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 302.19 383.9 L 218.27 383.9" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 216.02 383.9 L 219.02 382.4 L 218.27 383.9 L 219.02 385.4 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 215 287.4 L 258.6 287.4 L 298.72 287.12" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 300.97 287.1 L 297.98 288.62 L 298.72 287.12 L 297.96 285.62 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg> \ No newline at end of file diff --git a/docs/img/adaptive_bed_mesh_margin.svg b/docs/img/adaptive_bed_mesh_margin.svg new file mode 100644 index 000000000..6c6216d04 --- /dev/null +++ b/docs/img/adaptive_bed_mesh_margin.svg @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Do not edit this file with editors other than draw.io --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="901px" height="719px" viewBox="-0.5 -0.5 901 719" content="<mxfile host="app.diagrams.net" modified="2023-10-09T16:08:10.185Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36" etag="9oU6p2ILMxrigHTZD8KX" version="22.0.3" type="device"><diagram name="Page-1" id="9aYWBSPtCap1D5Vuddur">7Vxbc9o4FP41zKQPYXSxjP0YSPY27bQzabvtvuwYLIwbx6LGNGR//Uq2fEMyKBQDKbgzjX1ky+Z85/vOkWTo4dHj6vfEm8/eMZ9GPQT8VQ/f9hCCtmvzP8LynFssm+SGIAl9eVJluA//o9IIpHUZ+nTRODFlLErDedM4YXFMJ2nD5iUJe2qeNmVR865zL6CK4X7iRar179BPZ7nVIaCy/0HDYFbcGQLZMvYmD0HClrG8Xw/habblzY9e0Zc8fzHzfPZUM+G7Hh4ljKX53uNqRCPh28Jt+XW/tbSWz53QODW5YPHP9xB+/uv7pz+dif+B/Hv3+WFxjfJefnjRkhYfw454f8OxeOT0WbrJ/r4Uzzmcsji9XmQg3vAT+P15IAyrdr4XiL/vkzAI47KvpLBf8WccgTdFA3/acdEkvVTeEqV0Jeyz9DHiBsh3F2nCHuiIRSzhlpjFVDxSGEVrJi8Kg5gfTrhrKLcPf9AkDTnmN7LhMfR9cZvh0yxM6f3cm4h7PvEI57YMUyq8BsrHEh3QVavnYYkn5wlljzRNnvkp8oLrMmYkRwZYHj9VEWdL06wWbMVpnozxoOy6wpnvSKhfADvEGtzX3C9ie9766SUdvXFxOnipV2zYdIqt+gS6GqeUzty7V0grGWawiNK3NKCc8VX8Vk2Fcb5uqMK/dt1857j36dRbZt1oQn/BYzmMA24g1dFHxuP69hqBlohnHOBplInTjDODxruxYEOoqVFwPJjt7bHf/PA6l9XQqaMgkgAR/6RW1uz5pqDJW+xs68TLRTdNqlkq1bAWgo4QcLpFwPeoM51oPT1x6Hh6QE8T57iedhVPvx9/E2UUAh9Y9Byw+DWn3V0AspoAaTKxTo26y8RAQejTgnsBgWH2/01CvTOHyFI5dFiIYMdyRajjWzq5ctAYHzQxDMhx5Qqq45Eb35unNUK8o4vZhRdZwayCBa2DEmM7L7YwwVvM8zH9NFwJ/2kr2gzCYmyu5QnItj0N1gZbhyW2bqxWGvfuZqwWrFdCAEcD8uY1U2AzDhCSZhYoJpqONWbGAxUGKO424qz7hYHAyG4AgRzruEBAFYiTzMdb4ttqxjcGTl8V9DLVNtKvC4tT9+/cjkfHBmMzJiYtUuEWsi8tWdN0rKn6oS6GIUFdqYla6Sh+7noGDgKr6RYENCFoI1d1jIUGnYUgNqgrft41G1DZkJOwGjcYa4qBzrTP6paeNNt09MQ2drGv0jNhqZeGTOQl9+eqX7w5Wi3cCNZrpHJYV/12N4+IdNNY+fyumPrrGayfwLb1kyuIiKgsMKmvleTdvv7lkl3gd1Xq6eB2uxIldZ5mf2C7GdYInD3WxawpPCrWyKAGOnACko6B6lSYPj0Dt7v0fGoZaPcwzIFuX6FsDnyKyamjJRzYZcIRJcvIPR8J2oK9tYa9IfhdSRJUF3L2mH6ySQx8wV5246gzTQdNPzqsD5N+tgni2jBa5QSxNdkID7obLELdSxuvNR25L0pHapFUpp4DDYDaX5jZU03snJEmbQZfyUdYM1VzUJXSzcLuefQLL/CXs8XHzUmWwZw77yacL9ocZbrqly3nEUCnOs0FAN4ORz3l3Sr54i2/IvbmH9kHFmbOFjfzw4TfLJ+got4i7RQlh/ShCwYEyK05vwoR7luuU7YCdSEFwr5TCHtDxIW9K2wNUugFWwf2OWJt0CKniSzWrM0fA1qDUvIcoN1c1mJrI2uJfZKsNVgJuEC7GVobnCRrCVGR9AN6Lw9Zks5YwGIvuqusa4VIdc5blr38LRz/jabps/wGjrdMWTMG6CpMv8jLxf5Xsd8n8uh2VWu6fS4OYv55vxQdiIPaVeKwuiw7qq4rvgmESvTFR9wFe+4ntkwm1CDDpV4S0E095qRSoymhkZeGP5rPt39KGyx8/lqU3vLmieVuYi8GqA+dOn1Pg73OMdkLX8TeOgtLLoOXcdmAvdCUp8iUpy2BY8xTeWkew7UvapG1GS5C+o6DBwi4PNrKN6GKHvPnlJ2shU35VD+hB+iiB3U9QJbVB0IPXoUMDC4ysKsMYFMZQB3JgHtSMmCw4npOMgCx+4pkwFaxOmAtX1L/a535m2v5Gte/1kv7fdXyxjJgmcpAy9cmDlO1E+uoCJ/iaM0YYdsUYXJMhC2D94HOSYC3jctcp4+tmhKrSxdHUWJ8UeJdeTow5WnLbNyBlFhDy0vJbYawY4rwoKOSe23kbWHSH7i1be0Fkq5rboOfKDgnydcPvS3X6runtzRSvD580YGX64BrqgNORzrgHkgH+GH121v56dUPnOG7/wE=</diagram></mxfile>" style="background-color: rgb(255, 255, 255);"><defs/><g><rect x="0" y="680" width="60" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 695px; margin-left: 1px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><b style="font-size: 20px;">Origin<br />(0,0)</b></div></div></div></foreignObject><text x="30" y="699" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Origin...</text></switch></g><rect x="710" y="10" width="190" height="100" fill="none" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe flex-start; justify-content: unsafe flex-start; width: 182px; height: 1px; padding-top: 0px; margin-left: 715px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: left; max-height: 110px; overflow: hidden;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><h1>Legend</h1><p><br /></p></div></div></div></foreignObject><text x="715" y="12" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px">Legend
</text></switch></g><rect x="720" y="50" width="30" height="10" fill="#f5f5f5" stroke="#666666" pointer-events="all"/><rect x="720" y="68" width="30" height="10" fill="#dae8fc" stroke="#6c8ebf" pointer-events="all"/><rect x="750" y="40" width="90" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 88px; height: 1px; padding-top: 55px; margin-left: 751px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Object Polygon</div></div></div></foreignObject><text x="795" y="59" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Object Polygon</text></switch></g><rect x="750" y="58" width="90" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 88px; height: 1px; padding-top: 73px; margin-left: 751px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Used Bed Area</div></div></div></foreignObject><text x="795" y="77" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Used Bed Area</text></switch></g><rect x="720" y="85" width="30" height="10" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/><rect x="750" y="75" width="140" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 138px; height: 1px; padding-top: 90px; margin-left: 751px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Adapted Bed Mesh Area</div></div></div></foreignObject><text x="820" y="94" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Adapted Bed Mesh Area</text></switch></g><rect x="30" y="10" width="660" height="660" fill="none" stroke="#000000" stroke-width="4" pointer-events="all"/><rect x="215" y="446" width="60" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 461px; margin-left: 216px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">(90,75)</div></div></div></foreignObject><text x="245" y="465" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">(90,75)</text></switch></g><rect x="426" y="234" width="60" height="30" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 249px; margin-left: 427px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">(130,140)</div></div></div></foreignObject><text x="456" y="253" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">(130,140)</text></switch></g><rect x="245" y="258.5" width="210" height="191.5" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/><rect x="270" y="280" width="160" height="152" fill-opacity="0.5" fill="#dae8fc" stroke="#6c8ebf" stroke-opacity="0.5" pointer-events="all"/><rect x="360" y="250.5" width="40" height="100" fill-opacity="0.5" fill="#eeeeee" stroke="#36393d" stroke-opacity="0.5" transform="rotate(90,380,300.5)" pointer-events="all"/><rect x="410" y="270.5" width="40" height="9" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 38px; height: 1px; padding-top: 275px; margin-left: 411px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><font style="font-size: 10px;">(125,135)</font></div></div></div></foreignObject><text x="430" y="279" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">(125,1...</text></switch></g><rect x="317" y="321.5" width="40" height="9" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 38px; height: 1px; padding-top: 326px; margin-left: 318px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><font style="font-size: 10px;">(95,120)</font></div></div></div></foreignObject><text x="337" y="330" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">(95,12...</text></switch></g><rect x="270" y="300.5" width="40" height="100" fill-opacity="0.5" fill="#eeeeee" stroke="#36393d" stroke-opacity="0.5" pointer-events="all"/><rect x="250" y="400.5" width="40" height="9" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 38px; height: 1px; padding-top: 405px; margin-left: 251px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><font style="font-size: 10px;">(60,90)</font></div></div></div></foreignObject><text x="270" y="409" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">(60,90)</text></switch></g><rect x="290" y="288.5" width="40" height="9" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 38px; height: 1px; padding-top: 293px; margin-left: 291px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><font style="font-size: 10px;">(90,130)</font></div></div></div></foreignObject><text x="310" y="297" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">(90,13...</text></switch></g><rect x="330" y="331.5" width="100" height="100" fill-opacity="0.5" fill="#eeeeee" stroke="#36393d" stroke-opacity="0.5" pointer-events="all"/><rect x="310" y="434" width="40" height="9" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 38px; height: 1px; padding-top: 439px; margin-left: 311px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><font style="font-size: 10px;">(95,80)</font></div></div></div></foreignObject><text x="330" y="442" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">(95,80)</text></switch></g><rect x="410" y="320.5" width="40" height="9" fill="none" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 38px; height: 1px; padding-top: 325px; margin-left: 411px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><font style="font-size: 10px;">(125,110)</font></div></div></div></foreignObject><text x="430" y="329" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">(125,1...</text></switch></g><ellipse cx="455.1" cy="449.9" rx="5.905499999999999" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><ellipse cx="350.91" cy="354.9" rx="5.905499999999999" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><ellipse cx="244.1" cy="450.9" rx="5.905499999999999" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><ellipse cx="244.1" cy="354.9" rx="5.905499999999999" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 345 354.9 L 253.37 354.9" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 251.12 354.9 L 254.12 353.4 L 253.37 354.9 L 254.12 356.4 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="455.1" cy="258.09" rx="5.905499999999999" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 355.9 258.09 L 445.82 258.09" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 448.07 258.09 L 445.07 259.59 L 445.82 258.09 L 445.07 256.59 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="350" cy="258.09" rx="5.905499999999999" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 250.9 258.09 L 340.72 258.09" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 342.97 258.09 L 339.97 259.59 L 340.72 258.09 L 339.97 256.59 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="245" cy="258.09" rx="5.905499999999999" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 244.1 349 L 244.11 306.49 L 244.93 267.37" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 244.97 265.12 L 246.41 268.15 L 244.93 267.37 L 243.41 268.08 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 449.19 354.25 L 403.03 354.31 L 360.18 354.86" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 357.93 354.89 L 360.91 353.35 L 360.18 354.86 L 360.95 356.35 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="455.1" cy="354.25" rx="5.905499999999999" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 455.1 444 L 455.1 363.53" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 455.1 361.28 L 456.6 364.28 L 455.1 363.53 L 453.6 364.28 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><path d="M 355.9 450.9 L 402.57 450.89 L 445.82 449.97" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 448.07 449.93 L 445.11 451.49 L 445.82 449.97 L 445.04 448.49 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><ellipse cx="350" cy="450.9" rx="5.905499999999999" ry="5.905" fill="#0050ef" stroke="#001dbc" pointer-events="all"/><path d="M 250 450.9 L 340.72 450.9" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 342.97 450.9 L 339.97 452.4 L 340.72 450.9 L 339.97 449.4 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg> \ No newline at end of file diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py index 6c714304f..9e30846f0 100644 --- a/klippy/extras/bed_mesh.py +++ b/klippy/extras/bed_mesh.py @@ -1,6 +1,5 @@ # Mesh Bed Leveling # -# Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net> # Copyright (C) 2018-2019 Eric Callahan <arksine.code@gmail.com> # # This file may be distributed under the terms of the GNU GPLv3 license. @@ -291,6 +290,7 @@ class BedMeshCalibrate: self.orig_config = {'radius': None, 'origin': None} self.radius = self.origin = None self.mesh_min = self.mesh_max = (0., 0.) + self.adaptive_margin = config.getfloat('adaptive_margin', 0.0) self.zero_ref_pos = config.getfloatlist( "zero_reference_position", None, count=2 ) @@ -573,6 +573,113 @@ class BedMeshCalibrate: "interpolation. Configured Probe Count: %d, %d" % (self.mesh_config['x_count'], self.mesh_config['y_count'])) params['algo'] = 'lagrange' + def set_adaptive_mesh(self, gcmd): + if not gcmd.get_int('ADAPTIVE', 0): + return False + exclude_objects = self.printer.lookup_object("exclude_object", None) + if exclude_objects is None: + gcmd.respond_info("Exclude objects not enabled. Using full mesh...") + return False + objects = exclude_objects.get_status().get("objects", []) + if not objects: + return False + margin = gcmd.get_float('ADAPTIVE_MARGIN', self.adaptive_margin) + + # List all exclude_object points by axis and iterate over + # all polygon points, and pick the min and max or each axis + list_of_xs = [] + list_of_ys = [] + gcmd.respond_info("Found %s objects" % (len(objects))) + for obj in objects: + for point in obj["polygon"]: + list_of_xs.append(point[0]) + list_of_ys.append(point[1]) + + # Define bounds of adaptive mesh area + mesh_min = [min(list_of_xs), min(list_of_ys)] + mesh_max = [max(list_of_xs), max(list_of_ys)] + adjusted_mesh_min = [x - margin for x in mesh_min] + adjusted_mesh_max = [x + margin for x in mesh_max] + + # Force margin to respect original mesh bounds + adjusted_mesh_min[0] = max(adjusted_mesh_min[0], + self.orig_config["mesh_min"][0]) + adjusted_mesh_min[1] = max(adjusted_mesh_min[1], + self.orig_config["mesh_min"][1]) + adjusted_mesh_max[0] = min(adjusted_mesh_max[0], + self.orig_config["mesh_max"][0]) + adjusted_mesh_max[1] = min(adjusted_mesh_max[1], + self.orig_config["mesh_max"][1]) + + adjusted_mesh_size = (adjusted_mesh_max[0] - adjusted_mesh_min[0], + adjusted_mesh_max[1] - adjusted_mesh_min[1]) + + # Compute a ratio between the adapted and original sizes + ratio = (adjusted_mesh_size[0] / + (self.orig_config["mesh_max"][0] - + self.orig_config["mesh_min"][0]), + adjusted_mesh_size[1] / + (self.orig_config["mesh_max"][1] - + self.orig_config["mesh_min"][1])) + + gcmd.respond_info("Original mesh bounds: (%s,%s)" % + (self.orig_config["mesh_min"], + self.orig_config["mesh_max"])) + gcmd.respond_info("Original probe count: (%s,%s)" % + (self.mesh_config["x_count"], + self.mesh_config["y_count"])) + gcmd.respond_info("Adapted mesh bounds: (%s,%s)" % + (adjusted_mesh_min, adjusted_mesh_max)) + gcmd.respond_info("Ratio: (%s, %s)" % ratio) + + new_x_probe_count = int( + math.ceil(self.mesh_config["x_count"] * ratio[0])) + new_y_probe_count = int( + math.ceil(self.mesh_config["y_count"] * ratio[1])) + + # There is one case, where we may have to adjust the probe counts: + # axis0 < 4 and axis1 > 6 (see _verify_algorithm). + min_num_of_probes = 3 + if max(new_x_probe_count, new_y_probe_count) > 6 and \ + min(new_x_probe_count, new_y_probe_count) < 4: + min_num_of_probes = 4 + + new_x_probe_count = max(min_num_of_probes, new_x_probe_count) + new_y_probe_count = max(min_num_of_probes, new_y_probe_count) + + gcmd.respond_info("Adapted probe count: (%s,%s)" % + (new_x_probe_count, new_y_probe_count)) + + # If the adapted mesh size is too small, adjust it to something + # useful. + adjusted_mesh_size = (max(adjusted_mesh_size[0], new_x_probe_count), + max(adjusted_mesh_size[1], new_y_probe_count)) + + if self.radius is not None: + adapted_radius = math.sqrt((adjusted_mesh_size[0] ** 2) + + (adjusted_mesh_size[1] ** 2)) / 2 + adapted_origin = (adjusted_mesh_min[0] + + (adjusted_mesh_size[0] / 2), + adjusted_mesh_min[1] + + (adjusted_mesh_size[1] / 2)) + to_adapted_origin = math.sqrt(adapted_origin[0]**2 + + adapted_origin[1]**2) + # If the adapted mesh size is smaller than the default/full + # mesh, adjust the parameters. Otherwise, just do the full mesh. + if adapted_radius + to_adapted_origin < self.radius: + self.radius = adapted_radius + self.origin = adapted_origin + self.mesh_min = (-self.radius, -self.radius) + self.mesh_max = (self.radius, self.radius) + self.mesh_config["x_count"] = self.mesh_config["y_count"] = \ + max(new_x_probe_count, new_y_probe_count) + else: + self.mesh_min = adjusted_mesh_min + self.mesh_max = adjusted_mesh_max + self.mesh_config["x_count"] = new_x_probe_count + self.mesh_config["y_count"] = new_y_probe_count + self._profile_name = None + return True def update_config(self, gcmd): # reset default configuration self.radius = self.orig_config['radius'] @@ -616,6 +723,8 @@ class BedMeshCalibrate: self.mesh_config['algo'] = gcmd.get('ALGORITHM').strip().lower() need_cfg_update = True + need_cfg_update |= self.set_adaptive_mesh(gcmd) + if need_cfg_update: self._verify_algorithm(gcmd.error) self._generate_points(gcmd.error) @@ -781,7 +890,8 @@ class BedMeshCalibrate: z_mesh.set_zero_reference(*self.zero_ref_pos) self.bedmesh.set_mesh(z_mesh) self.gcode.respond_info("Mesh Bed Leveling Complete") - self.bedmesh.save_profile(self._profile_name) + if self._profile_name is not None: + self.bedmesh.save_profile(self._profile_name) def _dump_points(self, probed_pts, corrected_pts, offsets): # logs generated points with offset applied, points received # from the finalize callback, and the list of corrected points