GithubHelp home page GithubHelp logo

rs19hack / gdstk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heitzmann/gdstk

0.0 0.0 0.0 6.93 MB

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

License: Boost Software License 1.0

CMake 0.21% C++ 94.24% Python 5.47% C 0.08%

gdstk's Introduction

GDSTK README

Boost Software License - Version 1.0 Tests Runner Publish Docs Downloads

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

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 available here.

The source files can be found in the docs directory.

Instalation

C++ library only

A static library can be installed with cmake (use -DCMAKE_INSTALL_PREFIX=path to control the installation path):

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

The library depends only on LAPACK.

Conda

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

From source

The C++ library is meant to be used straight from source. The only requirement is that it must be linked against LAPACK. The included CMakeLists.txt file can be used as a guide.

Installation from source should follow the usual method:

python setup.py install

Dependencies for the Python wrapper

Support

Help support Gdstk development by donating via PayPal

Benchmarks

The benchmarks 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.8 on an Intel Core i7-3820 with 8 cores and 64 GB of RAM. They represent the best average time to run each function out of 16 sets of 8 runs each.

Benchmark Gdspy 1.6.1 Gdstk 0.2.0 Gain
10k_rectangles 222 ms 6.67 ms 33.3
1k_circles 572 ms 363 ms 1.57
boolean-offset 419 μs 60.7 μs 6.91
bounding_box 634 μs 11.2 μs 56.8
curves 3.02 ms 65.4 μs 46.1
flatten 1.01 ms 12.6 μs 79.8
flexpath 5.59 ms 25.2 μs 222
flexpath-param 7.34 ms 1.45 ms 5.08
fracture 1.71 ms 911 μs 1.88
inside 41.2 μs 11.6 μs 3.55
read_gds 7.03 ms 119 μs 59
read_rawcells 609 μs 58.5 μs 10.4
robustpath 386 μs 15.9 μs 24.3

Memory usage per object for 100.000 objects using Python 3.8:

Object Gdspy 1.6.1 Gdstk 0.2.0 Reduction
Rectangle 594 B 233 B 61%
Circle (r = 10) 1.67 kB 1.27 kB 24%
FlexPath segment 1.42 kB 441 B 70%
FlexPath arc 2.23 kB 1.49 kB 33%
RobustPath segment 2.78 kB 922 B 68%
RobustPath arc 2.58 kB 919 B 65%
Label 398 B 218 B 45%
Reference 159 B 180 B -13%
Reference (array) 191 B 182 B 5%
Cell 435 B 211 B 52%

gdstk's People

Contributors

heitzmann avatar willsalmanj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.