Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dteal/gdsiistl
Converts GDSII files to STL files.
https://github.com/dteal/gdsiistl
gdsii
Last synced: about 2 months ago
JSON representation
Converts GDSII files to STL files.
- Host: GitHub
- URL: https://github.com/dteal/gdsiistl
- Owner: dteal
- License: gpl-3.0
- Created: 2020-04-21T23:57:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-22T10:18:42.000Z (over 4 years ago)
- Last Synced: 2024-08-03T17:10:40.112Z (5 months ago)
- Topics: gdsii
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 32
- Watchers: 4
- Forks: 20
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-opensource-hardware - gdsiistl
README
# gdsiistl
Converts GDSII files to STL files.
GDSII files are often large, complex 2D designs for integrated circuits and MEMS chips. 3D visualization of the designs can be very useful, but this is tricky due to the complexity of the files. This is a simple script that extrudes selected layers of the GDSII files into 3D and outputs them as separate 3D STL files for visualization in an external program.
# Installation
Install git and Python 3 and its package manager (`pip`), then install:
```
pip install numpy
pip install gdspy
pip install numpy-stl
pip install triangle
```The modules `gdspy` and `triangle` compile C libraries, which may cause trouble on Windows; it might require you to first install Microsoft Visual C++ Build Tools (e.g., from https://visualstudio.microsoft.com/downloads).
Finally:
```
git clone https://github.com/dteal/gdsiistl
```# Usage
Suppose you have a GDSII file called `file.gds` that is to be converted to a 3D STL format.
First, choose GDSII layers to export and their thicknesses by editing `gdsiistl.py`, specifically, by entering the desired GDSII layer numbers and z bounds in the `layerstack` variable around line 35.
Second, run `python3 gdsiistl.py file.gds`. The file will be processed and output files written to `file.gds_layername1.stl`, `file.gds_layername2.stl`, etc.
Concretely:
```
cd gdsiistl
python gdsiistl.py example/example.gds
# output files are example/example.gds_substrate.stl, etc.
```Many programs are capable of viewing the output STL files. Blender (https://www.blender.org/) can import STL files, apply materials, and render very impressive visualizations.
## Note
Due to a limitation of the library used to triangulate the polygonal boundaries of the GDSII geometry, the polygon borders (i.e., all geometry) are shifted slightly (by a hardcoded delta of about 0.01 units, or 10 nanometers in standard micron units) before export. Furthermore, due to another related limitation/bug (not yet completely understood; see source code comments), extra triangles are sometimes created covering holes in polygons.
So the output mesh is not guaranteed to be watertight, perfectly dimensioned, or retain all polygon holes, but it should be arbitrarily close and err on the side of extra triangles, so a program (e.g., Blender) can edit the mesh by deleting faces and produce a negligibly-far-from perfect visualization.