Skip to content

Fix label row indexing for fractional grid_y in partial bins #141

Description

@jasonmadigan

What

PR #127 skips embossed text labels whose centre lands in a disabled partial-bin cell. _label_layout_cell in backend/app/services/stl_generator_manifold.py indexes rows with int(y_mm // GF_GRID) from the layout top, but shell geometry pitches rows from the bottom, placing the fractional remainder band at the top UI row. For fractional grid_y (e.g. 1.5) labels map to the wrong row: a disabled bottom row keeps a floating label (the #121 defect persists) and a disabled top row silently drops a valid label. Reproduced at STL level. X indexing is correct (fractional column is last in UI order).

Related cleanup: _make_text_labels gained an unused max_depth param, plus a hoist in generate_bin that exists only to pass it, leftover from a reverted clipping implementation.

Acceptance criteria

  • _label_layout_cell indexes rows from the bottom (e.g. int((config.grid_y * GF_GRID - y_mm) // GF_GRID), clamped) so labels in fractional-grid bins map to the physically correct cell
  • Test covering grid_y=1.5 with top and bottom rows disabled: label kept and skipped correctly in both cases
  • Unused max_depth param and its generate_bin hoist removed
  • Full backend suite passes

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions