Skip to content

Add printable smooth meshing strength presets - #86

Merged
vycdev merged 2 commits into
developfrom
codex/smooth-meshing-strength
Oct 1, 2026
Merged

vycdev merged 2 commits into
developfrom
codex/smooth-meshing-strength

Conversation

@vycdev

@vycdev vycdev commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Smooth Meshing now offers None, Minimal, Medium, and Aggressive for the physical model, with the same selection used by preview, STL, and 3MF. None uses the existing greedy mesher; Medium preserves the previous enabled result. Saved on/off settings migrate to None/Medium without changing other print settings.

Minimal uses two light smoothing passes and a 0.2-pixel movement envelope. Medium uses the original ten passes within the existing 0.49-pixel envelope. Aggressive starts with Medium's result and adds one stable half-strength finishing pass to remove residual diagonal stair steps. All retain the welded grid topology, shared cap/wall vertices, and export-precision triangulation checks. Reusing each pass's resulting boundary map removes redundant copying without changing Medium geometry.

Draft changes wait for Build 3D Model. Flat Paint temporarily shows None and retains the remembered strength; choosing a smoothing strength disables Flat Paint. Instructions, copied instructions, and 3MF metadata describe the built strength. Updated the guide, all supported UI languages, translated strength tables, and changelog.

Closes #49.

Validation

  • Production build, TypeScript, lint, translation/document structure checks, and git diff --check pass.
  • Final focused meshing/export/storage suite: 141 tests pass. The feature's earlier full Node run passed 764/765 in the sandbox; its blocked Windows installer test then passed outside the sandbox using an isolated temporary registry key.
  • Chromium: 3 tests pass, covering all strength selections, manual preview/STL/3MF exports, Auto-paint integration, migration/persistence/reset, draft-vs-built instructions, workspace switching, Flat Paint interaction, and greedy/smooth height-dithering exports.
  • A regression checks that Aggressive removes diagonal oscillation beyond Medium in all eight rotations/reflections at two pixel sizes, while retaining manifold topology after 3MF coordinate rounding. It fails with the former Aggressive coefficient and passes with the stable finishing pass.
  • Every one of the 511 nonempty 3x3 masks stays manifold across all three smoothing presets, including exact 3MF coordinate rounding and movement bounds. Existing cap-degeneracy regressions and image/profile STL/3MF topology fixtures exercise Minimal and Aggressive as well as Medium/None.
  • An additional deterministic randomized check passed 5,000 meshes across pixel sizes 0.01-5 mm, checking winding, duplicate/degenerate triangles, and exact rounded edge counts.
  • npm run benchmark:meshing -- cc577a7: nine warmed samples per variant, alternating order in the same process. Medium's vertices and indices match the original byte for byte; every preset retains the original vertex/triangle counts on all five fixtures.

Final isolated local median mesh-generation times (ms):

Fixture Original smooth None Minimal Medium Aggressive
Logo 256px 9.11 2.46 4.34 6.43 6.92
Logo 1024px 47.75 19.05 34.91 45.27 47.01
Photo 512px, threshold 96 205.68 41.20 90.36 176.17 189.78
Photo 512px, threshold 144 22.89 8.07 12.95 19.66 19.62
Photo 512px, threshold 192 10.87 5.05 8.05 10.96 10.87

In this comparison, Aggressive is at or below the original time on every fixture. Medium is faster on four fixtures and within 0.1 ms on the smallest photo case. Shared-desktop timing varied between runs; these measurements show no material regression on the tested fixtures, and the benchmark remains available for repeat comparisons.

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