Skip to main content

qualia_core_db/bundle/stream/formats/
geometry.rs

1//! Geometry-only closure; optional material, rig, topology and field sidecars
2//! are not admitted by this view and must be validated before those uses.
3use super::{FormatError as E, TenDSectionView};
4use crate::container_10d::{mesh_section::MeshSectionView, section::SectionType};
5impl<'a> TenDSectionView<'a> {
6    /// Complete vertex/index geometry from the original authenticated section.
7    /// This is neither a whole-container receipt nor a current disclosure grant.
8    pub fn geometry(&self) -> Result<MeshSectionView<'a>, E> {
9        if self.descriptor().typ() != Some(SectionType::QuantizedMesh) {
10            return Err(E::Unsupported);
11        }
12        MeshSectionView::parse(self.bytes()).map_err(|_| E::Integrity)
13    }
14}