code wiki / (root) / nx_meshview.nx

nx_meshview.nx

buildroot/runtime/nx_meshview.nx

18659 B320 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tooltopic meshview
docsdependenciesstructsconstsfunctions

about

nx_meshview.nx -- look at an .nxmesh. The program emits NXMSH2 meshes and had NO WAY TO VIEW ONE, which is exactly how a skull that renders as an egg passed a 6/6 gate: every tooth measured counts and determinism, and nothing ever drew the thing. Orthographic z-buffered triangle fill, flat-shaded off the stored per-triangle normal, three views side by side (front / side / three-quarter) so a shape can be judged rather than described. nx_meshview <in.nxmesh> <out.png> [layer] layer: -1 all (default), 0 skin, 1 muscle, 2 bone license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_png.nx nx_itoa_lib.nx nx_meshview.nx

imports: nx_png.nxnx_itoa_lib.nx

imported by: nobody (leaf or entry point)

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

main mv_puts mv_atoi sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close mv_rd32 mv_f32 mv_px mv_pz write_png sys_mmap ↻ png_g png_paeth png_sabs dfe_compress sys_mmap ↻ dfe_fill_tables dfe_deflate sys_mmap ↻ dfe_bits dfe_hash dfe_matchlen dfe_sym dfe_bits ↻ dfe_rev dfe_rev ↻ sys_munmap sys_munmap ↻ png_be32 png_adler32 png_crc32 sys_openat_wr sys_write sys_close ↻ mv_pn nxi_out

structs

none

consts

12const MV_MAGIC_8388607: i64 = 8388607
13const MV_MAGIC_8388608: i64 = 8388608
15const MV_W: i64 = 1200
16const MV_H: i64 = 460
17const MV_VW: i64 = 400 // per-view width
18const MV_TS: i64 = 84 // triangle stride in the file
23const MV_FAR: i64 = 2000000000
24const MV_BG: i64 = 0x141c28 // the dark slate the other gates use, so renders are comparable
25const MV_MARGIN: i64 = 24

functions

27func mv_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
32func mv_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
33func mv_atoi(s: *u8) -> i64
called by 1: main
39func mv_abs(v: i64) -> i64 { if v<0 { return 0-v } return v }
40func mv_rd32(b: *u8, o: i64) -> i64
called by 1: main
46func mv_f32(bits: i64, scale: i64) -> i64
called by 1: main
70func mv_px(vx: i64, vy: i64, vz: i64, view: i64) -> i64
called by 1: main
78func mv_pz(vx: i64, vy: i64, vz: i64, view: i64) -> i64
called by 1: main
84func main(argc: i64, argv: *i64) -> i64