pub struct SweptDoor { /* private fields */ }Expand description
The floor sectors a door’s hinged leaves sweep, counted as obstacles by a free-space or walkability request whose rule chose the door.
A swept sector is an obstacle in plan, over the whole elevation band of
a floor it stands on (Self::stands_on). Its footprint is never
measured from a door’s body: a backend brackets each sector with
SwingSector::plan_bounds and proves a fit, a path or a connection
against the circumscribed polygon, and an absence, a narrowing or a
separation against the inscribed one.
Implementations§
Source§impl SweptDoor
impl SweptDoor
Sourcepub fn try_new(
door: ObjectId,
sectors: Vec<SwingSector>,
) -> Result<Self, DoorLeavesError>
pub fn try_new( door: ObjectId, sectors: Vec<SwingSector>, ) -> Result<Self, DoorLeavesError>
The sectors door sweeps.
§Errors
DoorLeavesError::InvalidLeaves for no sector or a sector that
is not horizontal, which sweeps no plan area of its own shape.
Sourcepub fn of(leaves: &DoorLeaves) -> Result<Option<Self>, DoorLeavesError>
pub fn of(leaves: &DoorLeaves) -> Result<Option<Self>, DoorLeavesError>
Every sector the hinged leaves of leaves sweep, or None when no
leaf swings on a side hinge (a sliding or fixed door sweeps no
floor).
§Errors
DoorLeavesError::InvalidLeaves for a leaf swinging outside a
horizontal plane.
Sourcepub fn sectors(&self) -> &[SwingSector]
pub fn sectors(&self) -> &[SwingSector]
The sectors, in the source’s leaf order.
Sourcepub fn stands_on(
&self,
floor: f64,
top: f64,
) -> impl Iterator<Item = &SwingSector>
pub fn stands_on( &self, floor: f64, top: f64, ) -> impl Iterator<Item = &SwingSector>
The sectors that stand on a floor at floor metres whose band
reaches up to top: those whose hinge lies at most
SWEPT_FLOOR_REACH_METRES below the floor and below the top.