code wiki / (root) / nx_curveskel.nx

nx_curveskel.nx source

↩ module page · 23 lines · 1254 B

1// nx_curveskel.nx -- SOVEREIGN SKELETON-FIT CLI: extract a curve skeleton (an armature) from a BARE unrigged NXA 2// mesh and write it back as a SKEL section. Pair with nx_boneheat for a full sovereign auto-rig of an unrigged 3// mesh, first byte up: nx_curveskel <mesh.nxa> <rigged.nxa> then nx_boneheat <rigged.nxa> <skinned.nxa>. No 4// learned model, no training set, no third party in the build or run path. Everything that decides lives in 5// nx_curveskel_lib.nx (which composes nx_boneheat_lib's voxeliser and geodesic solver); this is the door. 6// nx_curveskel <in.nxa> <out.nxa> 7// exit 0 written, 2 usage, 3 refused by name (no VERT/TRIS, no interior volume, unreadable, unwritable). 8// license_tier: ORIGINAL 9import "nx_syscalls.nx" 10import "nx_curveskel_lib.nx" 11 12func main(argc: i64, argv: *i64) -> i64 { 13 if argc < 3 { 14 cs_puts("usage: nx_curveskel <in.nxa> <out.nxa>\n" as *u8) 15 return CS_EXIT_USAGE 16 } 17 let rep: *i64 = sys_mmap(CR_WORDS * 8) as *i64 18 let rc: i64 = cs_run(argv[1] as *u8, argv[2] as *u8, rep) 19 if rc != CS_EXIT_OK { cs_puts("CURVESKEL verdict=REFUSED\n" as *u8); return rc } 20 cs_report(rep, argv[1] as *u8, argv[2] as *u8) 21 cs_puts("CURVESKEL verdict=OK\n" as *u8) 22 return CS_EXIT_OK 23}