Skip to content

Fix: text label handling renewed to avoid floating geometry#127

Merged
jasonmadigan merged 8 commits into
tracefinity:mainfrom
gr3enk:121-floating-text-stl-fix
Jul 16, 2026
Merged

Fix: text label handling renewed to avoid floating geometry#127
jasonmadigan merged 8 commits into
tracefinity:mainfrom
gr3enk:121-floating-text-stl-fix

Conversation

@gr3enk

@gr3enk gr3enk commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This PR changes how text labels are handled so that floating geometry no longer occurs. With this change, text labels are now placed/clipped on the lowest level. This applies to both tool cutouts and disabled cells which are connected via a base plate.

CleanShot 2026-07-02 at 10 50 10

closes #121

@gr3enk

gr3enk commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

While I was working on the issue with the floating text, I came up with this solution. It differs from the original acceptance criteria in #121, but I found that this approach is the simplest and most intuitive for the user experience.

What do you think @jasonmadigan ?

@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 for digging into this!

concern is scope: #121 only needs "skip labels in disabled cells". the helpers you already wrote, _label_layout_cell and _label_in_enabled_cell, are essentially that fix, but nothing in generate_bin calls them yet. wiring those into label filtering + the tests would close #121 in ~30 lines.

the full rewrite changes behaviour for all labels, and as-is breaks recessed ones: the clip slab extrudes upward from floor_z while the recessed cutter extrudes downward, so their intersection is a 0.01mm sliver (measured 0.16mm3 vs 8.13mm3 on main). tests pass because they only assert non-empty + wall ratio.

suggestion: slim this PR to the disabled-cell exclusion check (your existing helpers + tests), and file the per-surface rewrite as its own issue where the recessed handling and label-splitting design can be worked through properly. i'd be glad to see that as a follow-up.

return ix, grid_y - 1 - iy_ui


def _label_in_enabled_cell(config: GenerateRequest, x_mm: float, y_mm: float) -> bool:

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 two helpers are the core of what #121 needs, but nothing in generate_bin calls them. wiring _label_in_enabled_cell into the label loop as a skip check (plus the existing tests for it) is roughly the whole fix for this issue.

Comment thread backend/app/services/stl_generator_manifold.py Outdated
Comment thread docs/stl-generation.md Outdated
@gr3enk
gr3enk requested a review from jasonmadigan July 7, 2026 08:18

@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 @gr3enk, nice fix. Verified the disabled-cell skip works and the suite is green. There's a fractional grid_y edge in the label row indexing we'll pick up in a follow-up, no need for another round here. Merging.

@jasonmadigan
jasonmadigan marked this pull request as ready for review July 16, 2026 13:45
@jasonmadigan
jasonmadigan merged commit c5a629f into tracefinity:main Jul 16, 2026
3 checks 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.

Exclude embossed text labels from disabled partial-bins cells in STL output

2 participants