Skip to content

KFactory 2.0.0rc0

codecov

Kfactory is the backend for gdsfactory. It is built upon KLayout. It offers basic operations like gdsfactory, so it can be used on its own as as layout tool as well.

It is recommended to pin the version of KFactory in requirements.txt or pyproject.toml with kfactory==2.0.0rc0 for example.

Features similar to gdsfactory:

  • Cells & decorator for caching & storing cells
  • Simple routing (point to point and simpl bundle routes for electrical routes)
  • Basic cells like euler/circular bends, taper, waveguide
  • Path extrusion (no interface with CrossSections)
  • Jupyter integration
  • PDK/package configuration
  • Plugin system (simulations etc.) - Check kplugins
  • Generic PDK example - Check kgeneric
  • CrossSection
  • Netlist/Schematics and LVS

Notable missing Features:

  • More advanced routing

New/Improved Features:

  • Fully hierarchical bi-directional conversion to YAML
  • Automatic snapping to grid thanks to KLayout
  • More features for vector geometries due to concept of Point/Edge/Vector/Polygon from Klayout
  • Easy booleans thanks to KLayout Regions
  • Enclosures: use the concept of enclosures, similar to cross sections, to allow automatic calculation of boolean layers for structures based on minkowski sum, which are built into KLayout

Getting Started

Installation

kfactory is available as kfactory on PyPI

Install kfactory with uv, or pip:

# Add kfactory to your project.
uv add kfactory

# With pip.
pip install kfactory

At the moment kfactory works only on python 3.11 and above

Development Installation

A development environment can be installed with

just dev

For committing pre-commit should be installed with pre-commit install (this is done with just dev).