nx_estimate_test.nx
buildroot/runtime/nx_estimate_test.nx
about
nx_estimate_test.nx -- pre-print estimate sanity checks against
hand-computed expected ranges.
Test inputs: tetrahedron at edge=10mm (Q14 = 10*16384=163840),
Qidi X-Max 3 + Generic PLA, 20% infill.
Expected math:
bbox extent = 10mm × 10mm × 10mm
bbox volume = 1000 mm³
perim_fraction = 8%; infill_fraction = (100-8)*20/100 = 18.4%
solid_pct = 26% -> solid_volume ≈ 260 mm³ (with integer trunc, 260)
filament_xsect (1.75mm) = π × 0.875² ≈ 2.405 mm²
filament_mm = 260 / 2.405 ≈ 108 mm
sustainable_flow = min(machine 35, material 15) = 15 mm³/s
extrude_time = 260 / 15 ≈ 17.3 sec; with 25% overhead ≈ 21.7 sec
print_minutes ≈ 0 (rounds down from 21 sec)
Closed-form invariants:
(a) OK verdict for 10mm tetrahedron + 20% infill PLA on Qidi.
(b) volume_mm3 in [200, 320]
(c) filament_mm in [80, 140]
(d) print_minutes in [0, 1]
(e) WARN_TINY for 1mm tetrahedron (tiny volume)
(f) WARN_LONG for huge mesh (200mm cube ≈ 8M mm³ -> >24h at low
flow).
(g) WARN_FIL for medium-large mesh consuming > 250m filament.
(h) ERR_INPUT for negative density.
(i) Verdict names non-NULL.
expect_exit: 0
license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_mesh.nxnx_machine_graph.nxnx_material_profile.nxnx_estimate.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 39 | const Q14: i64 = 16384 |
functions
| 41 | func main() -> i64 |