footprint_stepped

footprint_stepped#

rapidtools.processing.street_structures.footprint_stepped(wall_points: ndarray, depth_points: ndarray, camera: ndarray, street: ndarray, assumed_depth_m: float = 10.0, max_depth_m: float = 20.0, bin_m: float = 1.0, min_step_m: float = 1.5, min_run_m: float = 3.0, axis_points: ndarray | None = None) → tuple[list[tuple[float, float]], float, float, float, str, float][source]#

Footprint whose front follows the setbacks of the facade.

Many houses do not present one flat front: the garage stands forward and the entrance is set back, or the reverse. The outline is the rectangle of footprint_rectangle() with its front edge replaced by the wall line measured in every bin_m of facade, cut into straight runs wherever the wall steps by more than min_step_m. The rear stays one straight line: at the deepest point seen, or assumed_depth_m behind the wall set furthest back when the survey saw less than that.

Parameters:
  • wall_points – (n, 2) dense points of the structure.

  • depth_points – (m, 2) further points used to measure the depth.

  • camera – Position of the nearest camera.

  • street – Unit vector along the driven path there.

  • assumed_depth_m – Depth used when less was observed.

  • max_depth_m – Farthest behind the front a point extends the depth.

  • bin_m – Length of facade the wall line is measured over.

  • min_step_m – Smallest change of setback drawn as a step.

  • min_run_m – Shortest run of facade drawn at its own setback.

  • axis_points – (k, 2) points the facade direction is read from, when not all of wall_points.

Returns:

tuple – (footprint, frontage_m, depth_m, observed_depth_m, depth_source, facade_bearing), as footprint_rectangle(). depth_m is measured from the wall nearest the street.

Example

>>> import numpy as np
>>> garage = np.c_[np.linspace(0, 6, 60), np.full(60, 10.0)]
>>> house = np.c_[np.linspace(6, 14, 80), np.full(80, 15.0)]
>>> wall = np.vstack([garage, house])
>>> fp, front, depth, seen, source, facing = footprint_stepped(
...     wall, wall, np.array([7.0, 0.0]), np.array([1.0, 0.0]))
>>> len(fp), round(front), round(depth), source
(6, 14, 15, 'assumed')