Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed LAYERNAME string into a record #171

Open
nmz787-intel opened this issue Apr 25, 2023 · 3 comments
Open

Embed LAYERNAME string into a record #171

nmz787-intel opened this issue Apr 25, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@nmz787-intel
Copy link

I have seldom obtained 'fancy' OASIS files from vendor tools, which KLayout and vendor GUIs can load and display the layernames without an associated layerproperties (layer, datatype)->string mapping file. It doesn't seem like this is possible from my usage of the API, but I wonder if I'm missing something, or if you have considered the effort (and ROI) to enable this?

Thanks! -nmz

@tkueda
Copy link

tkueda commented Apr 25, 2023

Hi, I'm also trying to do the same thing right now and checking the code. I'm very new to OASIS but I became to understand we need to use LAYERNAME_DATA == 11 or LAYERNAME_TEXT == 12. Maybe there is no interface to add them into an OASIS file from gdstk currently. I also found the records are ignored in reading OASIS files. It would be greatly appreciated if gdstk has the feature because we don't have to attach the layer names with another tool.

gdstk/src/library.cpp

Lines 1652 to 1663 in facd76e

case OasisRecord::LAYERNAME_DATA:
case OasisRecord::LAYERNAME_TEXT:
// Unused record
free_allocation(oasis_read_string(in, false, len));
for (uint32_t i = 2; i > 0; i--) {
uint64_t type = oasis_read_unsigned_integer(in);
if (type > 0) {
if (type == 4) oasis_read_unsigned_integer(in);
oasis_read_unsigned_integer(in);
}
}
break;

@heitzmann heitzmann added the enhancement New feature or request label Apr 29, 2023
@heitzmann
Copy link
Owner

This can be added in a future release. The main issue here would be how to store and interface with this data, since it doesn't map directly to any existing data structures.

@nmz787-intel
Copy link
Author

I'm reviewing this DRAFT spec of OASIS format:
https://web.archive.org/web/20160304104134/http://www.wrcad.com/oasis/oasis-3626-042303-draft.pdf

and SECTION 19 shows:
image

which makes me think that we could read in all the LAYERNAME record (or is it records) data into a lookup-table, then apply the strings to each corresponding polygon. During OASIS write operation, I think you'd first review all the polygons to again build the lookup-table, then write the LAYERNAME record (or is it records?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants