guess

Function guess 

Source
pub fn guess(boundingboxes: &[Rectangle]) -> Guessed
Expand description

Guesses layout properties (direction, spacing and alignment) from a list of bounding boxes.

The algorithm roughly follows these steps:

  1. Sum gaps along both axes and pick the axis with the larger gap spread as the main axis.
  2. Compute average spacing along the chosen axis.
  3. Sort rectangles on that axis to derive their order.
  4. Estimate cross axis alignment by comparing the variance of starts, centers and ends.