GDSFactory

9.40.1 · active · verified Fri Apr 17

gdsfactory is a Python library for generating GDS layouts, primarily used in photonics and electronics design. It provides a robust framework for creating parametric cells, routing, and packaging complex circuits into GDSII format. The current version is 9.40.1, and it maintains a rapid release cadence with frequent updates and new features.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a basic GDSFactory component, add a standard straight waveguide, and export it to a GDSII file. Ensure you have GDSFactory installed before running.

import gdsfactory as gf

# Create a new component
c = gf.Component("my_first_device")

# Add a straight waveguide to the component
waveguide = c << gf.components.straight(length=10, width=0.5)

# Optionally, rotate the waveguide
waveguide.rotate(45)

# Write the component to a GDSII file
c.write_gds("my_first_device.gds")

print(f"Generated GDS file: {c.name}.gds")

view raw JSON →