nx_anatomy_placement.nx
buildroot/runtime/nx_anatomy_placement.nx
about
nx_anatomy_placement.nx -- out-of-place anatomy verification.
Image #56 failure class: nipple rendered at a location that doesn't
match where the breast tissue actually projects. The nipple has to
be ON the breast mound, near the projection peak, slightly above
midline horizontally. Same problem for areola-on-nipple, navel-on-
torso-midline, pubic-mound-on-pelvis, etc.
The substrate measures the DISTANCE between an anatomical feature's
observed centroid and its CANONICAL ZONE (computed from the parent
region's bbox + canon ratios). Outside the zone = OUT_OF_PLACE.
Canon zones (per Loomis figure-drawing canon):
nipple on breast: centered horizontally on breast,
vertically at 0.55-0.70 of breast height from top
areola on nipple: concentric with nipple centroid
navel on torso: horizontal midline, vertical 0.50-0.60 from top of torso
pubic mound: horizontal midline, vertical 0.85-0.95 from top of torso
Sealed verdict ladder:
OUT_OF_PLACE distance > 50% of parent dimension
SLIGHTLY_OFF 25-50%
CORRECT < 25% from expected zone
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_anatomy_placement_test.nx
structs
| none |
consts
| 32 | const NX_MAGIC_1024: i64 = 1024 |
| 34 | const NX_PLACE_RES_DIST_X_Q10: i64 = 0 // horizontal off-target Q10 (1024 = parent width) |
| 35 | const NX_PLACE_RES_DIST_Y_Q10: i64 = 1 |
| 36 | const NX_PLACE_RES_DIST_TOTAL_Q10: i64 = 2 // euclidean approx (max(dx, dy)) |
| 37 | const NX_PLACE_RES_VERDICT: i64 = 3 |
| 38 | const NX_PLACE_RES_FIELDS: i64 = 4 |
| 40 | const NX_PLACE_OUT_OF_PLACE: i64 = 0 |
| 41 | const NX_PLACE_SLIGHTLY_OFF: i64 = 1 |
| 42 | const NX_PLACE_CORRECT: i64 = 2 |
| 45 | const NX_PLACE_NIPPLE_X_CENTER: i64 = 512 // 0.50 = horizontal center |
| 46 | const NX_PLACE_NIPPLE_X_TOL: i64 = 102 // ±10% horizontally |
| 47 | const NX_PLACE_NIPPLE_Y_MIN: i64 = 563 // 0.55 from top |
| 48 | const NX_PLACE_NIPPLE_Y_MAX: i64 = 717 // 0.70 from top |
| 50 | const NX_PLACE_NAVEL_X_CENTER: i64 = 512 |
| 51 | const NX_PLACE_NAVEL_X_TOL: i64 = 51 // ±5% horizontally (tighter) |
| 52 | const NX_PLACE_NAVEL_Y_MIN: i64 = 512 |
| 53 | const NX_PLACE_NAVEL_Y_MAX: i64 = 614 |
| 55 | const NX_PLACE_PUBIC_X_CENTER: i64 = 512 |
| 56 | const NX_PLACE_PUBIC_X_TOL: i64 = 51 |
| 57 | const NX_PLACE_PUBIC_Y_MIN: i64 = 870 |
| 58 | const NX_PLACE_PUBIC_Y_MAX: i64 = 973 |
functions
| 68 | func nx_anatomy_placement_score(parent_x0: i64, parent_y0: i64, |
| 114 | func nx_nipple_on_breast_check(breast_x0: i64, breast_y0: i64, |
| 126 | func nx_navel_on_torso_check(torso_x0: i64, torso_y0: i64, |
| 138 | func nx_pubic_on_torso_check(torso_x0: i64, torso_y0: i64, |