klayout-core
Core data model for the klayout-rs
workspace: coordinates, shapes, cells, libraries, layers, ports,
transformations, and the parameterized-component machinery every other
crate is built on.
What's in here
| Module | Contents |
|---|---|
coord |
DBU integer coordinates, Point, Vec2, Bbox, Trans, Rot4. |
shape |
Shape, Polygon, Path, Rect, Text and friends — data only. |
cell |
Immutable Cell, CellBuilder, ShapeBag, content-hashed CellId. |
library |
Library: thread-safe interner of cells + layer table. |
layer |
LayerIndex, LayerInfo, LayerTable. |
port |
Typed Port, PortKindId, Angle90. |
instance |
Instance, Repetition arrays, SourceTag provenance. |
component |
Parameterized cell generation via Component + BuildCtx. |
edit |
flatten, clip_cell, remap_layers, replace_instances. |
query |
LayoutQuery, HierarchyVisitor for read-only traversal. |
hash |
Deterministic structural ContentHash and ParamHash. |
properties |
Properties map for user-defined per-shape/cell metadata. |
bus |
Bus-name parser/formatter for synthesis-style pin lists. |
error |
CoreError and Result. |
Design contract
- Frozen cells are immutable. All mutation goes through
CellBuilder. ContentHashis deterministic, structural, and byte-stable across runs.- All coordinates are
i64DBU. Microns are a thin conversion layer. LibraryisSend + Sync; concurrentbuild/insertis safe.CellId/LayerIndexare meaningful only with their issuing library.- No global state.
BuildCtxis passed.
Example
use ;
let lib = new;
let m1 = lib.layer;
let mut cell = lib.builder;
cell.add;
let top = cell.freeze;
License
Licensed under GPL-3.0-only.