Giter Site home page Giter Site logo

gdslatexconverter's People

Contributors

aypac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gdslatexconverter's Issues

Introduce a nice default color scheme

Right now a layer is plotted as just a gray (black!20) outline if no style is specified.

Maybe provide a few nice default schemes to choose from. Maybe solve this together with #6 .

Run proper tests (in the Travis CI)

Right now, the tests are passing, although the latex is not installed. Prepare some proper tests, either with running the latex or by just checking the output.

Gdspy 1.4

The converter does not work with gdspy version 1.4. Switching back to version 1.3.2 resolved the issue.

Feature: make layers reusable

Make it possible to plot the same layer twice.

This should be pretty easy by changing the last few lines of the parse-function. We would have to allow for the layer_order to be a dict then that relates a layer name to a layer id. layer_drawopt and layer_drawcolor need to use the name as a key then.

Latex main memory not sufficient

If using larger designs you might run into the [...] TeX capacity exceeded, sorry [main memory size=xxx]. error.

Quickfix:

Find the latex config file kpsewhich -a texmf.cnf and modify the memory size by including/changing the value of, e.g. : main_memory = 3000000 (see comments in texmf.cnf file for more details.) Then run the following command as root to recreate the format files: fmtutil-sys --all

(Taken from: https://tex.stackexchange.com/questions/7953/how-to-expand-texs-main-memory-size-pgfplots-memory-overload )

Long-Term fix:
This can theoretically prevented by rendering each layer individually, using:

\usetikzlibrary{external} 
\tikzexternalize`

and use a separate tikz-environment. I have not solved how to make the layers overlap perfectly then (especially taking into account, that they might have different sizes), but this should be solvable.

Add proper getter/setter methods

i.e. make fields scale, layer_drawcolor, layer_drawopt, and layer_order properly settable and delete _latex field to enforce new parsing.

Implement detection of circles

Find a way to detect simple circles and replace those polygons with the according TikZ command.

If the gds is created directly by gdspy commands one can detect the use of the Round class and use the original creation parameters ( see heitzmann/gdspy#51 ).

from the gdspy docs:

Examples
--------
>>> circle = gdspy.Round((30, 5), 8)
>>> ring = gdspy.Round((50, 5), 8, inner_radius=5)
>>> pie_slice = gdspy.Round((30, 25), 8, initial_angle=0,
...                             final_angle=-5.0*numpy.pi/6.0)
>>> arc = gdspy.Round((50, 25), 8, inner_radius=5,
...                       initial_angle=-5.0*numpy.pi/6.0,
...                       final_angle=0)

(From discussions with Marc)

If loaded from a file, one can test each polygon if it is a circle, arc, pie slice, ring or ring slice:

For each polygon in a polygon set (with 2 or less polygons):
  go over each polygon and calculate the distance between neighbouring points
  If they are all equal (enough):
    it is a circle
  elif they are all equal (enough), except for one:
    it is an arc

Some more thoughts:

  • You can do 250.000 distances per second on my pc for example
  • I would put this on a flag anyway and if it causes trouble, you can just switch it off
  • As soon as two distances are not the same, you can stop calculating distances for that array (So unless a polygon starts with something resembling a circle, it will probably only check the first few points)
  • how about tolerances? Depends on the amount of digits that is written away. But quite small.
  • set a flag with the minimum amount of points in an array to start doing this process, as a square is also a regular polygon.

Improve tex-naming

Each cells name is converted to be Tex-compatible. Right now, all non '\w' characters are removed and all spaced replaced by and underscore. To prevent duplicate names, we include a hash of the original name at the end of each name.

  • This hash is a quick hack and can be improved
  • The replacing rules could be a bit more clever
  • This does not entirely prevent possible duplicate names

Add version number to latex output

Find a good way to access the version number from the main file. It is important to only keep one central record of the version number.

New gdspy version

A new gdspy has been released. Does it make sense to switch to that new version?

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.