code wiki / (root) / nx_pose_naturalness.nx

nx_pose_naturalness.nx

buildroot/runtime/nx_pose_naturalness.nx

14051 B355 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic pose
docsdependenciesstructsconstsfunctions

about

nx_pose_naturalness.nx -- Tier 6 biomechanical pose validation. CAPABILITY_COMPLETENESS: FULL User feedback 2026-05-16 (image #3 thread): "her pose was odd with her touching a wall." AI-generated poses often violate biomechanics: - Joint angles outside anatomical comfort range (wrist hyperextended, elbow inverted, etc.) - Center of mass outside support polygon (would fall over in real life) - Limb proportions wrong (one arm twice as long as other) This primitive checks two layers: Layer 1: Joint-angle comfort ranges (caller-supplied joint angles in Q10 degrees; substrate checks against named ranges). Layer 2: Center-of-mass-over-support (caller-supplied COM_x + support-point positions; substrate checks COM_x is within the support polygon's x-extent). References: - Whittle 2007 "Gait Analysis: An Introduction" (open excerpts) for joint comfort ranges - Winter 2009 "Biomechanics and Motor Control of Human Movement" (open excerpts) for COM analysis Joint comfort ranges (degrees; from American Academy of Orthopaedic Surgeons published joint motion guides): shoulder flexion: 0 to 180 shoulder extension: 0 to 60 shoulder abduction: 0 to 180 elbow flexion: 0 to 145 elbow hyperextension: 0 to 10 wrist flexion: 0 to 80 wrist extension: 0 to 70 hip flexion: 0 to 125

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_pose_naturalness.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nx

imported by: nobody (leaf or entry point)

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

main nx_pose_joint_classify _pn_max_comfort_q10 sys_mmap _pn_set_joint nx_pose_naturalness_check sys_mmap ↻ nx_pose_joint_classify ↻

structs

138struct NxJointAngle
147struct NxPoseNaturalnessResult

consts

57const NX_MAGIC_1024: i64 = 1024
59const NX_PN_Q10: nx_int = 1024
63const NX_JOINT_SHOULDER_L: nx_int = 0
64const NX_JOINT_SHOULDER_R: nx_int = 1
65const NX_JOINT_ELBOW_L: nx_int = 2
66const NX_JOINT_ELBOW_R: nx_int = 3
67const NX_JOINT_WRIST_L: nx_int = 4
68const NX_JOINT_WRIST_R: nx_int = 5
69const NX_JOINT_HIP_L: nx_int = 6
70const NX_JOINT_HIP_R: nx_int = 7
71const NX_JOINT_KNEE_L: nx_int = 8
72const NX_JOINT_KNEE_R: nx_int = 9
73const NX_JOINT_ANKLE_L: nx_int = 10
74const NX_JOINT_ANKLE_R: nx_int = 11
75const NX_JOINT_NECK: nx_int = 12
76const NX_JOINT_N_KINDS: nx_int = 13
80const NX_PN_JOINT_NATURAL: nx_int = 0
81const NX_PN_JOINT_STRAINED: nx_int = 1
82const NX_PN_JOINT_IMPOSSIBLE: nx_int = 2
86const NX_PN_VERDICT_NATURAL: nx_int = 0
87const NX_PN_VERDICT_STRAINED: nx_int = 1 // 1-2 strained joints
88const NX_PN_VERDICT_IMPOSSIBLE: nx_int = 2 // any impossible joint OR 3+ strained
89const NX_PN_VERDICT_OFF_BALANCE: nx_int = 3 // COM outside support polygon
90const NX_PN_VERDICT_BOTH_FAIL: nx_int = 4 // joint-impossible AND off-balance
143const NX_JOINT_ANGLE_BYTES: nx_size = 16
158const NX_PN_RESULT_BYTES: nx_size = 64

functions

102func _pn_max_comfort_q10(joint_id: nx_int) -> nx_int
124func nx_pose_joint_classify(joint_id: nx_int, angle_q10: nx_int) -> nx_int
169func nx_pose_naturalness_check(
called by 1: main calls 2: sys_mmapnx_pose_joint_classify
247func _pn_set_joint(arr: *NxJointAngle, idx: nx_int,
called by 1: main
256func main() -> nx_int