Skip to content

Rough print estimates (F31): ~time, ~grams PLA, ~cost on the Print plan card - #155

Merged
ntindle merged 1 commit into
mainfrom
poteto/print-estimates-20261027-0710
Oct 27, 2026
Merged

ntindle merged 1 commit into
mainfrom
poteto/print-estimates-20261027-0710

Conversation

@ntindle

@ntindle ntindle commented Oct 27, 2026

Copy link
Copy Markdown
Owner

What

Print plan card shows one estimate line — ~4 h 2 min · ~144 g PLA · ~$2.88 for the default 15×12in layout — with a footnote stating the fixed assumptions (PLA 1.24 g/cm³, $20/kg, ~8 mm³/s effective print speed). Filament grams come from the analytic volumes of the generated parts (baseplates, bins, spacers); test-fit pieces count when the switch is on, via the same merged parts list the copy list uses.

  • New pure module src/utils/partVolumes.ts (unitMath throughout): analytic baseplate/bin/spacer volumes, estimatePrint, formatters. The analytic formulas move out of the mesh tests into it; the mesh tests now import them, so the mesh still verifies the formula against real triangles.
  • Profile constants (POCKET_PROFILE, FOOT_PROFILE, binWallProfile, ARC_SEGMENTS, …) move into a light shared module src/utils/export/gridfinityProfiles.ts, so the mesh builders stay in the lazy export chunk.

Evidence

  • Tests: 562 passed / 11 skipped (50 files); 21 new tests (19 in printEstimates.test.ts, incl. analytic-vs-mesh volume agreement to 1e-6 across baseplate/bin/spacer sizes; 2 card tests for the estimate line and test-fit inclusion).
  • Lint, typecheck, build green. Index chunk 228,122 → 231,700 B (+1.6%); lazy export chunk 21.89 → 21.44 kB.
  • Perf (branch vs trunk, same box, measure.mjs --n=15 --lh=3): Lighthouse 67 vs 68, TTI 3990 vs 3907 ms, layout 535 vs 502 ms, share 97 vs 87 ms. The n=15 input-to-preview gap (111.4 vs 39.0 ms) did not reproduce in a reversed-order --n=30 --lh=1 pair (36.4 vs 35.3 ms) — box noise, same pattern as PR One-click test-piece download (F32): test-fit pieces in the Download files zip #154.
  • Parity: 45.0% → 47.0% (22 ✅ + 3 🟡 / 50, harness-confirmed). Feature map F31 ❌→✅; wireframe print-and-export.md updated.

Notes (non-blocking follow-ups)

  • Estimates use fixed assumptions; material/price/speed settings are a follow-up slice.
  • shapes.ts now re-exports ARC_SEGMENTS (definition moved to the profiles module; gridfinityMesh/binMesh import it from shapes — caught by the mesh tests during the move).
  • The scoreboard section says "PR #TBD" until this PR number is known; amended right after opening.

@netlify

netlify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for gridfinity-drawer-planner ready!

Name Link
🔨 Latest commit 418b313
🔍 Latest deploy log https://app.netlify.com/projects/gridfinity-drawer-planner/deploys/6ae09a71541cbd07fad41573
😎 Deploy Preview https://deploy-preview-155--gridfinity-drawer-planner.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…an card

The card shows one estimate line from the analytic volumes of the
generated parts (default 15x12in layout: ~4 h 2 min, ~144 g PLA,
~$2.88), with the fixed assumptions stated on the card (PLA 1.24
g/cm3, $20/kg, ~8 mm3/s effective). Test-fit pieces count when the
switch is on, via the same merged parts list the copy list uses.

The analytic volume formulas move out of the mesh tests into
src/utils/partVolumes.ts (unitMath throughout) and the mesh tests now
import them, so the mesh still verifies the formula. Profile constants
(POCKET_PROFILE, FOOT_PROFILE, binWallProfile, ARC_SEGMENTS) move into
a light shared module, src/utils/export/gridfinityProfiles.ts, so the
mesh builders stay in the lazy export chunk: index chunk +1.6%,
export chunk unchanged.

Feature map F31 -> ✅, parity 45.0% -> 47.0% (harness-confirmed).
@ntindle
ntindle force-pushed the poteto/print-estimates-20261027-0710 branch from b8e888d to 418b313 Compare October 27, 2026 12:34
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

PR Quality Report 📊

Check Status
TypeScript ✅
ESLint ✅
Tests ✅
Build ✅

View detailed results

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@04e651c). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #155   +/-   ##
=======================================
  Coverage        ?   93.79%           
=======================================
  Files           ?       70           
  Lines           ?     3499           
  Branches        ?     1030           
=======================================
  Hits            ?     3282           
  Misses          ?      196           
  Partials        ?       21           
Flag Coverage Δ
unittests 93.79% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntindle
ntindle merged commit fa2ae41 into main Oct 27, 2026
33 checks passed
@ntindle
ntindle deleted the poteto/print-estimates-20261027-0710 branch October 27, 2026 12:41
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