{"id":13736223,"url":"https://github.com/amccaugh/phidl","last_synced_at":"2025-04-04T09:08:55.946Z","repository":{"id":37851490,"uuid":"65043733","full_name":"amccaugh/phidl","owner":"amccaugh","description":"Python GDS layout and CAD geometry creation","archived":false,"fork":false,"pushed_at":"2024-07-22T17:59:38.000Z","size":19327,"stargazers_count":205,"open_issues_count":1,"forks_count":66,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-28T08:09:21.387Z","etag":null,"topics":["boolean","cad","gds","gdsii","geometry","layout","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amccaugh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.bib","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-05T19:25:11.000Z","updated_at":"2025-02-12T07:12:50.000Z","dependencies_parsed_at":"2024-01-17T07:07:49.638Z","dependency_job_id":"2a52db0c-5470-4fd9-9d9f-e46d9732e431","html_url":"https://github.com/amccaugh/phidl","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amccaugh%2Fphidl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amccaugh%2Fphidl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amccaugh%2Fphidl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amccaugh%2Fphidl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amccaugh","download_url":"https://codeload.github.com/amccaugh/phidl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149501,"owners_count":20891954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boolean","cad","gds","gdsii","geometry","layout","python"],"created_at":"2024-08-03T03:01:17.766Z","updated_at":"2025-04-04T09:08:55.922Z","avatar_url":"https://github.com/amccaugh.png","language":"Python","funding_links":[],"categories":["layout","Layout Compilers"],"sub_categories":[],"readme":"[![pytest](https://github.com/amccaugh/phidl/actions/workflows/pytest.yml/badge.svg)](https://github.com/amccaugh/phidl/actions/workflows/pytest.yml)\n[![pre-commit](https://github.com/amccaugh/phidl/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/amccaugh/phidl/actions/workflows/pre-commit.yml)\n\n# PHIDL\nGDS scripting for Python that's intuitive, fast, and powerful.\n\n- [**Installation / requirements**](#installation--requirements)\n- [**Tutorial + examples**](https://phidl.readthedocs.io/en/latest/tutorials.html) (or [try an interactive notebook](https://mybinder.org/v2/gh/amccaugh/phidl/master?filepath=phidl_tutorial_example.ipynb))\n- [**Geometry library + function documentation**](https://phidl.readthedocs.io/en/latest/geometry_reference.html)\n- [Changelog](https://github.com/amccaugh/phidl/blob/master/CHANGELOG.md) (latest update 1.7.2 on July 3, 2024)\n  -  New KLayout-based boolean/offset/outline functions!  These are under the name `pg.kl_boolean()`, `pg.kl_offset`, `pg.kl_outline()`, `pg.kl_invert()`.  They utilize the excellent KLayout tile processor, which allows breaking down \u0026 parallelizing these operations--in a nutshell, these operations should be much, much faster, and they also are more robust than the gdspy/clipper implementation. To use these new functions, you must first `pip install klayout`\n  - Path.interpolate() now allows easy placement of objects alongside a path (e.g. for placing vias).  See [the tutorial](https://phidl.readthedocs.io/en/latest/tutorials/waveguides.html#Interpolating-/-placing-objects-along-a-path) for more information\n\n\n# Citation\n\nIf you found PHIDL useful, please consider citing it in (just one!) of your publications -- we appreciate it greatly. ([BibTeX](https://raw.githubusercontent.com/amccaugh/phidl/master/CITATION.bib))\n - 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\n\n# Gallery\n\n\u003cimg src=\"https://amccaugh.github.io/phidl/phidl1.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl2.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl3.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl4.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl5.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl6.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl7.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl8.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl9.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl10.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl11.png\" width=\"30%\"\u003e\u003c/img\u003e \u003cimg src=\"https://amccaugh.github.io/phidl/phidl12.png\" width=\"30%\"\u003e\u003c/img\u003e\n\n# Installation / requirements\n- Install or upgrade with `pip install -U phidl`\n- Install with `pip install -U phidl[all]` to include optional dependencies (e.g. freetype-py, klayout, rectpack)\n- Python version \u003e=3.6\n\n## Testing\n- Install with test dependencies with `pip install -U phidl[test]` (includes `all` extras as well)\n- Run tests with `pytest` (or `python -m pytest`)\n\n# About PHIDL\n\n*fiddle (verb) - /ˈfidl/ - to make minor manual movements, especially to adjust something*\n\nPHIDL is an open-source GDS-based CAD tool for Python that significantly extends the excellent [gdspy](https://github.com/heitzmann/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__](https://phidl.readthedocs.io/) and a set of [__very thorough tutorials__](https://phidl.readthedocs.io/en/latest/tutorials.html) that will walk you through the process of getting acquainted with PHIDL.\n\nThe 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:\n\n`ellipse1.xmin = ellipse2.xmax + 5`\n\nor if you want to move then rotate one ellipse by 45 degrees you can do\n\n`ellipse2.move([1,7]).rotate(45)`\n\nThere'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.\n\n[](http://amccaugh.github.io/phidl)\n\n![phidl example image](https://amccaugh.github.io/phidl/readme_1.png)\n\n\nThere'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:\n\n![phidl example image](https://amccaugh.github.io/phidl/readme_2.png)\n\nIt 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:\n\n![phidl example image](https://amccaugh.github.io/phidl/readme_3.png)\n![phidl example image](https://amccaugh.github.io/phidl/readme_4.png)\n\n\nOther useful functionality available are standard operations like booleans:\n\n![phidl example image](https://amccaugh.github.io/phidl/readme_8.png)\n\n 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):\n\n`pg.outline(D, distance = 0.7, layer = 4)`\n\n![phidl example image](https://amccaugh.github.io/phidl/readme_5.png)\n\nThe geometry library also has useful resolution test-structures built into it, for instance\n\n```\npg.litho_calipers(num_notches = 7, offset_per_notch = 0.1)\npg.litho_steps(line_widths = [1,2,4,8,16])\npg.litho_star(num_lines = 16, line_width = 3)\n```\n\n![phidl example image](https://amccaugh.github.io/phidl/readme_7.png)\n\nThere are also handy functions to help pack shapes into as small an area as possible:\n\n```\npg.packer(D_list, spacing = 1.25, aspect_ratio = (2,1))\n```\n\n![phidl example image](https://amccaugh.github.io/phidl/packer.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famccaugh%2Fphidl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famccaugh%2Fphidl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famccaugh%2Fphidl/lists"}