nx_canon_proportions.nx
buildroot/runtime/nx_canon_proportions.nx
about
nx_canon_proportions.nx -- S-class anatomical canon as data table.
Each entry is a 4-tuple (i64 array layout): numerator_axis_id,
denominator_axis_id, target_ratio_q10, tolerance_q10. Family ids
declare which classical source the ratio belongs to.
Flat-array layout instead of struct-returning functions to avoid
the nxc2 codegen bug with struct-pointer returns.
dependencies 2 imports · 7 importers
imports: nx_syscalls.nxnx_phi.nx
imported by: nx_anatomy_measure.nxnx_anatomy_measure_test.nxnx_beauty_score.nxnx_beauty_score_test.nxnx_canon_proportions_test.nxnx_perineum_distance.nxnx_proportion_guard.nx
structs
| none |
consts
| 20 | const NX_AXIS_EYE_WIDTH: i64 = 1 |
| 21 | const NX_AXIS_EYE_TO_EYE: i64 = 2 |
| 22 | const NX_AXIS_PUPIL_TO_PUPIL: i64 = 3 |
| 23 | const NX_AXIS_PUPIL_TO_MOUTH: i64 = 4 |
| 24 | const NX_AXIS_MOUTH_WIDTH: i64 = 5 |
| 25 | const NX_AXIS_FACE_WIDTH: i64 = 6 |
| 26 | const NX_AXIS_FACE_HEIGHT: i64 = 7 // ~ 1 head |
| 27 | const NX_AXIS_FOREHEAD_H: i64 = 8 // hairline to brow |
| 28 | const NX_AXIS_MIDFACE_H: i64 = 9 // brow to nose-base |
| 29 | const NX_AXIS_LOWERFACE_H: i64 = 10 // nose-base to chin |
| 30 | const NX_AXIS_NECK_WIDTH: i64 = 11 |
| 31 | const NX_AXIS_SHOULDER_WIDTH: i64 = 12 |
| 32 | const NX_AXIS_BUST_WIDTH: i64 = 13 // chest width including breasts |
| 33 | const NX_AXIS_WAIST_WIDTH: i64 = 14 |
| 34 | const NX_AXIS_HIP_WIDTH: i64 = 15 |
| 35 | const NX_AXIS_BREAST_DIAMETER: i64 = 16 // single breast outer-curve span |
| 36 | const NX_AXIS_NIPPLE_TO_NIPPLE: i64 = 17 |
| 37 | const NX_AXIS_NAVEL_HEIGHT: i64 = 18 // floor to navel |
| 38 | const NX_AXIS_TOTAL_HEIGHT: i64 = 19 |
| 39 | const NX_AXIS_FEMUR_LENGTH: i64 = 20 |
| 40 | const NX_AXIS_SHIN_LENGTH: i64 = 21 |
| 41 | const NX_AXIS_HAND_LENGTH: i64 = 22 |
| 42 | const NX_AXIS_FOOT_LENGTH: i64 = 23 |
| 43 | const NX_AXIS_ARM_SPAN: i64 = 24 |
| 45 | const NX_AXIS_THIGH_MID_WIDTH: i64 = 25 // single thigh thickness at mid-femur |
| 46 | const NX_AXIS_THIGH_GAP_WIDTH: i64 = 26 // gap between inner thighs (legs together) |
| 47 | const NX_AXIS_PERINEUM_LENGTH: i64 = 27 // fourchette → anal verge distance |
| 48 | const NX_AXIS_VULVA_HEIGHT: i64 = 28 // top of mons → fourchette |
| 49 | const NX_AXIS_VULVA_WIDTH: i64 = 29 // outer labia at widest |
| 50 | const NX_AXIS_LABIA_PROTRUSION: i64 = 30 // signed Q10 of minora out beyond outer line |
| 51 | const NX_AXIS_GLUTE_PROJECTION: i64 = 31 // ass forward depth from sacrum plane |
| 52 | const NX_AXIS_HIP_TO_GLUTE_DROP: i64 = 32 // vertical from iliac crest to gluteal fold |
| 55 | const NX_FAMILY_PHI: i64 = 1 // golden ratio |
| 56 | const NX_FAMILY_FIBONACCI: i64 = 2 // successive Fib ratios |
| 57 | const NX_FAMILY_VITRUVIAN: i64 = 3 // Da Vinci canon |
| 58 | const NX_FAMILY_LOOMIS: i64 = 4 // head-as-unit grid |
| 59 | const NX_FAMILY_LINEAR: i64 = 5 // simple linear multiple |
| 62 | const NX_CANON_FIELD_NUM_AXIS: i64 = 0 |
| 63 | const NX_CANON_FIELD_DEN_AXIS: i64 = 1 |
| 64 | const NX_CANON_FIELD_TARGET_Q10: i64 = 2 |
| 65 | const NX_CANON_FIELD_TOL_Q10: i64 = 3 |
| 66 | const NX_CANON_FIELD_FAMILY: i64 = 4 |
| 67 | const NX_CANON_FIELDS: i64 = 5 |
| 69 | const NX_CANON_ENTRY_COUNT: i64 = 30 |
| 72 | const NX_TOL_TIGHT: i64 = 51 // 5% — S-class only |
| 73 | const NX_TOL_NORMAL: i64 = 102 // 10% — A-class acceptable |
| 74 | const NX_TOL_LOOSE: i64 = 205 // 20% — natural variation |
| 77 | const NX_R_HEAD_TO_EYE: i64 = 7168 // 7.0 — 1 face_height = 7 eye-widths |
| 78 | const NX_R_FACE_W_TO_EYE: i64 = 5120 // 5.0 — face width = 5 eye-widths |
| 79 | const NX_R_PUPIL_PAIR_EYE: i64 = 1024 // 1.0 — eye-to-eye = 1 eye-width |
| 80 | const NX_R_MOUTH_TO_EYE: i64 = 2048 // 2.0 — mouth = 2 eye-widths |
| 81 | const NX_R_SHOULDER_FACE_W: i64 = 3072 // 3.0 — shoulder = 3 face-widths (women) |
| 82 | const NX_R_BREAST_HEAD: i64 = 716 // 0.7 — breast diameter ≈ 0.7 head |
| 83 | const NX_R_KNEE_TO_HEAD: i64 = 2048 // 2.0 — femur ≈ 2 heads |
| 84 | const NX_R_SHIN_TO_HEAD: i64 = 1536 // 1.5 — shin ≈ 1.5 heads |
| 85 | const NX_R_TOTAL_TO_HEAD: i64 = 7680 // 7.5 — total ≈ 7.5 heads (women) |
| 86 | const NX_R_HAND_TO_FACE_H: i64 = 1024 // 1.0 — hand ≈ 1 face-height |
| 87 | const NX_R_FOOT_TO_FACE_H: i64 = 1024 // 1.0 — foot ≈ 1 face-height |
| 88 | const NX_R_NECK_FACE_W: i64 = 512 // 0.5 |
| 89 | const NX_R_FACE_THIRDS: i64 = 1024 // 1.0 — forehead:midface = 1:1 |
| 90 | const NX_R_ARMSPAN_HEIGHT: i64 = 1024 // 1.0 — armspan ≈ height (Vitruvian) |
| 91 | const NX_R_HIP_FACE_W: i64 = 1024 // 1.0 — hip width ≈ face width |
| 93 | const NX_R_THIGH_HIP_W: i64 = 614 // 0.6 — mid-thigh ≈ 0.6 × hip width |
| 94 | const NX_R_THIGH_GAP_HIP: i64 = 102 // 0.1 — modest gap ≈ 10% hip |
| 95 | const NX_R_PERINEUM_FACE_W: i64 = 410 // 0.4 — perineum ≈ 0.4 face width (~2-3 cm) |
| 96 | const NX_R_VULVA_H_FACE_W: i64 = 819 // 0.8 — vulva height ≈ 0.8 face width |
| 97 | const NX_R_VULVA_W_FACE_W: i64 = 410 // 0.4 — vulva width ≈ 0.4 face width |
| 98 | const NX_R_GLUTE_PROJ_HIP: i64 = 410 // 0.4 — glute projection ≈ 0.4 hip width |
functions
| 100 | func nx_canon_get(canon: *i64, idx: i64, field: i64) -> i64 |
| 104 | func nx_canon_set(canon: *i64, idx: i64, num: i64, den: i64, called by 1: nx_canon_build |
| 116 | func nx_canon_build(canon: *i64) -> i64 |
| 184 | func nx_canon_find(canon: *i64, num_axis: i64, den_axis: i64) -> i64 |