Skip to content

Grid::split: do not overlap the halves on an odd axis - #461

Open
dylanoliverdo-coder wants to merge 1 commit into
CauldronDevelopmentLLC:masterfrom
dylanoliverdo-coder:fix-odd-grid-split
Open

dylanoliverdo-coder wants to merge 1 commit into
CauldronDevelopmentLLC:masterfrom
dylanoliverdo-coder:fix-odd-grid-split

Conversation

@dylanoliverdo-coder

Copy link
Copy Markdown

With an odd number of steps on the split axis, both halves got ceil(n/2) steps, although the right half starts at floor(n/2). One slab of cells was then contoured by both jobs, which gives duplicate triangles: edges shared by more than two faces. The left half now gets floor(n/2) steps, matching where the right half starts. Even step counts are unchanged.

Repro: a 60 x 40 x 20 mm block at 0.254 mm resolution (239 steps on X), a 6 mm flat end mill, a zigzag pocket 5 mm deep.

Build Edges on more than 2 faces Open edges
master 2,032 0
this branch 0 0

Tests: the tests/testHarness gcodetool suites pass 15 of 15 on master and on this branch.

This touches Grid::split, as does the seam fix in #459. If both are taken, the overlap fix applies on top in a few lines.

Repro job (block-a.camotics and block-a.nc)
{
 "units": "metric",
 "resolution-mode": "manual",
 "resolution": 0.254,
 "tools": {
  "1": {
   "units": "metric",
   "shape": "cylindrical",
   "length": 30,
   "diameter": 6,
   "description": ""
  }
 },
 "workpiece": {
  "automatic": false,
  "margin": 0,
  "bounds": {
   "min": [
    0,
    0,
    -20
   ],
   "max": [
    60,
    40,
    0
   ]
  }
 },
 "files": [
  "block-a.nc"
 ]
}
G21 G90 G17
G0 Z5
G0 X8 Y8
G1 Z-5.000 F300
G1 X52.000 Y8.000 F600
G1 Y12.000
G1 X8.000 Y12.000 F600
G1 Y16.000
G1 X52.000 Y16.000 F600
G1 Y20.000
G1 X8.000 Y20.000 F600
G1 Y24.000
G1 X52.000 Y24.000 F600
G1 Y28.000
G1 X8.000 Y28.000 F600
G1 Y32.000
G1 X52.000 Y32.000 F600
G1 Y32.000
G0 Z5
M2

🤖 Generated with Claude Code

With an odd number of steps both halves got ceil(n/2) steps, although
the right half starts at floor(n/2), so one slab of cells was contoured
by both jobs.  The left half now gets floor(n/2) steps, matching where
the right half starts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant