lumen_geometry/segment.rs
1//! Anatomical segment definitions.
2
3/// A named region of a tubular organ.
4///
5/// Anatomical tubes are divided into segments with distinct properties:
6/// - Different curvature characteristics
7/// - Varying lumen radius
8/// - Region-specific surface features
9///
10/// This trait allows querying which segment a given parameter falls within.
11pub trait AnatomicalSegment: Copy + Clone + PartialEq + Eq {
12 /// Human-readable name of this segment.
13 fn name(&self) -> &'static str;
14
15 /// Parameter range [start, end) for this segment.
16 ///
17 /// Returns (t_start, t_end) where the segment occupies [t_start, t_end).
18 fn t_range(&self) -> (f32, f32);
19
20 /// Whether parameter t falls within this segment.
21 fn contains(&self, t: f32) -> bool {
22 let (start, end) = self.t_range();
23 t >= start && t < end
24 }
25}