8000 Allow blank bin generation by noobydp · Pull Request #163 · tracefinity/tracefinity · GitHub
[go: up one dir, main page]

Skip to content

Allow blank bin generation - #163

Draft
noobydp wants to merge 3 commits into
tracefinity:mainfrom
noobydp:codex/blank-bin-generation
Draft

noobydp wants to merge 3 commits into
tracefinity:mainfrom
noobydp:codex/blank-bin-generation

Conversation

@noobydp
@noobydp noobydp commented Aug 3, 2026
Copy link
Copy Markdown
Contributor

Blank bins are useful when a drawer layout needs an empty container, spacer, or catch-all bin alongside traced tool bins. Previously, empty bins could be created in the UI but could not be generated, and the generator behavior did not let the cutout depth define the usable interior cavity. This makes blank bins behave like intentional printable containers instead of requiring a placeholder tool shape.

Summary

  • allow bins with no placed tools to generate STL previews/exports
  • enable project-level creation of intentionally blank bins
  • generate blank bins as container-style cavities using the configured cutout depth
  • keep blank-bin side walls aligned with the stacking-lip wall inset

Testing

  • python -m pytest backend/tests/test_blank_bin_generation.py

Code and PR drafted with Codex

@noobydp
noobydp commented Aug 3, 2026
Copy link
Copy Markdown
Contributor Author

CI exposed one existing half-grid test that still assumed generate_bin([], ...) produced the old solid shell. This PR intentionally changes empty-bin generation to produce a blank container cavity, so the base pattern contributes a different share of the remaining material and the old volume-ratio assertion is no longer the right invariant.

I added a follow-up commit that keeps the test's validity checks but compares the standard and half-grid generated outer envelopes instead. That preserves the half-grid coverage without depending on solid-shell volume behavior.

Additional local checks run:

  • python -m pytest backend/tests/test_half_grid.py::test_half_grid_base_more_cells_than_standard
  • python -m pytest backend/tests/test_blank_bin_generation.py

@jasonmadigan jasonmadigan left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @noobydp — this looks useful and nicely contained. A couple of small issues remain; happy to re-review and look to merge once these are addressed.


outer_w = config.grid_x * GF_GRID - 0.5
outer_h = config.grid_y * GF_GRID - 0.5
wall = LIP_D0 + LIP_D2
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank bins always use the 2.6 mm lip inset here, even when wall_thickness is larger or the stacking lip is disabled. Could we use the same max(wall_thickness, lip inset) rule as _interior_clip_rect?

Comment thread backend/tests/test_half_grid.py Outdated
assert 0.95 < ratio < 1.05
# Blank bins now generate as container cavities, so the base pattern can
# account for more of the remaining material than it did for solid shells.
# The invariant for half-grid bases is the shared outer envelope.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These bounds only check the shared outer shell, so this would still pass if half_grid_base stopped changing the base. Could we assert something specific to the half-grid geometry instead?

@noobydp
9FFC
noobydp commented Oct 25, 2026
Copy link
Copy Markdown
Contributor Author

Updated this branch with current main (57d10f3) in 00a7eea and resolved the generator and bin-page conflicts. GitHub reports no remaining merge conflicts.

  • Blank bins retain the current floor-depth calculation and use the shared wall/stacking-lip inset rule, including thicker walls.
  • Automatic preview generation retains save-before-generation and grid-size guards.
  • The half-grid test now checks four standard base pads versus sixteen half-grid pads. Blank-bin tests cover wall/lip combinations and retained floor thickness.
  • Bumped the geometry cache version so saved previews and exports regenerate.

Validation:

  • make lint passed: Ruff, ESLint and TypeScript. ESLint reports nine existing warnings and no errors.
  • cd backend && python -m pytest -q: 863 passed.
  • cd frontend && pnpm test: 275 passed.

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.

2 participants

0