Skip to main content

grow

Function grow 

Source
pub fn grow(
    geometry: &Geometry,
    units: &[Unit],
    wires: &[Wire],
    fill: Fill,
    blocked: &[Rect],
) -> Result<Vec<Region>, PlaceError>
Expand description

The floorplan of units in regions of whole tiles, each unit in the order given. Its seed is the free tile where its wires are shortest (each wire’s width times the straight distance from the tile’s centre to the centre of the unit at its other end, placed before it, or to its fixed site), among the free tiles of an area that holds it at fill, the top row and left column first on a tie. The region then takes, one at a time, the free tile beside it nearest the centre of its sites so far (then where the wires are shortest, then the top row and left column) until it holds the unit, so it grows as compact as the tiles allow and bends round what is taken. A tile is free when no region before it took it and it overlaps nothing blocked. A unit no free area holds is refused by name.