gdsii format specification
GDSII Stream format is the standard file format for transfering/archiving 2D graphical design data. It contains a hiearchy of structures, each structure containing elements (boundary/polygon, path/polyline, text,box, structure references, structure array references). The elements are situated on layers. It is a binary format that is platform independent, because it uses internally defined formats for its data types. While reading GDSII files, the GDSII internal data types (like reals, integers etc.) need to be converted to the platform/CAE package datatypes that are used.The GDSII format is a sequential list of records, each record contains a header to tell what information is in the record.The order of the record needs to be according to the GDSII BNF, because of this strict organization it is relativly easy to parse. The maximum number of vertixes is officially only 200 x,y pairs, but many packages can read up to the absolute maximum of 64k/2=32k, simple because this is the maximum record lenght that can be specified (two bytes).The format is hard to read, since it is binary, for that viewers are available to view (boolean) the contents as ASCII. Also an ASCII format has been developed (KEY format) which is more than just a text representation. It is possible to convert GDSIIformat to KEYformat and back. KEYformat has extended the basic primitives to contain cicrles, arcs, polygons/polylines with arc segments.