2 KiB
2 KiB
masque Tutorial
These examples are meant to be read roughly in order.
- Start with
basic_shapes.pyfor the corePattern/ GDS concepts. - Then read
devices.pyandlibrary.pyfor hierarchical composition and libraries. - Read the
pather*tutorials separately when you want routing helpers.
Contents
- basic_shapes:
- Draw basic geometry
- Export to GDS
- devices
- Build hierarchical photonic-crystal example devices
- Reference other patterns
- Add ports to a pattern
- Use
Patherto snap ports together into a circuit - Check for dangling references
- library
- Continue from
devices.pyusing a lazy library - Create a
LazyLibrary, which loads / generates patterns only when they are first used - Explore alternate ways of specifying a pattern for
.plug()and.place() - Design a pattern which is meant to plug into an existing pattern (via
.interface())
- Continue from
- pather
- Use
Patherto route individual wires and wire bundles - Use
AutoToolto generate paths - Use
AutoToolto automatically transition between path types
- Use
- renderpather
- Use
Pather(auto_render=False)andPathToolto build a layout similar to the one in pather, but usingPathshapes instead ofPolygons.
- Use
- port_pather
- Use
PortPatherand the.at()syntax for more concise routing - Advanced port manipulation and connections
- Use
Additionally, pcgen is a utility module used by devices.py for generating
photonic-crystal lattices; it is support code rather than a step-by-step tutorial.
Running
Run from inside the examples directory:
cd examples/tutorial
python3 basic_shapes.py
klayout -e basic_shapes.gds
Some tutorials depend on outputs from earlier ones. In particular, library.py
expects circuit.gds, which is generated by devices.py.