pub fn weighted_distance_map(
region: &[Polygon],
barriers: &[Vec<Point2>],
targets: &[Point2],
costs: &[CostRegion],
spacing: f64,
) -> Result<WeightedMap, MapError>Expand description
A weighted distance map from targets over region, avoiding
barriers, with travel inside costs weighted by their factors and
points along cost edges at most spacing apart.
A cost region may touch the region’s boundary up to rounding, as one clipped to the free region does (#198): a cost vertex within 2^-24 of the region’s extent (and a few ulps) of a region edge, on its free side, is moved just across it, and a cost edge may cross a region edge that near one of either edge’s ends. The map is the one for the regions so moved: no sliver along a wall is left for a walk to slip through at factor 1.
§Errors
MapError for malformed input, no targets, a target outside the
region, a factor below 1 or not finite (MapError::InvalidFactor), a
spacing not positive and finite (MapError::InvalidSpacing), a cost
edge that crosses an obstacle or another cost edge other than by such
a touch, or lies along a barrier (MapError::CostCrossing), or more
than MAX_WEIGHTED_NODES graph nodes.