Translate GDS to Blender files
While not an explicit dependency, KLayout is a fantastic open source tool for viewing and creating GDS files.
Follow instructions to install Blender
Add blender to path, to allow for commands from the terminal. The executable exists in these locations (by default).
- 64-bit
C:\Program Files\Blender Foundation\Blender\blender.exe
- 32-bit
C:\Program Files (x86)\Blender Foundation\Blender\blender.exe
/usr/bin/blender
/Applications/blender/blender.app/Contents/MacOS/blender
These instructions help to install pip into the python that comes with blender, since python is not released with pip in the first place. More detail can be found here or with a differently worded google search.
-
First
cd
into your blender path:cd /path/to/blender-2.8/2.80/python
-
Run ensurepip for your blender's python:
/bin/python3.7m lib/python3.7/ensurepip
- in MacOS, ./python3.7m will run the executable instead of just the filename
-
Now you have pip and can install modules by:
bin/pip3 install --target lib/python3.6 packageName
-
Install the dependencies manually:
bin/pip3 install --target lib/python3.6 numpy
bin/pip3 install --target lib/python3.6 gdspy
bin/pip3 install --target lib/python3.6 phidl
-
Run setup.py for this project after downloading from git (untested)
-
Install this module:
bin/pip3 install --target lib/python3.6 gdsblenderpy
See the example.
In essence, add the layers you are interested in capturing for your blender project, give them, initial height (z), thickness, color and an etch_target if the layer is intended to cut into another layer (as opposed to being extruded).
At the end of the file (currently - will be changed in the future), add the layer stack and run the draw in blender command.
Then when you run the translator like below, it should work as the example does.
blender filename.blend --python layerstack-file.py
Where the layerstack-file.py file has been created following instructions. See example
-
Neaten plotting of cross section
-
Figure out way to do dopings?
-
Fix plot cross section