Repository navigation
AdaptivePocket: check the stock against top_z_mm (#344) - #364
Merged
Merged
Conversation
stevecad#190) The sampled LeadingOracle from tests/roughing.rs (no planner, prover or stock code) now also checks AdaptivePocket's engagement_front runs: the L pocket, both link-feed runs, the square and circular wall-pass pockets, and the three ramp-entry runs. Every cutting and stay-down link stroke's leading contact must stay within acos(1 - stepover / r) plus the same 3 degree sampling slack the roughing test uses. A new test checks the oracle itself: a slot through fresh stock reads the full leading half-circle, and a pass beside a through-cut at 0.5, 1 and 1.5 mm reads acos(1 - w / r) to within its whole-degree count. Test-only: LeadingOracle and its methods become pub(crate) so adaptive.rs and ramp_entry_front.rs can use it; no existing assertion changes.
engagement_front is now the only adaptive planner for AdaptivePocket and Roughing's AdaptiveClearing. The orbit planners, their options (orbit_radius_mm, min_orbit_radius_mm, local_orbit_tolerance_mm, boundary_tolerance_mm, AdaptivePocket's clockwise), their proofs and their tests are removed. Their names and fields are refused when a program is read. Tests that ran on them are converted to the engagement front where they test more than the old planner. Regeneration now treats every adaptive operation as reading committed clearance.
The engagement front planned its first level from the stock's top, so with uncut stock above a lower top_z_mm that level was deeper than stepdown_mm and nothing refused it. AdaptivePocket now runs Pocket's stock-top proof (StockTop) before any motion, plans its levels from top_z_mm, rescans stock it did not see committed, admits each motion against stock left beside the region, and reports stock_top. Without committed stock a lower top is refused.
…#344) A top up to 16 x tolerance_mm below the stock is accepted as the stock model's band, but Pocket and AdaptivePocket then placed their first depth from the authored top: with tolerance 0.01 and a top 0.1 mm below uncut stock the first motion removed 1.1 mm with a 1 mm stepdown. StockTop now reports the highest such stock the cutter can reach, and both plan their depths from it. Regression measures the depth each motion removes from the stock.
…stevecad#190) The earlier serializers wrote orbit_radius_mm and its siblings (null) and boundary_tolerance_mm, and an adaptive pocket's clockwise, for every strategy; engagement_front never used them. A program that chose engagement_front is read without them. One without a path_strategy was planned by the old default, disk_front, and is refused with that reason instead of being read as engagement_front. The regression reads the unchanged roughing-open-block.json from before the removal.
…acing (stevecad#190) The allowance for slivers between sampled discs used the largest sample step for every disc. A move shorter than that step then cleared its own leading edge from its start: a 0.1 mm straight cut in fresh stock read 179 degrees as one move and 0 as 200 moves. Each disc now carries the allowance of its own move's spacing. New test: the same slot and side step read the same split into one move or 200.
# Conflicts: # tests/adaptive.rs
…tevecad#344) Measuring the depths from any stock in the band moved them by a faced top's sweep error (1e-5 mm) and added a redundant last pass where the depth was an exact number of stepdowns (standalone rest example). The depths now move only when the reachable stock is more than tolerance_mm above the top; within it they stay where they were, and the first cut is at most a stepdown plus that tolerance.
…ing (stevecad#344) Depths are planned from any reachable stock above the top inside the band: the stock model cannot tell a faced top's sweep error from material, so no depth of cut exceeds stepdown_mm below it. A faced top can therefore gain a last, nearly empty pass (the standalone rest example's golden program does, regenerated). A rescan that finds stock above the top the depths were planned from refuses before the next motion, and the floor is checked against the authored top before a higher planning top is used.
The oracle cleared stock within an inflated radius of sampled centres, so an unchecked lead could clear stock ahead of its own end: a 0.0005 mm cut after a 1 mm lead read 0 degrees with the lead as one move and 179 with it split in 2,000. It now keeps each swept piece (line or arc) and clears exactly the points within the cutter radius of it, so the reading does not depend on how moves are split or sampled. New test for the lead case.
# Conflicts: # python/camlib/operations.py # src/adaptive.rs # src/roughing.rs
# Conflicts: # src/pocket_front.rs
) stevecad#348's corner-cap test asserts every cut stays inside the L pocket with assert_entire_l_sweep, which this branch had removed with the orbit planner tests. The helper is planner-independent; it is restored as on main.
Contributor
|
The rest-pocket benchmark now matches the stock-top check. The faced stock still has a positive upper height bound above the authored Z5 top. Getting to Z3 with a 1 mm maximum stepdown takes three levels. The first pocket gains 15 motions and the rest operation gains 41, bringing the workload from 130 to 186 motions and from 169 to 225 posted blocks. The certain leftover and overcut are both zero. The added floor regression also reproduced a separate error on the submitted head. With a Z10 top, a 1 mm stepdown and a floor 0.0000000005 mm below Z8, subtracting an epsilon before rounding the layer count ended the plan at Z8. The planner now includes the final level at the requested floor. All nine stock-top tests passed together on Linux. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #344. Stacked on #363 (which is stacked on #362): their commits show here too, so please merge those first.
What changes
AdaptivePocketrunsPocket's stock-top proof (StockTop) before any motion. Stock abovetop_z_mmthat the cutter can reach is refused; stock removed by earlier operations is accepted; stock outside the region is judged by the tool assembly. Without committed stock, a lower top is refused. The report carriesstock_top.stepdown_mmis a strict maximum for bothPocketandAdaptivePocket. The stock model can't tell a faced top's sweep error from material, so depths are planned from the highest reachable stock above the top inside the accepted band. Before, a top 0.1 mm below uncut stock (tolerance 0.01, stepdown 1) gave a 1.1 mm first cut. A faced top can therefore gain a last, nearly empty pass; the standalone rest example's golden program is regenerated for that.tests/pocket_top.rscover the refusal forAdaptivePocketand measure the depth each motion removes from the stock.bench/results/baseline.jsonanddocs/benchmarks.mdare untouched.