Reading layers

Reading layers

layer name = expr binds a name. input reads from the current design (after source), optionally from a second GDS once that binding is available.

← Language overview

input(n)

Available · yields polygons

layer m1 = input(68)

All shapes on GDS layer n, datatype 0, after flatten into source. Overlapping polygons are merged on read (union plus a vertex stitch).

Input Result Two boxes on one layer → one merged polygon

Notes

  • An empty layer is an empty list, not a null shape.
  • Texts on the layer are invisible without texts(...).
  • Paths and boxes in the layout become polygons.
  • Hierarchy: instance transform (shift, mirror, angle) is already applied to the points.

input(n, d)

Available · yields polygons

layer via = input(70, 20)

Layer n, datatype d. Other datatypes on the same number are a different layer.

Input Result 70/0 70/20

Notes

  • input(70) is not the union of all datatypes 70/* — only datatype 0.
  • A negative n or d is just another index and is usually empty.

input.raw

Available · yields polygons

layer raw = input(68, 20).raw

Like input, but without merge. Overlapping and kissing shapes stay separate polygons. Important for inside on raw shapes and for count.

Input Result Right: two shapes kept apart

Notes

  • Two identical stacked boxes: raw counts two, merged counts one.
  • Only a shared corner: merged stitches one polygon; raw keeps two.
  • Checks on raw measure the edges of each shape — self-space between copies is possible.

input from=

Available · yields polygons

layer b_m1 = input(1, 0, from=other)

Reads from the layout bound with gds other = …. Flatten and cells of the host apply; the main clip window does not.

Input Result

Notes

  • An unknown from= is a runtime error.
  • The file is resolved relative to the deck baseDir.