memea::gds

Function hash_lib

Source
pub fn hash_lib(lib: GdsLibrary) -> HashMap<String, Vec<GdsElement>>
Expand description

Creates a hashmap of GDS library cells indexed by name for fast lookup.

This function transforms a GDS library into a HashMap where each cell name maps to its corresponding vector of geometric elements, enabling efficient cell lookup during dimension computation.

§Arguments

  • lib - GDS library containing cell structures and elements

§Returns

HashMap mapping cell names to their geometric elements

§Examples

use gds21::GdsLibrary;
use memea::gds::hash_lib;

let library = GdsLibrary::load("layout.gds").expect("Failed to load GDS");
let cell_map = hash_lib(library);
println!("Loaded {} cells from GDS", cell_map.len());