Skip to content

Commit 54dc888

Browse files
committed
ogar-fma-skeleton: wire bones to the Located-primary Guid (3-axis CRS)
Each bone now resolves to a 16-byte Guid (the [256:256] container:member tier model), Located-primary since bones ARE the position anchor: classid = 0x0A03 (Anatomy:bone) HEEL/HIP = the rest-pose 3-axis CRS — HEEL coronal x:y, HIP depth z (located_heel_hip) — ArcGIS/Cesium-addressable, so the body is a GIS layer and ViT / ultrasound×Doppler project onto the same coordinate LEAF = familyNode:identity = [bodypart:bone] — the parent group is the family (identity 0 IS the group's family node; identity >=1 are its bones) same_family now keys on classid + leaf family_node (mode-agnostic): in Located mode the spatial HHTL is the orthogonal location axis, so two same-family bones sit at different positions. is_ancestor walks parent links (partonomy), not an address prefix. Tests rewritten for the Guid model (24 pass): classid tier, HEEL laterality (left/right femur differ in HEEL, same family, different identity), HIP depth (sternum anterior vs vertebra posterior), unique node keys + leaves, family-node grouping with attached identity, parent-link ancestry, clamped anchors, unit quaternions, classid stability. clippy-clean. Morton primitives + FamilyAddress stay in morton.rs as the value-side splat-refinement tool. Crate docs updated to the Guid model. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
1 parent f1451da commit 54dc888

2 files changed

Lines changed: 267 additions & 202 deletions

File tree

crates/ogar-fma-skeleton/src/guid.rs

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,15 @@ impl Guid {
167167
self.bytes[2 * TIER_LEAF + 1]
168168
}
169169

170-
/// `true` if `self` and `other` are in the **same family**: every tier up
171-
/// to and including the leaf's `family_node` agrees; only the leaf
172-
/// `identity` differs. This is "identity attached to family node" — the
173-
/// family node is the routing prefix, the identity discriminates within.
170+
/// `true` if `self` and `other` are in the **same family**: same `classid`
171+
/// and same leaf `family_node`. This is "identity attached to family node"
172+
/// — the family node groups, the leaf `identity` discriminates within. It
173+
/// is mode-agnostic: in Located mode the spatial HHTL is an *orthogonal*
174+
/// location axis (two same-family bones sit at different positions), so
175+
/// family grouping keys on the categorical leaf byte, not the HHTL prefix.
174176
#[must_use]
175177
pub fn same_family(&self, other: &Self) -> bool {
176-
self.bytes[..2 * TIER_LEAF + 1] == other.bytes[..2 * TIER_LEAF + 1]
178+
self.classid() == other.classid() && self.family_node() == other.family_node()
177179
}
178180
}
179181

@@ -204,6 +206,23 @@ pub fn spatial_tier(x: u8, y: u8) -> Tier {
204206
}
205207
}
206208

209+
/// Encode a 3-axis body position into the Located `(HEEL, HIP)` spatial tier
210+
/// pair — an ArcGIS / Cesium-addressable coordinate reference system.
211+
///
212+
/// - **HEEL** = coronal `(x : y)` 2D-Morton (anatomical-left × superior) — the
213+
/// plane an X-ray or anterior-ultrasound sweep projects onto.
214+
/// - **HIP** = depth `(z)` — anterior-posterior, the imaging *slice* axis.
215+
///
216+
/// Prefix containment over `HEEL ++ HIP` is therefore 3-axis spatial
217+
/// containment: a quadkey/octant the GIS stack can `contains` / `buffer` /
218+
/// page by LOD. v0 fence: this is *coronal-tile + depth-slice* (exactly how
219+
/// medical imaging is organised), not yet a single interleaved 3D octree —
220+
/// HIP's odd (Y) bits are reserved for a finer refinement axis.
221+
#[must_use]
222+
pub fn located_heel_hip(x: u8, y: u8, z: u8) -> (Tier, Tier) {
223+
(spatial_tier(x, y), spatial_tier(z, 0))
224+
}
225+
207226
/// The **mode** of an HHTL tier — the operator's "heel" distinction
208227
/// (2026-06-23).
209228
///

0 commit comments

Comments
 (0)