Repository navigation
Implement code-review action plan: measured geometry, exact wall check, web-app state - #6
Merged
Merged
Conversation
- M-09: repair with remove_smallest_components=False - pymeshfix's default kept only the shell with the most triangles, so a holed figure lost its base. - M-10: _voxelize_surface samples triangles in rows along the longest edge; cost follows area instead of edge length^2 (low-poly rods took GBs, a 250 mm bar aborted with "max_iter exceeded"). _check_grid_size refuses grids above MAX_GRID_VOXELS up front. - M-11: load_mesh rejects empty/garbled STLs with a message naming the file; the instant preview skips such a file with a warning. - M-14: rotation/position steps live in persistent session keys; every rerun requantizes stored values before the sliders exist. Hiding the rotation section no longer resets the step and crashes the app. - M-15/M-32: process-wide cache keys and the staleness snapshot use a content hash per upload instead of name:size (cross-session leak); uploads are read with getvalue() instead of copying the buffer on every rerun. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measure (M-00): tests/geometry_probe.py measures a finished inlay with manifold3d (pocket bounds, min_gap, ray casts, shells), independent of the pipeline; tests/test_geometry_invariants.py pins the review scenarios (appendix B) on the output mesh. Check (M-01, M-25): build_inlay clips every figure's cutter to the box and measures side/floor walls, walls between cavities (min_gap), sealed voids and figures without a cavity - per figure, tolerance 0.05 mm. The voxel check overestimated walls by up to a pitch, ignored inner walls and passed an inlay without cavities. App and CLI list every finding with the file name; the CLI exits with 3 when the check fails (2 stays argparse's usage error). Geometry (M-02..M-08): each figure sinks depth_fraction of its own height (short figures got no pocket, Z origins produced solid blocks); cavities are extruded through the top face (no sealed voids); finger recesses get a shaft and count as part of their figure's cutter. build_inlay now solidifies first and arranges/dimensions from the real cutters, because voxelization shifts a cavity by up to half a pitch: side/floor walls are wall_thickness, the wall between cavities is figure_gap, rotated figures never overlap, recesses stay inside the box in both axes, a manual box width is kept. API: arrange_with_stable_bounds and stable_global_bounds are gone, arrange_figures became arrange_footprints; build_inlay takes the dilated figures (plus sorting_reference) and reports placements, wall_check and violating_indices in its metadata. wall_thickness_stats_3d(inlay) reports the check (no voxel fallback). Tests pinning the old behaviour (test_slots_stay_stable_while_rotating, the height/width formulas, the cavity grid) were rewritten. Also: CLI validates every --finger-recess-position while parsing and turns Config errors into usage errors (M-23, part of M-12); _finger_band is tested directly (M-29); Config.effective_figure_gap (M-34). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-13, M-31) - M-31: drop the binary_closing before the dilation in dilate - dilating a closing with the same element equals dilating the input (checked bit for bit on 200 random grids), it cost 2/3 of the morphology time. - M-13: a share of (sqrt(3) - 1) / 2 of the dilation steps uses the 3x3x3 cube, which equalizes axis and space-diagonal growth (all directions within 0.97-1.06). With the cross alone 2 mm of clearance left ~1.5 mm on slopes. Axis growth is unchanged, so the calibration of _dilation_iterations holds. - M-12: Config rejects NaN/inf in every float field, uses one message per range (>= 0, > 0, (0, 1], >= 4) from a rule table; the CLI reports it as a usage error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- M-16: every widget has a fixed, language-independent key; a static AST test fails on an unkeyed widget. A language switch no longer drops the uploads and resets every setting. - M-19: per-figure settings are keyed by upload (file_id), duplicate names are shown as "model.stl (2)", removed uploads take their settings along. - M-17: one resolve_selection rule for recess position, offsets and rotation; selections and sliders are reconciled with the uploads before any widget exists, so a slider always shows what the pipeline uses. - M-18: applied_figure_params is the single source of per-figure values for the run, the instant preview and the staleness snapshot; switching which figure a slider shows no longer marks the result stale. - M-20: the figure gap follows the wall thickness until the user sets it. - M-21: the app uses inlayer._parallel_map with a worker_init hook for the Streamlit context instead of its own pool (which skipped the language). - M-22: the session keeps only slim geometry (decimated inlay, placements, recesses); preview_copy never hands the input object to the cache. - M-24 (part): DEFAULT_INPUT = "figure.stl" for CLI and app (README said so). - M-34 (part): thousands separator follows the UI language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- M-27: the language fixture pins INLAYER_LANG as well - CLI subprocesses inherit the environment, and `INLAYER_LANG=de pytest` failed two tests. - M-28: tests/test_streamlit_config.py checks the runtime stage on its own (the whole-file search was satisfied by the test stage's COPY): app.py, every repo module it imports (read via ast) and .streamlit/. CI builds the runtime stage and smoke-tests it (imports, /_stcore/health). - M-33: build-essential removed from the image - all 54 pinned packages resolve as cp313 wheels for x86_64 and aarch64 (pip --dry-run --only-binary=:all:); libgl1/libglib2.0-0 stay. - M-26: the rewritten layout/offset tests catch the review's three mutants (row spacing without gap, compact sorted ascending, offsets ignored). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found while verifying M-16: Streamlit 1.62 sends a selectbox value as its label. Once the widgets kept their state across a language switch, the old label matched no option - the recess axis's lenient format_func turned "left/right" into the value (the next run crashed with "bad finger axis"), box shape and layout fell back to their defaults. Every selectbox with translated labels now goes through _select: raw value in a plain session key seeding `index`, labels resolved once per run, unknown values mapped to no label. The step selects use the same helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Implements the code-review action plan (findings R1–R15, N1–N21, measures M-00 … M-35). One commit per phase, each with a green suite:
39b07461a651669b19288a48a47f965e4dfab0f4dbReview scenarios, before → after
Measured on the output mesh with
tests/geometry_probe.py(manifold3d booleans,min_gap, ray casts), independent of the pipeline:figure_gap2.0depth_fraction1.0, offset −0.5rot_y90Deviations from the plan
build_inlayarranges the figures itself (instead of a separatearrange_for_inlay, E6). Voxelization shifts a cavity by up to half a pitch depending on where it lies on the grid, so exact walls need the real cutters before the layout: solidify first, measure, then place and size the box.xfailbaseline (M-00 – instead the new tests were run against the previous commits, where they fail).Breaking changes
arrange_with_stable_boundsandbuild_inlay(stable_global_bounds=…)are removed;arrange_figuresbecamearrange_footprints;build_inlaytakessorting_reference.wall_thickness_stats_3d(inlay)no longer takes a config and only reports the checkbuild_inlaystored ininlay.metadata["wall_check"]– no voxel fallback for arbitrary meshes.Found along the way
Streamlit 1.62 sends a selectbox value as its label. Once the widgets kept their state across a language switch (M-16), the old label matched no option: the recess axis's lenient
format_functurned "left/right" into the value (the next run would have failed), box shape and layout fell back to their defaults. Fixed in the last commit, with a test.Verification
pytest: 419 passed (previously 276), ~95 s.INLAYER_LANG=de pytestis green too.docker build(Docker daemon was not running) – the CI job now builds the test and runtime stage and smoke-tests the runtime image. Removingbuild-essentialwas checked withpip install --dry-run --only-binary=:all:: all 54 packages resolve as cp313 wheels for x86_64 and aarch64.README.md and AGENTS.md are updated in every commit.
🤖 Generated with Claude Code