pub struct LayeredCell { /* private fields */ }Expand description
Ordered surface crossings plus sorted, strictly disjoint occupancy spans.
Both channels may be empty, hold one entry, or hold many; a cell never selects a “primary” layer.
Implementations§
Source§impl LayeredCell
impl LayeredCell
Sourcepub fn new(occupancy: Vec<Interval>) -> Result<Self, LayeredFieldError>
pub fn new(occupancy: Vec<Interval>) -> Result<Self, LayeredFieldError>
Construct an occupancy-only column.
Sourcepub fn with_layers(
surfaces: Vec<SurfaceHit>,
occupancy: Vec<Interval>,
) -> Result<Self, LayeredFieldError>
pub fn with_layers( surfaces: Vec<SurfaceHit>, occupancy: Vec<Interval>, ) -> Result<Self, LayeredFieldError>
Construct a validated column with both channels.
Surfaces are sorted by w, then by facing so equal-coordinate ties are
deterministic. Occupancy is sorted and must be strictly disjoint;
touching or overlapping spans are rejected rather than merged, because a
merge would silently erase a topology fact the caller may need.
Sourcepub fn surfaces(&self) -> &[SurfaceHit]
pub fn surfaces(&self) -> &[SurfaceHit]
Crossings in increasing layer order.
Sourcepub fn layer_count(&self) -> usize
pub fn layer_count(&self) -> usize
Total stored layers in both channels.
Sourcepub fn derive_occupancy(
&self,
tolerance: Tolerance,
) -> Result<Self, LayeredFieldError>
pub fn derive_occupancy( &self, tolerance: Tolerance, ) -> Result<Self, LayeredFieldError>
Pair alternating crossings into occupancy spans for a closed shell.
The sequence must alternate AgainstNormal (enter) then WithNormal
(exit); anything else is reported as LayeredFieldError::UnbalancedCrossings
rather than guessed. A pair whose span is within the linear tolerance is
reported as LayeredFieldError::DegenerateOccupancy.
Sourcepub fn largest_free_span(&self, search: Interval) -> Option<Interval>
pub fn largest_free_span(&self, search: Interval) -> Option<Interval>
Largest unoccupied span strictly inside search, or None when the
window is fully occupied.
This reports a distance. It does not decide whether that distance is sufficient for any purpose.
Trait Implementations§
Source§impl Clone for LayeredCell
impl Clone for LayeredCell
Source§fn clone(&self) -> LayeredCell
fn clone(&self) -> LayeredCell
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more