GithubHelp home page GithubHelp logo

skandanc / phidl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amccaugh/phidl

0.0 0.0 0.0 18.02 MB

Python GDS layout and CAD geometry creation

License: MIT License

Python 90.56% Jupyter Notebook 9.44%

phidl's Introduction

pytest pre-commit

PHIDL

GDS scripting for Python that's intuitive, fast, and powerful.

import phidl.routing as pr
D_left = pr.route_smooth(port1, port2, radius=8, layer = 2)
D_right = pr.route_sharp(port1, port2, layer = 2)

phidl example image

Citation

If you found PHIDL useful, please consider citing it in (just one!) of your publications -- we appreciate it greatly. (BibTeX)

  • McCaughan, A. N., et. al. PHIDL: Python-based layout and geometry creation for nanolithography. J. Vac. Sci. Technol. B 39, 062601 (2021). http://dx.doi.org/10.1116/6.0001203

Gallery

Installation / requirements

  • Install or upgrade with pip install -U phidl
  • Python version >=3.5
  • If you are on Windows or Mac and don't already have gdspy installed, you will need a C++ compiler
    • For Windows + Python 3, install "Build Tools for Visual Studio" (make sure to check the "C++ build tools" checkbox when installing)
    • For Mac, install "Xcode" from the App Store, then run the command xcode-select --install in the terminal

About PHIDL

fiddle (verb) - /ˈfidl/ - to make minor manual movements, especially to adjust something

PHIDL is an open-source GDS-based CAD tool for Python that significantly extends the excellent gdspy. The base installation includes a large library of simple shapes (e.g. rectangles, circles), photonic structures (e.g. sine curve waveguides), and superconducting nanowire shapes (e.g. single photon detectors) that are fully parameterized. It also has a built-in quick-plotting function based on matplotlib (or Qt) that allows you view the state of any GDS object, useful when scripting geometry-making functions. It also has a geometry library reference and a set of very thorough tutorials that will walk you through the process of getting acquainted with PHIDL.

The goal is to bring the usability of Illustrator / Inkscape drawing programs to the GDS scripting world. Like Python itself, it aims to be readable, and intuitive. For instance, when building a geometry you don't have to worry about what the exact coordinates are anymore. If you want to separate two ellipses in the x direction by 5 units, you can do things like this:

ellipse1.xmin = ellipse2.xmax + 5

or if you want to move then rotate one ellipse by 45 degrees you can do

ellipse2.move([1,7]).rotate(45)

There's a few dozen shortcuts like this that make life easier built into PHIDL--they're simple, but they make a world of difference when you just want to e.g. space a ring resonator some distance from a waveguide without having to track each and every coordinate of the shape.

phidl example image

There's also a "port" functionality that allows you to snap together geometry like Legos without caring about where exactly the absolute coordinates of either geometry is. For instance, connecting the above misaligned rectangles is a two-line command:

phidl example image

It also allows you to do things like add text and create smooth or straight routing curves between "ports" of different devices, convenient for making electrical or optical connections:

phidl example image phidl example image

Other useful functionality available are standard operations like booleans:

phidl example image

and less standard ones like creating outlines. A whole layout can be outlined directly in the GDS without requiring you to use Beamer (useful for positive-tone resist structures):

pg.outline(D, distance = 0.7, layer = 4)

phidl example image

The geometry library also has useful resolution test-structures built into it, for instance

pg.litho_calipers(num_notches = 7, offset_per_notch = 0.1)
pg.litho_steps(line_widths = [1,2,4,8,16])
pg.litho_star(num_lines = 16, line_width = 3)

phidl example image

There are also handy functions to help pack shapes into as small an area as possible:

pg.packer(D_list, spacing = 1.25, aspect_ratio = (2,1))

phidl example image

phidl's People

Contributors

amccaugh avatar atait avatar basnijholt avatar bucklesm avatar dmwo avatar gyger avatar joamatab avatar jolzgrafe avatar jtchiles avatar melonisj avatar mr-roger-a avatar omedeiro avatar spauka avatar synapticarbors avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.