Retrieves PATH and TEXT records from a GDS file.
This command can be useful when setting up the ports in Lumerical products for waveguides imported from a gds file containing the associated annotations for port location, width and labels.
Syntax |
Description |
---|---|
out = gdsread("filename", "cellname", layer, record-type); |
Reads the PATH and TEXT records from the specified layer, cell in a specific gds file. |
Parameter |
Type |
Description |
---|---|---|
filename |
string |
name of the GDSII file to import. It can contain a complete path to file, or path relative to the current working directory. |
cellname |
string |
name of the cell to import from the GDSII file. |
layer |
number or string |
the layer number from the GDSII file to import. If only elements matching a certain data type are desired, this can be specified by using a string of the form: "6:2" where the desired layer is 6 and the desired data type is 2. |
record-type |
string |
Record-type can be "path" or "text". When record-type is "path", the command returns cell-array of structs, each with
When record-type is "text", it returns cell-array of structs, each with
|
Example:
The attached gdsread_ex.gds file contains a y-branch at layer 10, and three 'path' elements denoting the ports and three "text" elements for labels at layer 66.
The following script can be used to retrieve the "text" and "path" records from the gds file.
path_record = gdsread("gdsread_ex.gds","model",66, "path");
text_record = gdsread("gdsread_ex.gds","model",66, "text");
The "path_record" and "text_record" in this example are both cell arrays with three elements. Their details can be checked with the following script:
?path_record{1};
Struct with fields:
vertices
width
?path_record{1}.width;
result:
1e-07
?text_record{1};
Struct with fields:
text
x
y
?text_record{1}.text;
?text_record{2}.text;
?text_record{3}.text;
port1
port2
port3
See Also
List of commands , gdsimport, gdsopen