code wiki / (root) / nx_canon_proportions.nx

nx_canon_proportions.nx

buildroot/runtime/nx_canon_proportions.nx

10091 B195 linesdepth 3pulls 3 transitivereach 13 importersview sourcekind librarytopic canon
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_phi.nx nx_canon_proportions.nx nx_anatomy_measure.nx nx_anatomy_measure_test.nx nx_beauty_score.nx nx_beauty_score_test.nx nx_canon_proportions_test.nx nx_perineum_distance.nx nx_proportion_guard.nx

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

20const NX_AXIS_EYE_WIDTH: i64 = 1
21const NX_AXIS_EYE_TO_EYE: i64 = 2
22const NX_AXIS_PUPIL_TO_PUPIL: i64 = 3
23const NX_AXIS_PUPIL_TO_MOUTH: i64 = 4
24const NX_AXIS_MOUTH_WIDTH: i64 = 5
25const NX_AXIS_FACE_WIDTH: i64 = 6
26const NX_AXIS_FACE_HEIGHT: i64 = 7 // ~ 1 head
27const NX_AXIS_FOREHEAD_H: i64 = 8 // hairline to brow
28const NX_AXIS_MIDFACE_H: i64 = 9 // brow to nose-base
29const NX_AXIS_LOWERFACE_H: i64 = 10 // nose-base to chin
30const NX_AXIS_NECK_WIDTH: i64 = 11
31const NX_AXIS_SHOULDER_WIDTH: i64 = 12
32const NX_AXIS_BUST_WIDTH: i64 = 13 // chest width including breasts
33const NX_AXIS_WAIST_WIDTH: i64 = 14
34const NX_AXIS_HIP_WIDTH: i64 = 15
35const NX_AXIS_BREAST_DIAMETER: i64 = 16 // single breast outer-curve span
36const NX_AXIS_NIPPLE_TO_NIPPLE: i64 = 17
37const NX_AXIS_NAVEL_HEIGHT: i64 = 18 // floor to navel
38const NX_AXIS_TOTAL_HEIGHT: i64 = 19
39const NX_AXIS_FEMUR_LENGTH: i64 = 20
40const NX_AXIS_SHIN_LENGTH: i64 = 21
41const NX_AXIS_HAND_LENGTH: i64 = 22
42const NX_AXIS_FOOT_LENGTH: i64 = 23
43const NX_AXIS_ARM_SPAN: i64 = 24
45const NX_AXIS_THIGH_MID_WIDTH: i64 = 25 // single thigh thickness at mid-femur
46const NX_AXIS_THIGH_GAP_WIDTH: i64 = 26 // gap between inner thighs (legs together)
47const NX_AXIS_PERINEUM_LENGTH: i64 = 27 // fourchette → anal verge distance
48const NX_AXIS_VULVA_HEIGHT: i64 = 28 // top of mons → fourchette
49const NX_AXIS_VULVA_WIDTH: i64 = 29 // outer labia at widest
50const NX_AXIS_LABIA_PROTRUSION: i64 = 30 // signed Q10 of minora out beyond outer line
51const NX_AXIS_GLUTE_PROJECTION: i64 = 31 // ass forward depth from sacrum plane
52const NX_AXIS_HIP_TO_GLUTE_DROP: i64 = 32 // vertical from iliac crest to gluteal fold
55const NX_FAMILY_PHI: i64 = 1 // golden ratio
56const NX_FAMILY_FIBONACCI: i64 = 2 // successive Fib ratios
57const NX_FAMILY_VITRUVIAN: i64 = 3 // Da Vinci canon
58const NX_FAMILY_LOOMIS: i64 = 4 // head-as-unit grid
59const NX_FAMILY_LINEAR: i64 = 5 // simple linear multiple
62const NX_CANON_FIELD_NUM_AXIS: i64 = 0
63const NX_CANON_FIELD_DEN_AXIS: i64 = 1
64const NX_CANON_FIELD_TARGET_Q10: i64 = 2
65const NX_CANON_FIELD_TOL_Q10: i64 = 3
66const NX_CANON_FIELD_FAMILY: i64 = 4
67const NX_CANON_FIELDS: i64 = 5
69const NX_CANON_ENTRY_COUNT: i64 = 30
72const NX_TOL_TIGHT: i64 = 51 // 5% — S-class only
73const NX_TOL_NORMAL: i64 = 102 // 10% — A-class acceptable
74const NX_TOL_LOOSE: i64 = 205 // 20% — natural variation
77const NX_R_HEAD_TO_EYE: i64 = 7168 // 7.0 — 1 face_height = 7 eye-widths
78const NX_R_FACE_W_TO_EYE: i64 = 5120 // 5.0 — face width = 5 eye-widths
79const NX_R_PUPIL_PAIR_EYE: i64 = 1024 // 1.0 — eye-to-eye = 1 eye-width
80const NX_R_MOUTH_TO_EYE: i64 = 2048 // 2.0 — mouth = 2 eye-widths
81const NX_R_SHOULDER_FACE_W: i64 = 3072 // 3.0 — shoulder = 3 face-widths (women)
82const NX_R_BREAST_HEAD: i64 = 716 // 0.7 — breast diameter ≈ 0.7 head
83const NX_R_KNEE_TO_HEAD: i64 = 2048 // 2.0 — femur ≈ 2 heads
84const NX_R_SHIN_TO_HEAD: i64 = 1536 // 1.5 — shin ≈ 1.5 heads
85const NX_R_TOTAL_TO_HEAD: i64 = 7680 // 7.5 — total ≈ 7.5 heads (women)
86const NX_R_HAND_TO_FACE_H: i64 = 1024 // 1.0 — hand ≈ 1 face-height
87const NX_R_FOOT_TO_FACE_H: i64 = 1024 // 1.0 — foot ≈ 1 face-height
88const NX_R_NECK_FACE_W: i64 = 512 // 0.5
89const NX_R_FACE_THIRDS: i64 = 1024 // 1.0 — forehead:midface = 1:1
90const NX_R_ARMSPAN_HEIGHT: i64 = 1024 // 1.0 — armspan ≈ height (Vitruvian)
91const NX_R_HIP_FACE_W: i64 = 1024 // 1.0 — hip width ≈ face width
93const NX_R_THIGH_HIP_W: i64 = 614 // 0.6 — mid-thigh ≈ 0.6 × hip width
94const NX_R_THIGH_GAP_HIP: i64 = 102 // 0.1 — modest gap ≈ 10% hip
95const NX_R_PERINEUM_FACE_W: i64 = 410 // 0.4 — perineum ≈ 0.4 face width (~2-3 cm)
96const NX_R_VULVA_H_FACE_W: i64 = 819 // 0.8 — vulva height ≈ 0.8 face width
97const NX_R_VULVA_W_FACE_W: i64 = 410 // 0.4 — vulva width ≈ 0.4 face width
98const NX_R_GLUTE_PROJ_HIP: i64 = 410 // 0.4 — glute projection ≈ 0.4 hip width

functions

100func nx_canon_get(canon: *i64, idx: i64, field: i64) -> i64
104func nx_canon_set(canon: *i64, idx: i64, num: i64, den: i64,
called by 1: nx_canon_build
116func nx_canon_build(canon: *i64) -> i64
called by 2: mainmain calls 1: nx_canon_set
184func nx_canon_find(canon: *i64, num_axis: i64, den_axis: i64) -> i64
called by 1: main calls 1: nx_canon_get