code wiki / _hdl_build / nx_matstruct.nx

nx_matstruct.nx

buildroot/runtime/_hdl_build/nx_matstruct.nx

15164 B259 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_matstruct.nx -- ★THE STRUCTURAL MATERIAL REGISTRY: what a part is MADE OF, and what that implies. ★THE GAP THIS CLOSES (seq1417, measured 2026-07-30): the ecosystem HAS a real structural primitive -- nx_stress computes sigma = F/A in integer Pascals and returns SEALED verdicts SAFE/WORKING/YIELDED/ FRACTURED -- but it imports nx_material_profile.nx and inherits ITS enum, which is the SLICER'S FILAMENT REGISTRY (PLA, PETG, ABS, ASA, PC, TPU, NYLON, PA-CF, PEEK, carrying hotend temps and retraction). So the entire structural-material universe was 3D-PRINTER FILAMENT. 'This bracket is 1018 steel' was INEXPRESSIBLE, and an underbuilt verdict on a car was impossible no matter how good the geometry got. ★★WHY THIS IS A NEW ORGAN AND NOT SIX MORE ROWS IN NX_MAT_*: that enum is OWNED BY THE PRINT LANE and is backed by a struct of hotend temperature, cooling and pressure advance. Adding steel to it would owe a hotend temperature for steel. A filament class and a structural-material class are DIFFERENT THINGS THAT SHARE A NAME; binding a general primitive to a domain-specific registry was the category error. This registry keeps the print lane's data intact and simply stops being the only answer. ★★★NOTHING IS STRIPPED (rule 25 -- the answer is always better data, never fewer options): indices 0..8 ARE the nine filaments, in nx_stress's exact order, carrying its exact shipped yields and ultimates, so this is a strict SUPERSET and a caller can migrate by index. T6 proves that correspondence value by value against the literals nx_stress ships, so a transcription slip cannot pass. nx_matstruct selftest license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 1 imports · 0 importers

nx_gate_verdict.nx nx_matstruct.nx

imports: nx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr sys_mmap gv_head gv_puts sys_write ms_table ms_family ms_ok ms_count gv_check gv_puts ↻ ms_density ms_ok ↻ ms_yield_mpa ms_ok ↻ ms_mass_mg ms_ok ↻ ms_density ↻ ms_verdict ms_ok ↻ ms_yield_pa ms_ok ↻ ms_ult_pa ms_ok ↻ ms_mod_mpa ms_ok ↻ ms_ult_mpa ms_ok ↻ gv_puts ↻ ms_name gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_verdict gv_puts ↻ gv_num ↻ gv_journal sys_openat_append

structs

none

consts

24const MS_MAGIC_1240: i64 = 1240
25const MS_MAGIC_3500: i64 = 3500
26const MS_MAGIC_1270: i64 = 1270
27const MS_MAGIC_2100: i64 = 2100
28const MS_MAGIC_1040: i64 = 1040
29const MS_MAGIC_2200: i64 = 2200
30const MS_MAGIC_1070: i64 = 1070
31const MS_MAGIC_2300: i64 = 2300
32const MS_MAGIC_1200: i64 = 1200
33const MS_MAGIC_1210: i64 = 1210
34const MS_MAGIC_1140: i64 = 1140
35const MS_MAGIC_2000: i64 = 2000
36const MS_MAGIC_1300: i64 = 1300
37const MS_MAGIC_7000: i64 = 7000
38const MS_MAGIC_1320: i64 = 1320
39const MS_MAGIC_3600: i64 = 3600
40const MS_MAGIC_7870: i64 = 7870
41const MS_MAGIC_205000: i64 = 205000
42const MS_MAGIC_7850: i64 = 7850
43const MS_MAGIC_4140: i64 = 4140
44const MS_MAGIC_2700: i64 = 2700
45const MS_MAGIC_68900: i64 = 68900
46const MS_MAGIC_6061: i64 = 6061
47const MS_MAGIC_2680: i64 = 2680
48const MS_MAGIC_70300: i64 = 70300
49const MS_MAGIC_5052: i64 = 5052
50const MS_MAGIC_7100: i64 = 7100
51const MS_MAGIC_168000: i64 = 168000
52const MS_MAGIC_1810: i64 = 1810
53const MS_MAGIC_45000: i64 = 45000
54const MS_MAGIC_4430: i64 = 4430
55const MS_MAGIC_114000: i64 = 114000
56const MS_MAGIC_1000000000: i64 = 1000000000
57const MS_MAGIC_7870000000: i64 = 7870000000
58const MS_MAGIC_2700000000: i64 = 2700000000
61const MS_FAM_POLYMER: i64 = 0
62const MS_FAM_STEEL: i64 = 1
63const MS_FAM_ALUMINIUM: i64 = 2
64const MS_FAM_IRON: i64 = 3
65const MS_FAM_MAGNESIUM: i64 = 4
66const MS_FAM_TITANIUM: i64 = 5
69const MS_SAFE: i64 = 0 // below half yield -- ample margin
70const MS_WORKING: i64 = 1 // [yield/2, yield) -- the design range
71const MS_YIELDED: i64 = 2 // [yield, ultimate) -- permanent deformation
72const MS_FRACTURED: i64 = 3 // at or past ultimate
73const MS_UNKNOWN: i64 = 4 // not in the registry -- REFUSED, never guessed
75const MS_NM: i64 = 16 // materials modelled -- honest, and QUERYABLE
76const MS_S: i64 = 5 // row: family, density kg/m3, yield MPa, ultimate MPa, modulus MPa
77const MS_BAD: i64 = 0 - 1
78const MS_MPA: i64 = 1000000 // MPa -> Pa, applied at the accessor so the TABLE stays readable

functions

82func ms_table(T: *i64) -> i64
called by 1: main
107func ms_count() -> i64 { return MS_NM }
called by 1: main
108func ms_ok(m: i64) -> i64 { if m < 0 { return 0 } if m >= MS_NM { return 0 } return 1 }
109func ms_family(T: *i64, m: i64) -> i64 { if ms_ok(m)==0 { return MS_BAD } return T[m*MS_S] }
called by 1: main calls 1: ms_ok
110func ms_density(T: *i64, m: i64) -> i64 { if ms_ok(m)==0 { return MS_BAD } return T[m*MS_S+1] }
called by 2: ms_mass_mgmain calls 1: ms_ok
111func ms_yield_mpa(T: *i64, m: i64) -> i64 { if ms_ok(m)==0 { return MS_BAD } return T[m*MS_S+2] }
called by 1: main calls 1: ms_ok
112func ms_ult_mpa(T: *i64, m: i64) -> i64 { if ms_ok(m)==0 { return MS_BAD } return T[m*MS_S+3] }
called by 1: main calls 1: ms_ok
113func ms_mod_mpa(T: *i64, m: i64) -> i64 { if ms_ok(m)==0 { return MS_BAD } return T[m*MS_S+4] }
called by 1: main calls 1: ms_ok
115func ms_yield_pa(T: *i64, m: i64) -> i64 { if ms_ok(m)==0 { return MS_BAD } return T[m*MS_S+2]*MS_MPA }
called by 1: ms_verdict calls 1: ms_ok
116func ms_ult_pa(T: *i64, m: i64) -> i64 { if ms_ok(m)==0 { return MS_BAD } return T[m*MS_S+3]*MS_MPA }
called by 1: ms_verdict calls 1: ms_ok
119func ms_verdict(T: *i64, m: i64, sigma_pa: i64) -> i64
called by 1: main calls 3: ms_okms_yield_pams_ult_pa
132func ms_mass_mg(T: *i64, m: i64, vol_mm3: i64) -> i64
called by 1: main calls 2: ms_okms_density
138func ms_name(m: i64) -> *u8
called by 1: main
158func main(argc: i64, argv: *i64) -> i64