code wiki / (root) / nx_faceanat.nx

nx_faceanat.nx

buildroot/runtime/nx_faceanat.nx

71980 B1142 linesdepth 4pulls 6 transitivereach 44 importersview sourcekind librarytopic faceanat
docsdependenciesstructsconstsfunctions

about

nx_faceanat.nx -- ★INSIDE-OUT face (operator 2026-07-08: "get the skeleton then muscles then skin, not outside-in"; nx_anatomy_census verdict: build the SKULL+TISSUE-DEPTH rung FIRST). Instead of placing ellipsoids by eyeball, DERIVE the face: (1) POSITIONS from the anthropometric FACIAL CANONS -- rule of THIRDS (hairline->brow->subnasale->chin, equal) + rule of FIFTHS (face width = 5 eye-widths; eyes are fifths 2 & 4; nose = 1 fifth; mouth ~1.5 eye-widths). (2) Z-RELIEF from FORENSIC SOFT-TISSUE-DEPTH tables (Rhine/De Greef-class, adult female, mm): the skin sits proud of the bony skull by a MEASURED amount per landmark -- brow ridge proud, nasal root shallow, cheekbone proud, temple recessed. = anatomically DERIVED form, not sculpted. Fills the SAME nx_sdfrender arena as sdf_face (parts/mats/ops/blend) so it renders + PROJECTS + is measured by the identical pipeline (the shared eye-line@178 / mouth@-390 frame keeps the A-R2 projection constants valid). license_tier: ORIGINAL (data-driven per CLAUDE #2/#11: every number is a canon ratio or a tissue-depth value)

dependencies 2 imports · 26 importers

nx_syscalls.nx nx_sdfrender.nx nx_faceanat.nx nx_eline_gate.nx nx_face_feature_diag_t367.nx nx_face_feature_diag_t368.nx nx_face_feature_gate_t367.nx nx_face_feature_gate_t367r1.nx nx_face_feature_gate_t367r2.nx nx_face_feature_gate_t367r3.nx nx_face_feature_gate_t367r4.nx nx_face_feature_gate_t367r5.nx nx_face_support_capture_t239.nx

diagram shows first 10 each side; +0 more imports, +16 more importers in the complete lists below.

imports: nx_syscalls.nxnx_sdfrender.nx

imported by: nx_eline_gate.nxnx_face_feature_diag_t367.nxnx_face_feature_diag_t368.nxnx_face_feature_gate_t367.nxnx_face_feature_gate_t367r1.nxnx_face_feature_gate_t367r2.nxnx_face_feature_gate_t367r3.nxnx_face_feature_gate_t367r4.nxnx_face_feature_gate_t367r5.nxnx_face_support_capture_t239.nxnx_faceanat_gate.nxnx_faceanat_hires_gate.nxnx_faceanat_mesh_gate.nxnx_faceanat_morph_gate.nxnx_faceanat_neutral_capture_t239.nxnx_faceanat_scale_gate.nxnx_faceanat_stereo_gate.nxnx_faceanat_texbake_gate.nxnx_faceprofile_gate.nxnx_fissure_gate.nxnx_gsplat_aniso_gate.nxnx_gsplat_face_gate.nxnx_gsplat_photofit_gate.nxnx_gsplat_showcase.nxnx_lipratio_gate.nxnx_persongen.nx

structs

none

consts

18const MMU: i64 = 35
24const MMU_X10_DERIVED: i64 = 78
49const FA_EYE_CX: i64 = 258
50const FA_EYE_CY: i64 = 178
51const FA_EYE_CZ: i64 = 0 - 560
52const FA_GLOBE_L: i64 = 18
53const FA_GLOBE_R: i64 = 19
54const FA_LID_L: i64 = 27
55const FA_LID_R: i64 = 28
56const FA_LID_RIN: i64 = 106
57const FA_LID_T: i64 = 20
58const FA_LID_CAP: i64 = 126
59const FA_LID_HALFW: i64 = 110
60const FA_LID_UP: i64 = 50
61const FA_LID_LOW: i64 = 36
62const FA_LID_K: i64 = 6 // a crisp margin: the face default (18) would fillet most of a 20-unit step away
84const FA_LIP_U: i64 = 10
85const FA_LIP_L: i64 = 11
86const FA_MOUTH_SLIT: i64 = 20
87const FA_PERIORAL_UP: i64 = 33
88const FA_PERIORAL_LOW: i64 = 34
89const FA_STOMION_Y: i64 = 0 - 390
90const FA_LIP_HALFW_U: i64 = 150
91const FA_LIP_HALFW_L: i64 = 140
92const FA_LIP_H_L: i64 = 78
93const FA_LIP_UL_CANON_PERMIL: i64 = 625 // knowledge/facecanon.conf upper_over_lower_lip target
94const FA_LIP_BOW_PERMIL: i64 = 170
95const FA_LIP_H_U: i64 = FA_LIP_H_L * FA_LIP_UL_CANON_PERMIL / (SDF_PERMIL - FA_LIP_BOW_PERMIL)
96const FA_LIP_D_U: i64 = 62
97const FA_LIP_D_L: i64 = 66
98const FA_LIP_AXIS_Z_U: i64 = 0 - 650
99const FA_LIP_AXIS_Z_L: i64 = 0 - 640
100const FA_LIP_ARCH: i64 = 90
101const FA_LIP_TAPER: i64 = 350
102const FA_LIP_BOW_HW: i64 = 180
103const FA_LIP_UP_SIDE: i64 = 1
104const FA_LIP_DOWN_SIDE: i64 = 0 - 1
105const FA_LIP_K: i64 = 8 // the vermilion border is crisp; the mound below it blends softly at the face default
106const FA_NPARTS: i64 = 35
107const FA_FILL_UP_L: i64 = 29
108const FA_FILL_UP_R: i64 = 30
109const FA_FILL_LOW_L: i64 = 31
110const FA_FILL_LOW_R: i64 = 32
111const FA_FILL_K_UP: i64 = 30
112const FA_FILL_K_LOW: i64 = 40
113const FA_PART_FIELDS: i64 = 6
114const FA_F_CX: i64 = 0
115const FA_F_CY: i64 = 1
116const FA_F_CZ: i64 = 2
117const FA_F_RX: i64 = 3
118const FA_F_RY: i64 = 4
119const FA_F_RZ: i64 = 5
144const FA_EG_TILT: i64 = 0 // canthal tilt in deg10, positive when the lateral canthus sits above the medial
145const FA_EG_OPEN: i64 = 1 // opening height, percent of the canon height
146const FA_EG_WIDTH: i64 = 2 // opening width, percent of the canon width
147const FA_EG_UPSHARE: i64 = 3 // the upper arc's share of the opening height, permil
148const FA_EG_DTILT: i64 = 4 // right-minus-left tilt difference, deg10
149const FA_EG_DOPEN: i64 = 5 // right-minus-left opening height difference, percent points
150const FA_EG_N: i64 = 6
151const FA_EG_TILT_LO: i64 = 0 - 20
152const FA_EG_TILT_HI: i64 = 100
153const FA_EG_TILT_CANON: i64 = 50
154const FA_EG_OPEN_LO: i64 = 80
155const FA_EG_OPEN_HI: i64 = 120
156const FA_EG_WIDTH_LO: i64 = 92
157const FA_EG_WIDTH_HI: i64 = 108
158const FA_EG_PCT_CANON: i64 = 100
159const FA_EG_UPSHARE_LO: i64 = 540
160const FA_EG_UPSHARE_HI: i64 = 640
161const FA_EG_DTILT_LO: i64 = 0 - 10
162const FA_EG_DTILT_HI: i64 = 10
163const FA_EG_DOPEN_LO: i64 = 0 - 4
164const FA_EG_DOPEN_HI: i64 = 4
165const FA_EG_PERMIL: i64 = 1000
166const FA_EG_DEG10_HALF_TURN: i64 = 1800 // deg10 in half a turn: rad4096 = deg10 * IT_PI / 1800
517const FA_LIP_UNMEASURED: i64 = 0 - 1
518const FA_LIP_Y_TOP: i64 = 0 - 180
536const FA_LIP_Y_BOT: i64 = 0 - 640
537const FA_LIP_YSTEP: i64 = 4
538const FA_LIP_N: i64 = 116
539const FA_LIP_Z_START: i64 = 0 - 1000
540const FA_LIP_Z_END: i64 = 200
541const FA_LIP_ZSTEP: i64 = 2
542const FA_LIP_NOSURF: i64 = 999999
543const FA_LIP_PERMIL: i64 = 1000
544const FA_LIP_O_RATIO: i64 = 0
545const FA_LIP_O_UPPER_H: i64 = 1
546const FA_LIP_O_LOWER_H: i64 = 2
547const FA_LIP_O_STOMION: i64 = 3
548const FA_LIP_O_UPBORDER: i64 = 4
549const FA_LIP_O_LOBORDER: i64 = 5
550const FA_LIP_O_UPPEAK: i64 = 6
551const FA_LIP_O_LOPEAK: i64 = 7
557const FA_LIP_O_REASON: i64 = 8
560const FA_LIP_O_UPSULCUS: i64 = 9
561const FA_LIP_O_LOSULCUS: i64 = 10
562const FA_LIP_O_FIELDS: i64 = 11
563const FA_LIP_R_OK: i64 = 0
564const FA_LIP_R_NOSURF: i64 = 1
565const FA_LIP_R_NO_STOMION: i64 = 2
566const FA_LIP_R_NO_UPPER_PEAK: i64 = 3
567const FA_LIP_R_NO_LOWER_PEAK: i64 = 4
569const FA_LIP_R_NO_PHILTRAL_CREASE: i64 = 5
570const FA_LIP_R_NO_SULCUS_IN_BAND: i64 = 6
571const FA_LIP_R_NO_VERMILION_FIELD: i64 = 7 // the body declares no lip sweep, so there is no vermilion line to find
572const FA_LIP_R_NO_UPPER_VERMILION: i64 = 8 // walking up from the stomion the surface never enters the upper vermilion
573const FA_LIP_R_NO_LOWER_VERMILION: i64 = 9 // walking down from the stomion the surface never enters the lower vermilion
574const FA_LIP_R_VERMILION_PAST_BAND: i64 = 10 // a vermilion runs off the sampled band: its border is the window, not a landmark
575const FA_LIP_SLACK: i64 = 16
606const FA_LIP_EDGE_NEVER: i64 = 0 - 1
607const FA_LIP_EDGE_PAST: i64 = 0 - 2
608const FA_LIP_REFINE_STEP: i64 = 1 // one model unit: the landmarks are refined to the grid the part numbers themselves live on
770const FA_LS_O_STOMION: i64 = 0
771const FA_LS_O_LS: i64 = 1 // labrale superius: the upper vermilion line at the midline (the bottom of the bow)
772const FA_LS_O_LI: i64 = 2 // labrale inferius: the lower vermilion line at the midline
773const FA_LS_O_UPPER_H: i64 = 3
774const FA_LS_O_LOWER_H: i64 = 4
775const FA_LS_O_RATIO: i64 = 5 // upper over lower, permil: the canon row upper_over_lower_lip
776const FA_LS_O_CHEILION_X: i64 = 6 // the commissure's half-width (each cheilion at +- this x)
777const FA_LS_O_CHEILION_Y: i64 = 7 // the seam's height at the commissure
778const FA_LS_O_FIELDS: i64 = 8
813const FA_EL_YSTEP: i64 = 4
816const FA_EL_NOSE_Y0: i64 = 0 - 40
817const FA_EL_NOSE_Y1: i64 = 0 - 240
822const FA_EL_POG_Y0: i64 = 0 - 560
823const FA_EL_POG_Y1: i64 = 0 - 660
824const FA_EL_ULIP_Y0: i64 = 0 - 260
825const FA_EL_ULIP_Y1: i64 = 0 - 370
826const FA_EL_LLIP_Y0: i64 = 0 - 400
827const FA_EL_LLIP_Y1: i64 = 0 - 500
828const FA_EL_O_ULIP: i64 = 0
829const FA_EL_O_LLIP: i64 = 1
830const FA_EL_O_PRN_Y: i64 = 2
831const FA_EL_O_PRN_Z: i64 = 3
832const FA_EL_O_POG_Y: i64 = 4
833const FA_EL_O_POG_Z: i64 = 5
834const FA_EL_O_LS_Y: i64 = 6
835const FA_EL_O_LS_Z: i64 = 7
836const FA_EL_O_LI_Y: i64 = 8
837const FA_EL_O_LI_Z: i64 = 9
838const FA_EL_O_REASON: i64 = 10
846const FA_EL_O_ULIP_U: i64 = 11
847const FA_EL_O_LLIP_U: i64 = 12
848const FA_EL_O_FIELDS: i64 = 13
849const FA_EL_R_OK: i64 = 0
850const FA_EL_R_NO_PRONASALE: i64 = 1
851const FA_EL_R_NO_POGONION: i64 = 2
852const FA_EL_R_NO_UPPER_LIP: i64 = 3
853const FA_EL_R_NO_LOWER_LIP: i64 = 4
854const FA_EL_R_DEGENERATE: i64 = 5
855const FA_EL_MM10_NUM: i64 = 100
919const FA_PF_XSTEP: i64 = 4
920const FA_PF_YSTEP: i64 = 4
921const FA_PF_EYE_CX: i64 = 258
922const FA_PF_XSPAN: i64 = 170
923const FA_PF_Y_TOP: i64 = 250
924const FA_PF_Y_BOT: i64 = 110
927const FA_PF_NS: i64 = (FA_PF_Y_TOP - FA_PF_Y_BOT) / FA_PF_YSTEP + 1
928const FA_PF_MIN_STEPS: i64 = 3
929const FA_PF_DY_FLOOR: i64 = 0 // the column record: floor y, opening height, upper crest y, lower crest y
930const FA_PF_DY_UP: i64 = 2
931const FA_PF_DY_DN: i64 = 3
932const FA_PF_DY_SLOTS: i64 = 4
933const FA_PF_O_MED_X: i64 = 0
934const FA_PF_O_MED_Y: i64 = 1
935const FA_PF_O_LAT_X: i64 = 2
936const FA_PF_O_LAT_Y: i64 = 3
937const FA_PF_O_WIDTH: i64 = 4
938const FA_PF_O_PEAK_D: i64 = 5
939const FA_PF_O_PEAK_X: i64 = 6
940const FA_PF_O_REASON: i64 = 7
941const FA_PF_O_PEAK_SPAN: i64 = 8
942const FA_PF_O_FIELDS: i64 = 9
943const FA_PF_R_OK: i64 = 0
944const FA_PF_R_NO_SURFACE: i64 = 1
945const FA_PF_R_NO_APERTURE: i64 = 2
946const FA_PF_R_NO_CLOSURE: i64 = 3
1067const FA_CORNER_LATERAL: i64 = 1
1068const FA_CORNER_MEDIAL: i64 = 0 - 1
1069const FA_PF_CORNER_WINDOW: i64 = 24 // three millimetres at the derived scale: wider than the unresolvable tip, narrower than any neighbour
1073const FA_PF_CORNER_XSTEP: i64 = 1

functions

25func fa_mmu_x10() -> i64 { return MMU_X10_DERIVED }
called by 2: fa_eline_offsetmain
26func fa_mmu_relief_legacy_x10() -> i64 { return MMU }
called by 1: main
33func fa_tissue_z(base_z: i64, depth_mm10: i64) -> i64 { return base_z - depth_mm10 * MMU / 100 } // proud toward -z (camera); mm*10 in
called by 1: faceanat_build
122func fa_is_eye_unit(i: i64) -> i64
131func fa_scale_prim(base: i64, idx: i64, pct: i64) -> i64
167func fa_eye_gene_name(k: i64) -> *u8
called by 2: maintw_all_name
175func fa_eye_gene_lo(k: i64) -> i64
183func fa_eye_gene_hi(k: i64) -> i64
192func fa_eye_gene_canon(k: i64) -> i64
201func fa_eye_apply(base: i64, idx: i64, roll_deg10: i64, open_pct: i64, width_pct: i64, upshare: i64) -> i64
213func faceanat_eye_genes(base: i64, eg: *i64) -> i64
called by 10: mainmainmainmainmainmain+4 calls 1: fa_eye_apply
224func fa_lip_prims(base: i64, idx: i64, bow: i64, bow_hw: i64, side: i64) -> i64
called by 1: faceanat_build calls 1: sdf_set_prim
234func fa_scale_lip_prims(base: i64, idx: i64, pct: i64) -> i64
239func faceanat_build(base: i64) -> i64
362func faceanat_scale(base: i64, pct: i64) -> i64
380func fa_scale(base: i64, idx: i64, field: i64, pct: i64) -> i64
387func faceanat_morph_width(base: i64, pct: i64) -> i64
397func faceanat_morph_length(base: i64, pct: i64) -> i64
405func faceanat_morph_jaw(base: i64, pct: i64) -> i64 { fa_scale(base,2,3,pct); fa_scale(base,3,3,pct); return 0 }
407func faceanat_morph_eyes(base: i64, pct: i64) -> i64
420func faceanat_morph_lips(base: i64, pct: i64) -> i64 { fa_scale(base,10,4,pct); fa_scale(base,11,4,pct); return 0 }
429func faceanat_morph_lipratio(base: i64, pct: i64) -> i64
called by 1: main calls 1: fa_scale
436func faceanat_morph_nose(base: i64, pct: i64) -> i64 { fa_scale(base,4,4,pct); fa_scale(base,5,4,pct); return 0 }
438func faceanat_morph_cheek(base: i64, pct: i64) -> i64 { fa_scale(base,6,5,pct); fa_scale(base,7,5,pct); return 0 }
455func fa_expr_morph(base: i64, chan: i64, pct: i64) -> i64
585func fa_surface_z(base: i64, x: i64, y: i64) -> i64
594func fa_midline_z(base: i64, y: i64) -> i64 { return fa_surface_z(base, 0, y) }
609func fa_lip_vermilion_edge(base: i64, ys: *i64, zs: *i64, si: i64, dir: i64) -> i64
called by 1: fa_lip_ratio calls 1: sdf_lip_vermilion
628func fa_lip_border_refine(base: i64, y_in: i64, dir: i64) -> i64
642func fa_lip_stomion_refine(base: i64, y0: i64) -> i64
called by 1: fa_lip_ratio calls 1: fa_midline_z
657func fa_lip_ratio(base: i64, out: *i64) -> i64
779func fa_lip_stated(base: i64, out: *i64) -> i64
860func fa_el_apex(base: i64, y0: i64, y1: i64, out: *i64, oy: i64, oz: i64) -> i64
called by 1: fa_eline_offset calls 1: fa_midline_z
879func fa_eline_offset(base: i64, out: *i64) -> i64
called by 1: main calls 2: fa_el_apexfa_mmu_x10
971func fa_pf_column(base: i64, x: i64, ytop: i64, zs: *i64, dy: *i64) -> i64
1023func fa_lid_corner(base: i64, eye_sign: i64, which: i64, out2: *i64) -> i64
1043func fa_lid_corner_z(base: i64, eye_sign: i64, x: i64, y: i64) -> i64
1074func fa_pf_corner(base: i64, ex: i64, ey: i64, dir: i64, ytop: i64, zs: *i64, dy: *i64, out: *i64, slot_x: i64) -> i64
called by 1: fa_palpebral_fissure calls 1: fa_pf_column
1097func fa_palpebral_fissure(base: i64, eye_sign: i64, out: *i64) -> i64