code wiki / (root) / nx_dyna_bind_skin.nx

nx_dyna_bind_skin.nx

buildroot/runtime/nx_dyna_bind_skin.nx

33586 B715 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_dyna_bind_skin.nx -- BIND THE XPBD SOFT-TISSUE CAGE TO SKIN VERTICES, AND MEASURE OUR OWN PLANT IN THE SUBJECT'S UNITS. WHY THIS EXISTS. `dyna_bind_skin` is OPEN on the charsim and graphics boards. DYNA already DECLARES per-bone soft-tissue contracts in the asset (nx_nxa_dyna: anchor, axis, k, c, travel clamp, influence radius, falloff, all derived FROM THE MESH) and nx_softtissue already SOLVES tissue as XPBD over a tetrahedral cage with per-layer compliance. Nothing joined them: the declared physics never reached a skin vertex, so the shipped path was still a shader band. WHY XPBD, NOT A MASS-SPRING RIG -- the model choice, justified against the alternatives, because the operator's bar is that the motion be best-of-breed and that previous attempts were awful: * XPBD (Macklin, Muller, Chentanez, Kim -- "XPBD: Position-Based Simulation of Compliant Constrained Dynamics", ACM SIGGRAPH Motion in Games 2016) integrates by POSITION PROJECTION, so it cannot detonate the way an explicit force solver does at stiff settings. Its compliance alpha is a genuine material parameter (inverse stiffness) and alpha_tilde = alpha/dt^2 makes effective stiffness STEP-SIZE INDEPENDENT. That property is precisely the cure for the buzzing/framerate-dependence failure mode, and plain PBD does not have it. * The estate ALREADY MEASURED why the previous attempt was awful. nx_softtissue's header records that the rigmesh viewer drove breasts with a 2-mass EMA spring, and that "an oscillator has no VOLUME, no LAYERS and no relationship to gravity DIRECTION" -- so it physically cannot reproduce supine flattening. A damped oscillator is a POINT; tissue is a VOLUME. Rejected on measured evidence, not taste. * Shape-matching lattice deformers (Muller 2005) are the other cheap production option: unconditionally stable, but they preserve no volume and their stiffness is a blend factor with no material meaning -- so their parameters CANNOT be sourced from tissue literature, which this estate requires of every number. Rejected on sourcing. * FEM production stacks (Chaos Flesh, Ziva, DMM) have better constitutive fidelity at far higher cost and none is reachable as a sovereign integer solver. XPBD is the tier that is both principled and ours. WHAT "BOUND TO SKIN VERTICES" MEANS HERE. The cage is a physics proxy; the skin mesh is the render surface. Binding is an EMBEDDING: a skin vertex inside a DYNA region takes its displacement from the cage, weighted by that region's OWN declared falloff over its OWN declared influence radius. A vertex outside every region is SKIN-LOCKED -- it moves with the rig and nothing else. That split IS the capability, and it is what the gate discriminates: soft moves, rigid does not. Both signals must be present at once or the tooth proves nothing. FRAMES DIFFER AND THAT HAS BURNED THIS ESTATE BEFORE -- SO IT IS STATED, NOT ASSUMED. NXA asset frame : +z is the STATURE axis, y<0 is the FRONT hemisphere (nx_nxa_dyna relies on this and says so; the floor gate and the shader agree).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_nxa.nx nx_softtissue.nx nx_dyna_bind_skin.nx

imports: nx_syscalls.nxnx_nxa.nxnx_softtissue.nx

imported by: nobody (leaf or entry point)

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

main dbs_err sys_write dbs_slen sys_exit dbs_slen ↻ dbs_atoi dbs_derive_cell st_profile st_profile_seeded st_hash pg_sample pg_has_bound pg_bound pg_bound ↻ st_span st_hash ↻ st_profile ↻ sys_mmap nxa_die sys_write ↻ sys_exit ↻ nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ dbs_ringdown dbs_ringdown_t st_new sys_mmap ↻ st_profile ↻ st_inside st_wall_drop

structs

none

consts

73const DBS_OUTFD: i64 = 1
74const DBS_ERRFD: i64 = 2
75const DBS_EXIT_OK: i64 = 0
76const DBS_EXIT_IO: i64 = 1
77const DBS_EXIT_USAGE: i64 = 2
78const DBS_EXIT_BAD: i64 = 3
80const DBS_Q16: i64 = 65536
81const DBS_Q8: i64 = 256
82const DBS_PERMIL: i64 = 1000
83const DBS_US_PER_S: i64 = 1000000
84const DBS_MHZ_PER_HZ: i64 = 1000
87const DBS_LN2_Q16: i64 = 45426
88const DBS_TWOPI_Q16: i64 = 411775
91const DBS_HDR: i64 = 32
92const DBS_TOCE: i64 = 32
93const DBS_MAXSEC: i64 = 64
95const DBS_DY_STRIDE: i64 = 12
96const DBS_DY_SIDE: i64 = 0
97const DBS_DY_AX: i64 = 1
98const DBS_DY_AY: i64 = 2
99const DBS_DY_AZ: i64 = 3
100const DBS_DY_MAXD: i64 = 6
101const DBS_DY_INFL: i64 = 7
102const DBS_DY_FALL: i64 = 8
106const DBS_RD_MAXSAMP: i64 = 768
107const DBS_RD_ITERS: i64 = 8
108const DBS_RD_SETTLE: i64 = 240
219const DBS_R_NSAMP: i64 = 0
220const DBS_R_EQ: i64 = 1
221const DBS_R_A1: i64 = 2
222const DBS_R_A2: i64 = 3
223const DBS_R_PER_US: i64 = 4
224const DBS_R_FN_MHZ: i64 = 5
225const DBS_R_ZETA: i64 = 6
226const DBS_R_PEAKS: i64 = 7
227const DBS_R_MAXABS: i64 = 8
228const DBS_R_RESID: i64 = 9
229const DBS_R_CELL: i64 = 10
230const DBS_R_NP: i64 = 11
231const DBS_R_N: i64 = 12
238const DBS_QUANT_CMM: i64 = 1
375const DBS_SVG_W: i64 = 1920
376const DBS_SVG_H: i64 = 1200
377const DBS_SVG_ROWS: i64 = 5
378const DBS_SVG_PLOT_L: i64 = 300
379const DBS_SVG_PLOT_R: i64 = 1880
380const DBS_SVG_TOP: i64 = 70
381const DBS_SVG_BOT_MARGIN: i64 = 40
382const DBS_SVG_LABEL_X: i64 = 40
383const DBS_SVG_TITLE_Y: i64 = 44
384const DBS_SVG_FOOT_Y: i64 = 1180
385const DBS_SVG_PX_TITLE: i64 = 26
386const DBS_SVG_PX_NAME: i64 = 19
387const DBS_SVG_PX_VALUE: i64 = 18
388const DBS_SVG_PX_SMALL: i64 = 16
389const DBS_SVG_TRACE_PAD: i64 = 14
390const DBS_SVG_DY_NAME: i64 = 18
391const DBS_SVG_DY_VALUE: i64 = 8
392const DBS_SVG_DY_PEAK: i64 = 32
393const DBS_SVG_DY_STATE: i64 = 54
397const DBS_SVG_AMP_LINEAR: i64 = 320
398const DBS_SVG_AMP_WALK: i64 = 3200

functions

110func dbs_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 3: dbs_outdbs_errmain
111func dbs_out(s: *u8) -> i64 { sys_write(DBS_OUTFD, s, dbs_slen(s)); return 0 }
112func dbs_err(s: *u8) -> i64 { sys_write(DBS_ERRFD, s, dbs_slen(s)); return 0 }
113func dbs_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
115func dbs_num(v: i64) -> i64
132func dbs_rd64(b: *u8, off: i64) -> i64
137func dbs_tageq(b: *u8, off: i64, t: *u8) -> i64
called by 1: dbs_bind_report calls 2: dbs_rd64nxa_tag4
142func dbs_isqrt(n: i64) -> i64
155func dbs_log2_q16(x_q16: i64) -> i64
called by 1: dbs_ln_q16
165func dbs_ln_q16(x_q16: i64) -> i64 { return dbs_log2_q16(x_q16) * DBS_LN2_Q16 / DBS_Q16 }
called by 1: dbs_zeta_permil calls 1: dbs_log2_q16
170func dbs_zeta_permil(a1: i64, a2: i64) -> i64
called by 1: dbs_ringdown_t calls 2: dbs_ln_q16dbs_isqrt
186func dbs_free_surface_y(W: *i64) -> i64
203func dbs_displace_free(W: *i64, dy: i64) -> i64
called by 1: dbs_ringdown_t
244func dbs_derive_cell(prof: i64) -> i64
called by 3: dbs_svgdbs_evalmain calls 1: st_profile
268func dbs_ringdown_t(prof: i64, h_mm: i64, amp_cmm: i64, out: *i64, sigout: *i64) -> i64
361func dbs_ringdown(prof: i64, h_mm: i64, amp_cmm: i64, out: *i64) -> i64
called by 1: main calls 1: dbs_ringdown_t
400func dbs_svg() -> i64
466func dbs_bind_report(inp: *u8) -> i64
555func dbs_eval(prof: i64, drive_mhz: i64, frames: i64, dt_us: i64) -> i64
608func dbs_atoi(s: *u8) -> i64
623func main(argc: i64, argv: *i64) -> i64