pub fn augment_dims(
map: &HashMap<String, Vec<GdsElement>>,
cell: &str,
w: Float,
h: Float,
units: f64,
verbose: bool,
) -> Result<Dims, MemeaError>Expand description
Augments component dimensions with enclosure data from GDS layout.
This function looks up a cell in the GDS library hashmap and computes
the required enclosure margins by analyzing the cell’s geometry. It
returns a complete Dims structure with both core dimensions and
enclosure requirements.
§Arguments
map- HashMap of cell names to GDS elements (fromhash_lib)cell- Name of the cell to analyzew- Core component width in micrometersh- Core component height in micrometersunits- GDS unit conversion factorverbose- Whether to show detailed computation output
§Returns
Ok(Dims)- Complete dimensions with enclosure dataErr(MemeaError)- Error during geometry analysis
§Examples
use memea::gds::{hash_lib, augment_dims};
use gds21::GdsLibrary;
let library = GdsLibrary::load("cells.gds").expect("Failed to load GDS");
let cell_map = hash_lib(library);
let units = 1e-9; // 1 nm database units
let dims = augment_dims(&cell_map, "sram_6t", 0.5, 0.8, units, true)
.expect("Failed to compute dimensions");
println!("Cell area: {:.2} μm²", dims.area((1, 1)));