Hi Matthias,
We are trying to looking for a way to slice a GDS/OASIS file to several files by layers/types, and we found there is a command utility named "strmclip" in klayout directory, according to the help we try to slice a layer via the following command "strmclip -l 100/0 in.gds out.gds", however the output file still contains all layers.
The most strange result is when we try to slice different layer, the output layers not always the same, but the result is still incorrect. Could you please help to check this issue or kindly let us know a better way to parallel slicing layers in GUI mode ? Thank you so much.
Your help and response would be highly appreciated~
--
chhung
Comments
Hi chhung,
strmclip does not extract layers but performs rectangular clips based on a marker layer. The call you mentions uses 100/0 for the specification of the clip regions. This utility does not filter layers as you expected.
The strmxxx utilities do not cover much functionality yet. They are intended as development utilities and for use in test scripts for example. You can however use them as a basis for custom modifications. For example, adding layer filtering to strm2oas.cc would involve code like that:
In that sample, only two layers are read and only those two layers are written to the output. Another possibility is to use a ruby script to load the file with filtering and write the file.
Best regards,
Matthias
Thanks for your comments, I modified some code as follow and it works fine for our request.
if (argc != 5) {
printf ("Syntax: layerclip <infile> <outfile.oas> <layer> <type>\n");
return 1;
}
...
int outlayer=atoi((argv[3]));
int outtype=atoi((argv[4]));
...
db::LayerMap lmap;
db::LayerProperties lp1 (outlayer, outtype);
lmap.map (lp1, layout.insert_layer (lp1));
...
db::LoadLayoutOptions loadoptions;
loadoptions.set_layer_map(lmap, false);
map = reader.read (layout, loadoptions);
...
db::SaveLayoutOptions saveoptions;
saveoptions.set_dont_write_empty_cells(true);
writer.write (layout, stream, saveoptions);
Best Regards,
--
chhung