arun-goud / gdschamfer

Python add-on module for gdspy that can perform chamfering operation on GDSII files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gdschamfer

gdschamfer is a Python add-on module for gdspy that can perform chamfering operation on GDSII files. It extends the fillet function in gdspy so that:

  • inside corners (i.e., concave bends) or outside corners (i.e., convex bends) can be selectively chamfered or filleted.

  • orthogonal corners can be selectively chamfered or filleted.

The operation of chamfering leads to corners being replaced with 45° slanting edges. An example of inside corners of a polygon being chamfered is shown below:

On the other hand, the filleting operation that gdspy's fillet() function does will result in concave curved corners for inside corners and convex (or rounded) corners for outside corners. When the fillet radius of curvature tends to infinity the resulting fillet starts to approximate a chamfer.

Usage

To use gdschamfer install its PyPI python distribution package using pip:

pip install gdschamfer

In your python scripts place the import statement

import gdschamfer

There are 3 functions available for use:

  1. gdschamfer.chamfer_polygons(...): Use this to perform chamfering of gdspy Polygon objects.

  2. gdschamfer.chamfer_cell(...): Use this to perform chamfering of gdspy Cell objects.

  3. gdschamfer.chamfer_gds(...): Use this to perform chamfering on GDSII file.

Chamfer style

To understand how the option chamfer_style modifies the corners consider the GDSII file demo/input.gds shown below:


a) When chamfer_style = "inside_corners":

GDSII with 3 polygons, with 2 on layer 20 and 1 on layer 22 showing chamfered inside corners


b) When chamfer_style = "outside_corners":

GDSII with 3 polygons, with 2 on layer 20 and 1 on layer 22 showing chamfered outside corners


c) When chamfer_style = "all_corners":

GDSII with 3 polygons, with 2 on layer 20 and 1 on layer 22 showing chamfered corners


About

Python add-on module for gdspy that can perform chamfering operation on GDSII files

License:Boost Software License 1.0


Languages

Language:Python 100.0%