If the gdsfile class does not fully support your needs, you can also perform direct processing on the file cache. The relevant commands can be found in the Mask File Cache dialog box (Mask menu).
A file cache can be created directly from a design with the ‘mask::exportFileCache’ function.
You can perform Boolean operations between mask layers, or apply operations such as Heal (i.e., remove overlapping areas and merge touching polygons) or Snap on one layer. The operations will create a new file cache containing the results. This means that when you have performed the operation, the original file cache is untouched. To replace the original file cache or to remove all layers included in the Boolean operation except the result:
1. Manually remove the layers using ‘mask::cacheDeleteLayer’
2. Merge the results back into the original file cashe using ‘mask::cacheAppend’
3. Delete the result of the Boolean operation using ‘mask::clearFile’
Important: All single and multi-layer operations that produce a new file cache require you to name the new cache (the parameter ‘Alias’). For performance reasons, OptoDesigner assumes that if a cache with that name already exists, it has the correct data and will not be recalculated. Therefore, it is imperative to either delete intermediate results or to make sure that each one is unique – unless you know that the data will still be correct later in the script, ready for re-use.
Under 'Mask File Cache / Boolean mask operations,' you’ll find all single- and multi-layer layer processing functions. Each of these can take up to five input mask file caches (arguments ‘Mask’ and ‘Merge’), from each of which a subset of layers can be chosen, with one output layer (argument 'Layer').
All selected layers from all input file caches are merged together before the operation takes place. The multi-layer operations always need an output layer to which the results are written. The single-layer operations (heal, snap, fracture, etc), however, also have the option of not specifying the output layer. This will automatically perform the operation on the ensemble of layers, producing the output in all the same layers as were in the input. If you do specify an output layer, the functions first merge all polygons from all specified layers from all inputs together before performing the operation.
Some more generic tips and tricks:
- You can place a generated file cache into your design using either ml::Maskfile_SingleLayer or by creating a gdsfile instance, setting its file cache to the created one, and calling ‘Place’
- Some operations (e.g., ‘mask::LayerSnap’) require the input file cache to have undergone a previous Boolean operation, such as ‘mask::LayerHeal’, to function properly
- To avoid stitching errors, always perform a ‘mask::LayerSnap’ operation on all layers of a design before export. This ensures that vertices on one layer that should be on a line of a polygon on another layer actually are (will add a vertex to the line).