Hello Matthias,
This is a very useful program. I would like to use it to perform boolean operations and some resizing but am having newbie difficulties. 'Tools : Processing Scripts' is installed - when I try to run an example, a dialog titled "Marker Database Browser" appears. It is requesting a database file. I don't know what file it needs or why. I just want to perform some modifications eg: input("m2 14/0").size(1) where 'm2 14' is the name of a layer.
Thanks,
Dean
Comments
Hi Dean,
the marker browser is not requesting something - it is just shown in case you were sending your output to a marker database. It is somewhat confusing that it will pop up even if there is no database created. I have updated the layer_proc.rbm script so the marker browser only pops up if there is a marker database created.
Your script is lacking the output statements, that's why nothing is generated. You have basically two choices:
If you want to send the results to a marker database, your code looks like this:
If you want to send the results to a different layer (i.e. 15/0), use
One word regarding the layer specification: you cannot use "m2 14/0". You can specify a named layer, i.e. for DXF or CIF using a spec like "m2". If you want to specify a layer for GDS, you'll have to use "layer/datatype" (i.e. "14/0"). You can use both specifications like "m2 (14/0)" (note the brackets). In that case, it will take "m2" for DXF or CIF and 14/0 for GDS.
Regards,
Matthias
I have some relatively complicated logical operations that I would like to implement in KLayout.
The objective is to generate a layer in a new layout based upon something like the following:
((((((((((((NN NOT GP) AND OL) AND NW) SIZING 0.15) AND ((NOT NW) SIZING 0.25)) OR (NN NOT GP)) SIZING 0.20) SIZING -0.20) NOT ((((((PN NOT GP) AND OL)NOT NW)SIZING 0.1)) SIZING -0.12)SIZING 0.12) OR (NN AND GP))
Is there a method to translate something this ugly into KLayout statements?
Thanks,
Dean
Hi Dean,
that expression is ugly, right :-)
My suggestion is to decompose it into binary expressions:
(I am nor sure about operator precedence in your example - please check). "NN NOT GP" appears three times and now it's computed once - hence that is also an optimization.
Then the translation is straightforward (AND -> *, NOT -> -, OR -> +, SIZING -> .size) except the unary "NOT" for l5. There is not "inversion", but you can subtract the layer from the bounding box:
I'd suggest to regroup the expressions and use nice names instead of lx, but that depends on what is meant. I assume it has something to do with well and bulk contacts, but that is just a guess ...
Matthias