Skip to main content

recover

Function recover 

Source
pub fn recover(
    scale: f64,
    page: [f64; 2],
    page_pinned: bool,
    first: Findings,
    floor: Option<f64>,
    plan: &mut dyn FnMut(Retry) -> Option<Findings>,
) -> Vec<Attempt>
Expand description

draftwright’s bounded, ordered recovery on a finished drawing (builder._AutomaticResolution, recover_hard_layout and recover_required_no_iso), for a plan at scale on page whose findings are first:

  • a hard layout failure comes first, whatever was lost: the nearest smaller then the nearest larger standard scale on the same sheet, then each larger standard sheet;
  • else a required loss: the next larger scales on the same sheet, then each larger sheet;
  • else nothing: a valid, complete plan never spends a larger sheet.

A sheet the spec names (page_pinned) is never left. The first clean try is taken (plan gives each try’s findings); the tries are returned in order, the taken one last. None taken: the first plan stands.