code wiki / _hdl_build / nx_meshview.nx

nx_meshview.nx

buildroot/runtime/_hdl_build/nx_meshview.nx

14924 B283 linesdepth 4pulls 4 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 1 imports · 0 importers

nx_png.nx nx_meshview.nx

imports: nx_png.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 mv_rd32 mv_f32 mv_px mv_pz write_png png_publish png_buf_cap sys_mmap_try write_png_buf png_buf_cap ↻ write_png_buf_checked png_buf_cap ↻ sys_mmap_try ↻ sys_munmap_direct png_g png_paeth png_sabs dfe_compress sys_mmap_try ↻ sys_munmap_direct ↻ dfe_fill_tables dfe_deflate png_be32 png_adler32 png_chunk_length_valid png_crc32 sys_munmap_direct ↻ sys_openat_wr pngw_emit sys_write pngw_num sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr

structs

none

consts

11const MV_F32_FRACTION_BITS: i64 = 23 // IEEE 754 binary32 stored fraction width.
13const MV_W: i64 = 1200
14const MV_H: i64 = 460
15const MV_VW: i64 = 400 // per-view width
16const MV_TS: i64 = 84 // triangle stride in the file
21const MV_FAR: i64 = 2000000000
22const MV_BG: i64 = 0x141c28 // the dark slate the other gates use, so renders are comparable
23const MV_MARGIN: i64 = 24

functions

25func 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
26func mv_pn(v: i64) -> i64
called by 1: main
35func mv_atoi(s: *u8) -> i64
called by 1: main
41func mv_abs(v: i64) -> i64 { if v<0 { return 0-v } return v }
42func mv_rd32(b: *u8, o: i64) -> i64
called by 1: main
48func mv_f32(bits: i64, scale: i64) -> i64
called by 1: main
72func mv_px(vx: i64, vy: i64, vz: i64, view: i64) -> i64
called by 1: main
80func mv_pz(vx: i64, vy: i64, vz: i64, view: i64) -> i64
called by 1: main
86func main(argc: i64, argv: *i64) -> i64