Hi,
First, thanks for this program : I can *at last* work with GDS under my favorite OS. ;-)
I may have a beginner question, but I'm trying to generate a GDS file of donuts (for lithographic dose test purpose) using a ruby script. I'm new to ruby, but here is my script :
http://darckense.online.fr/data/create_donnuts_v1.rb
I launch it using : klayout -r create_donnuts_v1.rb
and when I want to save the file, I have this error message in the console :
[darckense@rose ruby]$ klayout -r create_donnuts_v1.rb
(12042) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-darckense/ksycoca4"
kfilemodule(12042)/kdecore (services) KMimeTypeFactory::parseMagic: Now parsing "/usr/local/share/mime/magic"
kfilemodule(12042)/kdecore (services) KMimeTypeFactory::parseMagic: Now parsing "/usr/share/mime/magic"
kfilemodule(12042)/kdecore (services) KMimeTypeFactory::parseMagic: Now parsing "/home/darckense/.local/share/mime/magic"
The saved GDS file is empty. It could be downloaded here :
http://darckense.online.fr/data/donnuts.gds
I'm certainly doing something wrong in the way I generate GDS file, but I cannot figure it out.
Does anyone have an idea ?
Thanks.
Edit: Sorry, I uploaed the wrong script... now, there is the good one. Thanks again. :)
Comments
Hi izard,
Thanks for providing the script - debugging is much easier with a real example :-)
What is basically missing in your script is the assignment of the layer and datatype when the layer is created. Without that information, KLayout doesn't know where to save the layer and simply omits it. I admit that is a somewhat disrespectful, but the idea behind that is to allow temporary layers which are not saved.
To fix that part of the problem you simply need to tell the LayerInfo object the layer and datatype. Both numbers specify which GDS layer to use. In order to supply the layer, you could add two arguments to the "gen_layer" function.
In addition, you will notice, that the layers are shown as "%..." in the layer list. That is because the layers where specified by layer index in the LayerPropertiesNode. I should explain the idea behind the layer list: it is basically a set of views to the layers rather that kind of pointers. If a certain GDS layer is to be shown, the view needs to know the layer and datatype of the layer to show. This way the view selects the layer by layer and datatype rather than by index (that is basically what the % says). Basically that does not make a big difference, but usually people prefer to think of GDS layers and datatypes rather than indexes.
The modified "gen_layer" function is here:
Provided your intention is to assign different layers, you also have to modify the call of that function:
This will assign GDS layers 1 to 21 to the different shapes.
Hopefully that explanation makes some things clearer.
Best regards,
Matthias
Thank you so much for your reactivity.
Yes, your explanations are perfectly clear about the layers. Now everything works perfectly.
Thank you again,
Best Regards,