pub struct CirculationRequest { /* private fields */ }Expand description
A circulation map request for one space.
Entrances are never obstacles, and the scope is neither an entrance, a component nor an obstacle: the constructor removes them, as walkability does. The lists are sorted and deduplicated.
Implementations§
Source§impl CirculationRequest
impl CirculationRequest
Sourcepub fn try_new(
scope: ObjectId,
entrances: Vec<ObjectId>,
components: Vec<ObjectId>,
obstacles: Vec<ObjectId>,
width_metres: f64,
height_metres: f64,
tolerance_metres: f64,
) -> Result<Self, FreeSpaceError>
pub fn try_new( scope: ObjectId, entrances: Vec<ObjectId>, components: Vec<ObjectId>, obstacles: Vec<ObjectId>, width_metres: f64, height_metres: f64, tolerance_metres: f64, ) -> Result<Self, FreeSpaceError>
A path width_metres wide, free height_metres above the scope’s
floor, in scope; a subject is near a piece within half the width
plus tolerance_metres.
§Errors
FreeSpaceError::InvalidClearanceShape for a width or height that
is not positive and finite, or a tolerance that is negative or not
finite.
Sourcepub fn with_merged_scopes(
self,
merged: Vec<ObjectId>,
) -> Result<Self, FreeSpaceError>
pub fn with_merged_scopes( self, merged: Vec<ObjectId>, ) -> Result<Self, FreeSpaceError>
Maps the union of the scope and merged scopes, such as the spaces
of one room split by a virtual boundary, as one free area. Merged
scopes stand on the scope’s floor and are never obstacles.
§Errors
FreeSpaceError::MergedScopeConflict when a merged scope is an
entrance or a component.
Sourcepub fn merged_scopes(&self) -> &[ObjectId]
pub fn merged_scopes(&self) -> &[ObjectId]
The scopes mapped together with the scope, sorted.
Sourcepub fn with_band_from(self, from_metres: f64) -> Result<Self, FreeSpaceError>
pub fn with_band_from(self, from_metres: f64) -> Result<Self, FreeSpaceError>
Counts obstacles only from from_metres above the floor up to the
height, so a skirting or a low sill below it leaves the path free.
§Errors
FreeSpaceError::InvalidElevationBand for a start that is
negative, not finite or not below the height.
Sourcepub fn with_swept_doors(
self,
swept: Vec<SweptDoor>,
) -> Result<Self, FreeSpaceError>
pub fn with_swept_doors( self, swept: Vec<SweptDoor>, ) -> Result<Self, FreeSpaceError>
Counts the sectors swept doors sweep as obstacles (see
SweptDoor): a piece stays clear of their circumscribed
polygons, a possible piece only of their inscribed ones. An entrance
is walked through, so its own swing is dropped, as the entrance is
from the obstacles.
§Errors
FreeSpaceError::ConflictingSweptDoors when one door is given
twice with different sectors.
Sourcepub fn swept_doors(&self) -> &[SweptDoor]
pub fn swept_doors(&self) -> &[SweptDoor]
The doors whose swept sectors are obstacles, sorted by door.
Sourcepub fn components(&self) -> &[ObjectId]
pub fn components(&self) -> &[ObjectId]
The components the path must come near.
Sourcepub fn obstacles(&self) -> &[ObjectId]
pub fn obstacles(&self) -> &[ObjectId]
The objects that occupy floor, counted by what they occupy in the band.
Sourcepub fn width_metres(&self) -> f64
pub fn width_metres(&self) -> f64
The path’s width.
Sourcepub fn height_metres(&self) -> f64
pub fn height_metres(&self) -> f64
The height above the floor the path must be free to.
Sourcepub fn tolerance_metres(&self) -> f64
pub fn tolerance_metres(&self) -> f64
How much farther than half the width a subject may be from a piece and still be near it.
Sourcepub fn band(&self) -> ElevationBand
pub fn band(&self) -> ElevationBand
The band obstacles count in: from the band’s start (the floor by default) up to the height above the floor.