This function adds a polygon element to a GDSII file stream. Polygons are also known as boundary elements in GDS terminology. This command can be called only if a cell has been created.The maximum number of vertices that can be added in a single polygon is 8190 due to limitations in the maximum number of vertices in a gdsii boundary. You can only use this command if a gds cell has already been created, for example, using gdsbegincell.
For complex geometries requiring more vertices, use gdsaddstencil.
|
Syntax |
Description |
|---|---|
|
gdsaddpoly(f, layer, [vertices]) |
Adds a polygon element on a layer with vertices. |
|
Parameter |
Type |
Description |
|---|---|---|
|
f |
string |
A file handle that was previously opened with gdsopen. |
|
layer |
string or number |
String: a string of the form "layer:datatype" (for example "6:2") can be used to define the layer number and datatype for this structure from the GDSII file to import. Layer and datatype are integers. Number: defines the layer number and sets the datatype to be zero. |
|
vertices |
matrix |
Vertices of the polygon, in a Nx2 matrix where the first column represents x and the second column represents y, e.g., [x1,y1; x2,y2;...xn,yn]. The values are in meters. The first and last values should not be the same, the polygon will be automatically closed. |
Example
An example of script code is available on the gdsopen page.
See Also
gdsopen, gdsclose, gdsbegincell, gdsendcell, gdsaddcircle, gdsaddref, gdsimport, gdsaddpath, gdsaddtext, gdsaddstencil