This script generates a GDS file containing a grid of cross-shaped alignment marks labeled by row and column. This script was created to explore and get familiar with KLayout’s Python API and batch processing workflow.
- Square array of alignment marks
- Configurable dimensions and spacing
- Label generation using
TextGenerator
- Unit conversion across
in
,mm
,µm
,um
, andnm
- Automatic file versioning to prevent overwrites
- Author attribution embedded as a label in the final row
- GDS files are saved in an
output/
directory relative to the script. - If a file with the default name already exists, a numeric suffix is appended.
- KLayout (used for layout generation and rendering)
- Python scripting is handled via KLayout’s built-in
pya
module - Visual Studio Code (optional, for debugging and automation)
Run the script directly with:
/Applications/KLayout.app/Contents/MacOS/klayout -b -r square-of-alignment-marks.py
This project includes optional VS Code configuration files under .vscode/
:
launch.json
— Enables Python debugging of the script from within VS Code.tasks.json
— Automates running the script through KLayout’s batch interface.
To use:
- Open the project folder in VS Code.
- Use
Run Task
to trigger GDS generation. - Use
Run > Start Debugging
(F5) to test Python logic inside VS Code.
The last row of the array includes a centered label:
Created By: William Veith
This serves as a digital signature for traceability and versioning.
This is a basic, practical script for:
- Learning the KLayout scripting interface
- Testing layout automation techniques
- Creating consistent training/test samples for lithography tools