GithubHelp home page GithubHelp logo

Comments (2)

heitzmann avatar heitzmann commented on May 23, 2024

Your polygon creation is wrong. If you print target_layer you'll see that the output is not what you're showing. It should be like this:

In [1]: import gdspy

In [2]: top_cell = gdspy.Cell("CELL").add(gdspy.Rectangle((15, 15), (45, 45), layer=108, datatype=250))

In [3]: all_pol = top_cell.get_polygons(by_spec=True)

In [4]: target_layer = all_pol[108, 250]

In [5]: print(target_layer)
[array([[15, 15],
       [15, 45],
       [45, 45],
       [45, 15]])]

You see: all_pol is a dictionary of lists of polygon vertices, so, if you want to create a new polygon, you have to select one of the list items:

In [6]: tmp_target_layer = gdspy.Polygon(target_layer[0])

In [7]: out = tmp_target_layer.get_bounding_box()

In [8]: print(out)
[[15 15]
 [45 45]]

from gdspy.

tinaa160 avatar tinaa160 commented on May 23, 2024

Hi heitzmann,
Yes your are correct!
It works after I use the function correctly.
Thanks a lot

from gdspy.

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.