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.
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:
-
gdschamfer.chamfer_polygons(...)
: Use this to perform chamfering of gdspy Polygon objects. -
gdschamfer.chamfer_cell(...)
: Use this to perform chamfering of gdspy Cell objects. -
gdschamfer.chamfer_gds(...)
: Use this to perform chamfering on GDSII file.
To understand how the option chamfer_style modifies the corners consider the GDSII file demo/input.gds
shown below: