Python package for lithography mask design.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Jan Petykiewicz afcbd315ae Fix extra vertex added during OASIS loading 8 months ago
examples move dev2pat and pat2dev into masque.builder.port_utils 2 years ago
masque Fix extra vertex added during OASIS loading 8 months ago
.flake8 style and type fixes (per flake8) 3 years ago
.gitignore add .oas.gz to .gitignore 3 years ago Add license 8 years ago Min python version to 3.8 9 months ago
pyproject.toml Move from setuputils and to hatch and pyproject.toml 9 months ago


Masque is a Python module for designing lithography masks.

The general idea is to implement something resembling the GDSII file-format, but with some vectorized element types (eg. circles, not just polygons), better support for E-beam doses, and the ability to output to multiple formats.



  • python >= 3.8
  • numpy
  • klamath (used for gdsii i/o and library management)
  • matplotlib (optional, used for visualization functions and text)
  • ezdxf (optional, used for dxf i/o)
  • fatamorgana (optional, used for oasis i/o)
  • svgwrite (optional, used for svg output)
  • freetype (optional, used for text)

Install with pip:

pip3 install 'masque[visualization,oasis,dxf,svg,text]'

Alternatively, install from git

pip3 install git+


  • Pattern: OASIS or GDS "Cell", DXF "Block"
  • SubPattern: GDS "AREF/SREF", OASIS "Placement"
  • Shape: OASIS or GDS "Geometry element", DXF "LWPolyline" or "Polyline"
  • repetition: OASIS "repetition". GDS "AREF" is a SubPattern combined with a Grid repetition.
  • Label: OASIS, GDS, DXF "Text".
  • annotation: OASIS or GDS "property"


  • Better interface for polygon operations (e.g. with pyclipper)
    • de-embedding
    • boolean ops
  • Construct polygons from bitmap using skimage.find_contours
  • Deal with shape repetitions for dxf, svg