GithubHelp home page GithubHelp logo

Comments (6)

joamatab avatar joamatab commented on September 28, 2024 1

We added some examples in #2845

let us know if you find further improvements

from gdsfactory.

sebastian-goeldi avatar sebastian-goeldi commented on September 28, 2024

Fillet is implemented with (D)Polygon.round_corners https://klayout.de/doc/code/class_DPolygon.html#method57

The reason the offset is not as easy is because imo gdstk uses rather restrictive assumptions for getting the outline.
How do you size? How do you handle sharp corners? How do you handle self-intersecting polygons? And so on.

I think this would be quite hard to define a sane default behavior and generally requires individual adjustments per component.

but generally an outline (of a layer) can happen two ways:

r = gf.kdb.Region(c.shapes(layer_index)))
c.shapes(layer_index).insert(r.sized(outline_in_dbu)-r) # note r.sized vs r.size; the latter will change in place and therefore not work

if it should be non-recursive

if recursive

r = gf.kdb.Region(c.begin_shapes_rec(layer_index)))
c.shapes(layer_index).insert(r.sized(outline_in_dbu)-r)

This is the standard isotropic sizing case. Note this can cause problems with self-intersecting polygons. For safe usage a minkowski sum is most likely necessary.

from gdsfactory.

tvt173 avatar tvt173 commented on September 28, 2024

maybe it would be useful to add functions that are compatible with the old behavior though? and we can add options to customize as necessary?

from gdsfactory.

joamatab avatar joamatab commented on September 28, 2024

Yes, I apologize for the documentation not being yet as extensive as it was in version 7.

However, these operations are now much easier due to the enhanced functionality and usability of the Klayout classes.

I can some examples on how to do this

from gdsfactory.

Alessio-Zicoschi avatar Alessio-Zicoschi commented on September 28, 2024

Hello @joamatab @sebastian-goeldi, thanks for the explanations and for adding the examples to the tutorials, I found them pretty useful and they allowed me to do what I wanted. I also understand the concerns about offsetting, but it is very useful to have a simple way to handle non-problematic cases, as shown in the tutorial. Just a couple more questions:

  1. Is there a possibility to round different corners of a polygon with different radii? I could not find this functionality in (D)Polygon.round_corners, I was wondering if there is any possibility to implement it.
  2. It seems to me that booleans and grid function do not have the cell decorator anymore, thus they produce unnamed components. Am I missing something? Is this made on purpose?
    Thanks a lot in advance!

from gdsfactory.

sebastian-goeldi avatar sebastian-goeldi commented on September 28, 2024

Hello @Alessio-Zicoschi,

Klayout does support that natively, no. I onlu supports rounding for inner vs outer radii (I think defined as <180° opening vs bigger).

If you want more rounding options, I am afraid you'll either have to cut out the pieces you want manually or export and afterwards import to something like shapely.

If you absolutely want to stay in KLayout, I guess you could try to create partial paths and then round them and then stitch them back together. But that seems like a lot of work for what other packages can do better most likely

For the @cell decorated functions, the main reason to remove it is to a) remove "vessel" cells wherever possible (otherwise many pdks will have something like 2/3 vessel functions vs true leaf cells) b) give more flexibility; i.e. you now can inert a boolean directly into existing cells, meaning you don't have this parent/related cell which simply contains the result or is packed over the original.

from gdsfactory.

Related Issues (20)

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.