Skip to main content

Crate layouttk

Crate layouttk 

Source
Expand description

Read, edit, and write hierarchical GDSII and OASIS layouts on their original integer grid. Coordinates and widths are in database units. A database unit’s physical size is in meters. The user guides cover Python, file conversion, tool interoperability and benchmarks.

Draw a marked polygon, repeat it at explicit offsets, and write OASIS in memory.

use layouttk::{Element, Format, Layer, Layout, Point, Property, Repetition, write_to};

let mut mask = Layout::new("MASK", 1e-9)?;
mask.add_cell("DIE")?;
let mut contact = Element::Polygon {
    layer: Layer { number: 7, datatype: 1 },
    points: vec![Point { x: 0, y: 0 }, Point { x: 40, y: 0 }, Point { x: 0, y: 20 }],
};
contact.set_properties(vec![Property::gds(7, b"CONTACT")]);
contact.set_repetition(Some(Repetition::Offsets(vec![
    Point { x: -13, y: 27 }, Point { x: 51, y: 8 },
])))?;
mask.add_element("DIE", contact)?;
let mut data = Vec::new();
write_to(&mask, &mut data, Format::Oasis)?;
let restored = layouttk::read_from(data.as_slice(), None)?;
assert_eq!(mask.cells, restored.cells);

Modules§

conversion
Conversion diagnostics and exact, integer-factor refinement of the database grid.
file_workflows
File-level inventory and verification on the integer database grid.
gds_tools
Record-level GDSII utilities. Raw cells retain their source database unit and can contain records outside the editable layout profile.
geometry
Polygon operations on integer database coordinates. A region is a list of implicitly closed contours, filled by the nonzero winding rule. Results have counterclockwise outer boundaries and clockwise holes. Use fracture to obtain independent filled polygons suitable for crate::Layout::add_element.
guides
Guides for working with GDSII and OASIS in Python, Rust, and the terminal.
hierarchy
Queries and edits on cell definitions and placed geometry. Array vectors are expressed in the containing cell, before outer transforms.
paths
Curves are constructed in continuous database units. Polygon vertices are rounded once, to the nearest DBU (halfway values away from zero).

Structs§

Array
Cell
Layer
LayerName
Layout
Point
Property
ReadOptions
Reading policy. The OASIS budget accounts for retained data, separately from decoding buffers.
Summary
TableProperties
TextStyle
Transform

Enums§

Element
Error
Distinguishes malformed data from valid format features outside the supported profile.
Format
GridRounding
Policy when a physical length lies between two target grid points.
Interval
PathEnds
PropertyValue
Repetition
Offsets are in the parent coordinate system, relative to the implicit first position.
TableEntry
OASIS string table entry that owns one or more properties.

Constants§

DEFAULT_OAS_BUDGET

Functions§

check_write
Exercise the same encoder as a file write, reporting the first error without creating a file.
read
read_from
write
Finish serialization in the destination directory before replacing the target.
write_to

Type Aliases§

Result