code wiki / (root) / nx_arousal_mesh.nx

nx_arousal_mesh.nx

buildroot/runtime/nx_arousal_mesh.nx

12547 B287 linesdepth 4pulls 12 transitivereach 0 importersview sourcekind tooltopic arousal
docsdependenciesstructsconstsfunctions

about

nx_arousal_mesh.nx -- arousal on a real TRIANGLE MESH, not a raymarched implicit surface. ★ADOPTION, NOT INVENTION. The implicit->explicit bridge already existed and this lane was raymarching around it: nx_isosurf's surface_nets polygonizes any SDF into the nx_trimesh buffers, and nx_trimesh is a real rasterizer with sun direction, specular, texture and BAKED SHADOWS -- none of which a hand-rolled sphere-tracer has. nx_isosurf's own gate comment says it exists to "polygonize the holistic BEING's skin SDF -> a real triangle mesh". ★THE PHYSIOLOGY RIDES ON VERTEX COLOUR: after polygonization every vertex is evaluated through sk_eval_at at its own world position, so the flush field is Gouraud-interpolated across real triangles instead of being computed per-screen-pixel. Same optics, better substrate -- and the identical path an IMPORTED scan mesh takes, so nothing here is throwaway. ⚠HONEST LIMIT: surface-nets of the 44-ellipsoid rig yields a triangle mesh OF THAT RIG. This changes the renderer and the shading substrate, NOT the underlying form. The blob silhouette survives polygonization. Only a correct base mesh (nx_obj_import, gated 14/14) removes it. usage: nx_arousal_mesh <out.png> <sex0m1f> <drive_permil> <melanin_permil> [cell_fx] license_tier: ORIGINAL expect_exit: 0

dependencies 5 imports · 0 importers

nx_arousal_skin_lib.nx nx_body_figure.nx nx_isosurf.nx nx_doc_layout.nx nx_png_write.nx nx_arousal_mesh.nx

imports: nx_arousal_skin_lib.nxnx_body_figure.nxnx_isosurf.nxnx_doc_layout.nxnx_png_write.nx

imported by: nobody (leaf or entry point)

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

main a_atoi sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close a_conf a_slen a_atoi ↻ sdf_bytes sdf_person_full sdf_body sdf_clear_ops sdf_set_floor sdf_set_mtx_amp sdf_set_kb sdf_face sdf_clear_ops ↻ sdf_set_floor ↻ sdf_set_mtx_amp ↻ sdf_set_op sdf_set_mat sdf_set_rot it_cos4096 it_sin4096 it_sin4096 ↻ sdf_face_hairstyle sdf_set_mat ↻ sdf_set_kb ↻ figure_apply fig_scale sdf_eval sdf_ellip sdf_isqrt sdf_ellip_rot sdf_isqrt ↻ sdf_smax sdf_smin

structs

none

consts

25const AM_MAGIC_185000: i64 = 185000
26const AM_MAGIC_210000: i64 = 210000
27const AM_MAGIC_1520: i64 = 1520
28const AM_MAGIC_1760: i64 = 1760
29const AM_MAGIC_3120: i64 = 3120
30const AM_MAGIC_65536: i64 = 65536
31const AM_MAGIC_9000: i64 = 9000
32const AM_MAGIC_1500: i64 = 1500
34const AM_FRAMES: i64 = 3
35const AM_FW: i64 = 340
36const AM_FH: i64 = 560
37const AM_HEAD: i64 = 30
38const AM_FOOT: i64 = 24
39const AM_W: i64 = 1020
40const AM_SPAN_MS: i64 = 900000

functions

42func am_px(img: *u8, x: i64, y: i64, r: i64, g: i64, b: i64) -> i64
called by 2: am_charmain
51func am_char(img: *u8, tbl: *u8, x: i64, y: i64, ch: i64, cr: i64, cg: i64, cb: i64) -> i64
called by 2: am_textam_num calls 2: nx_doc_glypham_px
65func am_text(img: *u8, tbl: *u8, x: i64, y: i64, s: *u8, cr: i64, cg: i64, cb: i64) -> i64
called by 1: main calls 1: am_char
70func am_num(img: *u8, tbl: *u8, x: i64, y: i64, v: i64, cr: i64, cg: i64, cb: i64) -> i64
called by 1: main calls 1: am_char
84func am_site(wx: i64, wy: i64) -> i64
called by 1: main
96func main(argc: i64, argv: *i64) -> i64