Examples
Runnable examples that generate GDS outputs.
packages/examples currently provides two runnable examples:
straight_waveguide.gdsring_coupler.gds
Generation command:
uv run --package laylight-examples laylight-examples --output-dir build/examplesIf the workspace dependencies are not installed yet, you can also run:
PYTHONPATH=packages/core:packages/examples python -m laylight_examples --output-dir build/examplesExample Structure
The example code follows a simple pattern:
- Create a new
Layoutand top-level cell - Instantiate a device from
core - Insert the device cell into the top-level cell
- Call
layout.write()to export GDS
This pattern is a good base for more complex composition examples, such as:
- Multi-segment waveguide routing
- MZI structures
- Tunable devices with heaters
- Probe pad and routing examples