• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

doc/H17-Dec-2011-825488

gdsii/H17-Dec-2011-1,6401,278

scripts/H17-Dec-2011-326271

test/H17-Dec-2011-129110

GPL-3H A D30-Aug-201034.3 KiB675553

LGPL-3H A D30-Aug-20107.5 KiB166128

MakefileH A D30-Aug-2010592 3021

PKG-INFOH A D17-Dec-20111.1 KiB2623

READMEH A D23-Jan-20111.4 KiB4130

setup.pyH A D17-Dec-20111.3 KiB3935

README

1python-gdsii --- a GDSII manipulation libaray
2=============================================
3
4python-gdsii is a library that can be used to read, create, modify and save
5GDSII files. It supports both low-level record I/O and high level interface to
6GDSII libraries (databases), structures, and elements.
7
8This package also includes scripts that can be used to convert binary GDS file
9to a simple text format (gds2txt), YAML (gds2yaml), and from text fromat
10back to GDSII (txt2gds).
11
12Usage
13-----
14
15For most cases interface provided by Library class from gdsii.library should be
16enough. Here is a small example::
17
18    from gdsii.library import Library
19    from gdsii.elements import *
20
21    # read a library from a file
22    with open('file.gds', 'rb') as stream:
23        lib = Library.load(stream)
24
25    # let's move the first structure to a new library
26    new_lib = Library(5, b'NEWLIB.DB', 1e-9, 0.001)
27    struc = lib.pop(0) # libraries and structures are derived from list class
28    new_lib.append(struc)
29
30    # let's also add some elements...
31    # Note: first and last points in the boundary should be the same
32    #       this is required by GDSII spec.
33    struc.append(Boundary(45, 0, [(-100000, -100000), (-100000, 0), (0,0), (0, -100000), (-100000, -100000)]))
34
35    # Save both files with different names...
36    with open('newfile1.gds', 'wb') as stream:
37        lib.save(stream)
38
39    with open('newfile2.gds', 'wb') as stream:
40        new_lib.save(stream)
41