Expand description
Exact planar shortest paths over a visibility graph, with typed unreachable reasons.
The kernel reports that no route exists under a given envelope. It never reports that a design is non-compliant: that reading belongs to the consumer, not to geometry.
Structs§
- Cost
Region - A polygon inside which travel costs
factortimes its length. - Distance
Map - Shortest-path distances from every point of a region to the nearest of several targets.
- Farthest
- The greatest distance from a subregion to the nearest target.
- Forced
Walk - The shortest walk from an origin to a target that enters a polygon.
- Length
Interval - A closed interval of lengths.
- Reach
- The nearest target from a point, and the route there.
- Route
- A shortest path and its length.
- Skeleton
- The skeleton: nodes and the edges joining them.
- Skeleton
Node - One node of the skeleton.
- Wall
- A wall edge: which polygon, which ring (0 the outer,
kthek-th hole) and which edge of it (from pointedgeto the next). - Weighted
Forced Walk - The cheapest walk from an origin to a target that enters a polygon, over weighted maps.
- Weighted
Map - Weighted distances to the nearest of several targets, bracketed.
- Weighted
Reach - The nearest target by weighted distance, bracketed, and a walk there.
Enums§
- Farthest
Error - Why no bracket was produced.
- MapError
- Why no distance map was built.
- Node
Kind - What a skeleton node is.
- Route
Error - A malformed query, as opposed to an honest “no route”.
- Skeleton
Error - Why no skeleton was built.
- Unreachable
- Why no path was produced.
Constants§
- MAX_
CELLS - Cells
farthest_pointrefines at most. - MAX_
VERTICES - Maximum vertices, counting region, barrier and endpoint vertices.
- MAX_
WEIGHTED_ NODES - Graph nodes a weighted map builds at most: region, barrier, target and cost-polygon vertices, and the points along cost edges.
Functions§
- distance_
map - A distance map from
targetsoverregion, avoidingbarriers. - distance_
map_ weighted - A distance map whose targets each start at their own distance: the
distance from a point is the least, over targets, of the route’s
length to the target plus the target’s weight (#197). For a way out
that carries the rest of a walk beyond it, such as a stair landing.
With every weight zero it is
distance_map. - distance_
map_ within distance_mapwith a caller-chosen vertex budget.- distance_
map_ within_ weighted distance_map_weightedwith a caller-chosen vertex budget.- farthest_
point - The greatest distance to the nearest target over the points of
subregionin the map’s free space, bracketed to withintolerance. - farthest_
point_ within farthest_pointwith a caller-chosen cell budget.- forced_
walk - The shortest walk from an origin of
fromto a target oftothat entersthrough, bracketed to withintolerance. - forced_
walk_ within forced_walkwith a caller-chosen cell budget.- shortest_
path - Shortest path from
starttogoalinsideregion, avoidingbarriers. - shortest_
path_ within shortest_pathwith a caller-chosen vertex budget.- skeleton
- The skeleton of
region, its boundary sampled at mostspacingapart, keeping the nodes whose nearest walls spread at leastprunetimes their clearance apart (1.5 drops the spurs into right-angled corners; 0 keeps every node). - weighted_
distance_ map - A weighted distance map from
targetsoverregion, avoidingbarriers, with travel insidecostsweighted by their factors and points along cost edges at mostspacingapart. - weighted_
distance_ map_ seeded - A weighted distance map whose targets each start at their own cost:
the distance from a point is the least, over targets, of the weighted
cost of a walk to the target plus the target’s weight (#198), as
crate::distance_map_weightedis for plain maps. With every weight zero it isweighted_distance_map. - weighted_
distance_ map_ seeded_ within weighted_distance_map_seededwith a caller-chosen node budget.- weighted_
distance_ map_ within weighted_distance_mapwith a caller-chosen node budget.- weighted_
farthest_ point - The greatest weighted distance from a subregion to the nearest target
over its points in the free space, bracketed to within
tolerancewhere the map’s own bracket allows: the result is never narrower than the gap between the map’s bounds at the farthest point. - weighted_
farthest_ point_ within weighted_farthest_pointwith a caller-chosen cell budget.- weighted_
forced_ walk - The cheapest walk from an origin of
fromto a target oftothat entersthrough, where both maps weight travel by the same cost regions (#198):forced_walkforWeightedMaps. Origins’ start weights (seecrate::weighted_distance_map_seeded) count. - weighted_
forced_ walk_ within weighted_forced_walkwith a caller-chosen cell budget.