Changed behaviour of height map interpolation when a point is outside the probe area #184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In one of my recent auto-leveling pcb job, I couldn't probe the whole surface of the job because of the presence of fixtures on two corners of the pcb. So I restricted the probe area to a surface that left some tracks outside of that area. During milling, these tracks haven't be milled because the tool path was too high. I saw that the Z axis was doing an abrupt change of coordinate when crossing the probing area edges.
Looking at the source code of OpenCncPilot I saw that the surface of all points outside of the probe area are considered to be at an height equal to the max probed height. This explain the jump in Z coordinates I saw when crossing the edges of the probe area.
Take as an example the following job with sample data consisting of a lot of small squares, with a probe area that don't cover the whole pcb.
We see that the resulting auto-leveled job has jumps on Z outside the probe area because the max probe height is used there:
So my proposal with this PR is to use instead the probed height of the nearest point on the probe area edge: