Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Gdstk (GDSII Tool Kit) is a C++/Python library for creation and manipulation of GDSII and OASIS files.

License

NotificationsYou must be signed in to change notification settings

WelSimLLC/gdstk

 
 

Repository files navigation

Boost Software License - Version 1.0Tests RunnerPublish DocsPyPI PackagesDownloads

Gdstk (GDSII Tool Kit) is a C++ library for creation and manipulation of GDSII and OASIS files.It is also available as a Python module meant to be a successor toGdspy.

Key features for the creation of complex CAD layouts are included:

  • Boolean operations on polygons (AND, OR, NOT, XOR) based on clipping algorithm
  • Polygon offset (inward and outward rescaling of polygons)
  • Efficient point-in-polygon solutions for large array sets

Typical applications of Gdstk are in the fields of electronic chip design, planar lightwave circuit design, and mechanical engineering.

Documentation

The complete documentation is availablehere.

The source files can be found in thedocs directory.

Installation

C++ library only

The C++ library is meant to be used by including it in your own source code.

If you prefer to install a static library, the includedCMakeLists.txt should be a good starting option (use-DCMAKE_INSTALL_PREFIX=path to control the installation path):

cmake -S. -B buildcmake --build build --target install

The library depends onzlib.

Python wrapper

The Python module can be installed via pip, Conda or compiled directly from source.It depends on:

From PyPI

Simply run the following to install the package for the current user:

pip install --user gdstk

Or download and install the available wheels manually.

Conda

Windows users are suggested to install viaConda using the availableconda-forge recipe.The recipe works on MacOS and Linux as well.

To install in a new Conda environment:

# Create a new conda environment named gdstkconda create -n gdstk -c conda-forge --strict-channel-priority# Activate the new environmentconda activate gdstk# Install gdstkconda install gdstk

To use an existing environment, make sure it is configured to prioritize the conda-forge channel:

# Configure the conda-forge channelconda config --env --add channels conda-forgeconda config --env --set channel_priority strict# Install gdstkconda install gdstk

From source

The module must be linked against zlib.The included CMakeLists.txt file can be used as a guide.

Installation from source should follow the usual method (there is no need to compile the static library beforehand):

python setup.py install

Support

Help support Gdstk development bydonating via PayPal orsponsoring me on GitHub.

Benchmarks

Thebenchmarks directory contains a few tests to compare the performance gain of the Python interface versus Gdspy.They are only for reference; the real improvement is heavily dependent on the type of layout and features used.If maximal performance is important, the library should be used directly from C++, without the Python interface.

Timing results were obtained with Python 3.11 on an Intel Core i7-9750H @ 2.60 GHzThey represent the best average time to run each function out of 16 sets of 8 runs each.

BenchmarkGdspy 1.6.13Gdstk 0.9.41Gain
10k_rectangles80.2 ms4.87 ms16.5
1k_circles312 ms239 ms1.3
boolean-offset187 μs44.7 μs4.19
bounding_box36.7 ms170 μs216
curves1.52 ms30.9 μs49.3
flatten465 μs8.17 μs56.9
flexpath2.88 ms16.1 μs178
flexpath-param2.8 ms585 μs4.78
fracture929 μs616 μs1.51
inside161 μs33 μs4.88
read_gds2.68 ms94 μs28.5
read_rawcells363 μs52.4 μs6.94
robustpath171 μs8.68 μs19.7

Memory usage per object for 100000 objects:

ObjectGdspy 1.6.13Gdstk 0.9.41Reduction
Rectangle601 B232 B61%
Circle (r = 10)1.68 kB1.27 kB24%
FlexPath segment1.48 kB439 B71%
FlexPath arc2.26 kB1.49 kB34%
RobustPath segment2.89 kB920 B69%
RobustPath arc2.66 kB920 B66%
Label407 B215 B47%
Reference160 B179 B-12%
Reference (array)189 B181 B4%
Cell430 B229 B47%

About

Gdstk (GDSII Tool Kit) is a C++/Python library for creation and manipulation of GDSII and OASIS files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++89.7%
  • Python9.2%
  • Other1.1%

[8]ページ先頭

©2009-2025 Movatter.jp