Coder Social home page Coder Social logo

Comments (4)

HelgeGehring avatar HelgeGehring commented on July 4, 2024

Thanks for the bug report!

I further simplified the example, the problem is already visible without applying difference() (as lines into the waveguide):

from gdshelpers.geometry.chip import Cell
from gdshelpers.parts.spiral import Spiral

cell = Cell('cell_difference')
cell.add_to_layer(1, Spiral(origin=(0, 0), angle=0, width=0.45, num=1, gap=3, inner_gap=30))
cell.save('issue_23.gds')

Already changes like angle=1 make it dissapear, therefore, it seems related to rounding errors. It seems to appear when subsequent segments of the waveguides are not exactly overlaping at the port.
Furthermore, the two lines seem to be caused by different reasons. One I could fix in 2c69d33 by adding the path_derivative to add_straight_segment.

The second line is exactly at the port between add_parameterized_path and the straight part of add_route_single_circle_to_port, but I didn't find yet the exact origin of that line.

As a workaround, your example can be fixed by device = geometric_union([spiral]).buffer(1e-12). I'd guess something similar is done in the boolean function of gdspy.

from gdshelpers.

HoneyGump avatar HoneyGump commented on July 4, 2024

Thanks for gdshelpers and your share again. This package is far more powerful than the document says.

Just now, I found this function gdshelpers.helpers.positive_resist.convert_to_positive_resist() did exactly what I wanted. My issue had been noted and fixed in the codes of the above function, which is the same as what you told me above.

# Sometimes those polygons do not touch correctly and have micro gaps due to
# floating point precision. We work around this by inflating the object a tiny bit.
fixed_union = union.buffer(np.finfo(np.float32).eps, resolution=0)

This function is very useful and convenient, and I recommend you give an example code in the tutorial, title could be just like from negative layout to postive layout.

one negligible request

It could be better, If this function can operate gds format file directly and correctly, not only Parts object. I know this is very difficult to obtain the outline of layout for buffer and difference. Some other packages achieve it by a bigger rectangle region 'minus' the layout directly. The layout from this method could cause huge waste of money and time.

At the end, thanks your immediate response.

from gdshelpers.

HelgeGehring avatar HelgeGehring commented on July 4, 2024

Nice to hear that you like the package!
Okay, I forgot that it's already handled there, I'd guess then we can consider this problem as solved.
Yeah, the documentation is always lagging a bit behind the source code :/ @ThomasGrottke could you add something about gdshelpers.helpers.positive_resist.convert_to_positive_resist?

How exactly do you mean it? Do you want to read in a gds-file (There's already a not yet documented part for that) or do you mean to take a rectangle instead of the buffer to avoid some calculations? In the latter case, I'd guess ebeam-time is more expensive than cpu-time and therefore, I'd prefer the current solution.

from gdshelpers.

HoneyGump avatar HoneyGump commented on July 4, 2024

I'm sorry that the above requset comfused you. I want to read in a gds-file and and convert it to positve layout for postive resist.

from gdshelpers.

Related Issues (10)

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.