heitzmann / gdstk

Gdstk (GDSII Tool Kit) is a C++/Python library for creation and manipulation of GDSII and OASIS files.
https://heitzmann.github.io/gdstk/
Boost Software License 1.0
337 stars 84 forks source link

If adding a reference cell, why it is necessary to add this cell instance in lib??? #249

Closed WenjunHuang94 closed 3 months ago

WenjunHuang94 commented 4 months ago

I found that when using a reference cell, it is necessary to add the instance of the reference cell to the lib, otherwise it will fail. May I ask why this is happening? I think if a top-level cell is added to the lib, then the referenced cells contained in that top-level cell will be included together in the lib. But in reality, it's not like that. I hope you can answer, thank you!

my code: test2.zip

(1)When lib adds instances that reference cells : image

image

(2)When lib does not add an instance referencing cell : image image

heitzmann commented 4 months ago

That's the expected behavior. That was a design choice made in early development, because it is quite easy to simply replace your line with lib2.add(main, *main.dependencies()) and have the automatic behavior you desire.

nmz787-intel commented 3 months ago

I believe it has to do with some tools that have many GDS files, and can load them all as a distributed library. This is an assumption though, and may be an incorrect interpretation of behavior I see in closed-source tools.

heitzmann commented 3 months ago

That's correct, the GDSII format dose support loading cells from separate libraries. We want to allow that.