[Artwork] / [QisMLib] / [Programmer's Corner]
List of commands supported by QisMScript
QisMScript Commands (with QisMLib v3.24+)qismscript64.exe (Console program) commandscommandssystemexitsleepaskifBuilt-in commands script.print_varsscript.requiredscript.setscript.setifscript.substrscript.tokenizescript.ifscript.branchscript.procedurescript.end_procedurescript.callscript.foreachscript.new_window_setscript.delete_window_setscript.window_set_to_filescript.window_set_to_stringQisMLib commandslib.load_filelib.load_gds_with_mmapslib.unload_fileQisMBStore commandsstore.write_as_polysstore.write_as_imagestore.print_infoQisMFile commandsfile.print_reportfile.get_default_cellfile.print_cellsfile.print_top_cellsfile.print_child_cellsfile.get_cell_extentsfile.print_layersfile.save_memory_mapsfile.print_cell_tree file.create_exploderfile.destroy_exploderQisMExplCounter commandsexplcounter.break_window_by_vertnumexplcounter.break_window_by_crossingexplcounter.delete_windowsQisMWindowProbe commandsprobe.windowQisMExploder commandsexploder.set_viewexploder.get_boundariesexploder.delete_storeexploder.write_texts_to_fileexploder.write_srefs_to_fileexploder.write_arefs_to_fileQisMDraw commandsdraw.windowQisMBool Commandsbool.create_instancebool.destroy_instancebool.create_settingsbool.destroy_settingsboolsettings.setboolinst.unionboolinst.binaryboolinst.delete_storeQisMCADWriter Commandscadwriter.open cadwriter.begin_cellcadwriter.boxcadwriter.box_setcadwriter.bstore cadwriter.boundarycadwriter.pathcadwriter.circlecadwriter.referencecadwriter.end_cellcadwriter.closeQisMRTCR commandsrtcr.create_optsrtcr.destroy_optsrtcr.create_correctionsrtcr.destroy_correctionsrtcr.create_annotationsrtcrannotations.addrtcr.destroy_annotationsrtcr.setup_jobrtcr.end_jobrtcrjob.create_rasterizerrtcrjob.destoy_rasterizerrtcrjob.get_raster_imageQisMLayerSynth commandslsynth.new_synthesizerlsynth.delete_synthesizerlsynth.synthesize_layerslsynth.delete_storeQisMClipExtract commandsclip.extract_polygonsclip.extract_imagesclip.extract_lsynthQisMRaster Commandsraster.create_paramsraster.destroy_paramsraster.create_rasterizerraster.destroy_rasterizerraster.windowraster.synthesizedraster.overlay_polysraster.compute_tile_szraster.compute_buf_szraster.get_dpiraster.get_pixelsizeraster.queue_mtraster.window_paint_scratchraster.px_windowraster.create_pns_v2_specraster.destroy_pns_v2_specraster.window_pns_v2raster.large_disk_imageQisMCorrx Commandscorrx.create_optscorrx.destroy_optscorrx.create_corrx_objcorrx.destroy_corrx_objcorrx.scale_viewcorrx.rotate_viewcorrx.shear_viewcorrx.mirror_viewcorrxobj.print_corrected_extentscorrxobj.correct_viewcorrxobj.correct_polyscorrxobj.rasterize_windowcorrxobj.delete_storecorrxobj.correct_window_extentsQisMGerber Commandsgerber.loadgerber.unloadgerberfile.save_gdsQisMHextract Commandshextract.create_extractorhextract.destroy_extractorhextract.create_optshextract.destroy_optshextract.create_regionshextractregions.addhextract.destroy_regionshextractor.extract_to_filehextractor.extract_to_writerhextract.create_dbhextract.destroy_dbhextractfile.save_ashextract.select_dbuQisMBoolFiles commandstwofiles.xorQisMSemiFlat Commandssemiflat.new_optssemiflat.delete_optssemiflat.create_dbsemiflat.destroy_dbsemiflatfile.save_assemiflat.create_extractorsemiflat.destroy_extractorsfextractor.extract_to_file sfextractor.extract_to_writerQisMPolyPatterns Commandspatterns.create_from_viewpatterns.create_from_bstorepatterns.destroypatterns.write_to_fileQisMGbrPS commandsgbrpsfile.print_metagbrpsfile.save_gdsgbrps.unloadgbrps.load
commands [search_string]
search_string
to filter that list to the ones that contain the specified stringsystem program [args]*
exit
sleep interval={sleep_time_seconds}
{sleep_time_seconds}
askif key={var_name} [msg={message_for_the_user}]
{var_name}
at the command prompt ONLY IF the variable has not been assigned a valuemsg
if specified, uses the specified string in the prompt to the userscript.print_vars
script.required {var_id}+
{var_id}
represents name of one or more variables of type #
(string variables) that can be referenced elsewhere in the script as ((var_id))
script.set {{key}={value}}+
(({key}))
script.setif {{key}={value}}+
(({key}))
xxxxxxxxxx
script.substr
in={string}
&out={var_name}
old={sub_string_to_replace}
new={replacement_sub_string}
{sub_string_to_replace}
in an input string with {replacement_string}
{var_name}
and can be accessed in the subsequent command using (({var_name}))
xxxxxxxxxx
script.tokenize
in={string}
&out={var_name}
old={string_of_separators}
new={char_separator}
{string_of_separators}
and compose a new string where those tokens are concatenated using a new separator {char_separator}
{var_name}
and can be accessed in the subsequent command using (({var_name}))
script.if {condition} {cmd} {args}*
Execute a command ONLY IF {condition}
evaluated to TRUE
{condition}
can be one of the following:
{key}
: TRUE if a string variable called {key}
is defined and not empty!{key}
: TRUE if a string variable called {key}
is NOT defined or is empty{key}=={value}
: TRUE if a string variable called {key}
has been set to {value}
{key}!={value}
: TRUE if a string variable called {key}
does not exist or has a value other than {value}
{key}~={value}
: TRUE if a string variable called {key}
CONTAINS the string {value}
{cmd} {args}*
is the command to be executed if the condition is TRUE along with it's arguments
script.branch script={script_file_path} [{key}={value}]*
{script_file_path}
is the path of another script file containing commands representing the branch{key}={value}
are optional arguments that can be passed on to the branching script and are valid only for the duration of the branch executionexit
) are ignoredscript.procedure {procedure_name}
{procedure_name}
script.procedure
MUST have a matching script.end_procedure
script.call
or script.foreach
script.end_procedure
script.call {procedure_name}
xxxxxxxxxx
script.foreach
&token={var_name}
list={list_of_tokens}
{branch={script_file_path} | call={procedure_name}}
[sep={separator}]
[{key}={value}]*
{list_of_tokens}
is a string containing one or more tokens separated by separators{separator}
if used is a list of characters to be used as separators in the list. Default separator is ,
(comma){var_name}
represents the name of a string variable that will temporarily hold a token from the specified list. The value of this token will change as this command iterates through the specified list{script_file_path}
is the path of another script file containing commands representing the branch to be executed for each token in the list (as if it's a function){procedure_name}
is name of a procedure that has already been defined at this point in the execution{key}={value}
are optional arguments that can be passed on to the branching script and are valid only for the duration of the script.foreach
commandexit
) are ignoredxxxxxxxxxx
script.new_window_set
&set={set_id}
llur={name}:{lx},{ly},{ux},{uy}
llwh={name}:{lx},{ly},{width},{height}
cwh={name}:{cx},{cy},{width},{height}
@llur={name}:{txt_file}
@whll={name}:{txt_file}
@whc={name}:{txt_file}
tilerc={name}:{roi_lx},{roi_ly},{roi_ux},{roi_uy}:{cols},{rows}[:{i},{j}]*
tilewh={name}:{roi_lx},{roi_ly},{roi_ux},{roi_uy}:{width},{height}[:{i},{j}]*
cxy={name}:{width},{height}[:{cx},{cy}]+
rand={name}:{roi_lx},{roi_ly},{roi_ux},{roi_uy}:{width},{height}:{count}
Create a new set of rectangular windows
Multiple arguments can be used for building a cumulative set
All co-ordinates and dimensions are in file-units (e.g um, mm, inch) associated with the CAD source
{set_id}
represents name of the variable of type QisMBoxSet*
associated with the newly created set
The QisMBoxSet
C++ interface can be found in qismbase.h
{name} is a string identifier associated with a window which may be used to determine the name of the output file corresponding to that window
{lx}, {ly}, {ux}, {uy}
represent lower-left and upper-right co-ordinates
{width}, {height}
represent the window size
{cx}, {cy}
represents co-ordinates of the window center
{txt_file}
is the path to an existing text file which contains the following :-
@llur=
, each line contains {lx},{ly},{ux},{uy}
representing one window@llwh=
, the first line contains {width},{height}
representing the window size and each subsequent lines contains {lx},{ly}
representing the position of the window's lower-left corner@cwh=
, the first line contains {width},{height}
representing the window size and each subsequent lines contains {cx},{cy}
representing the position of the window's center For generating tiles, {roi_lx},{roi_ly},{roi_ux},{roi_uy}
represents the region of interest (ROI) to be tiled
{cols},{rows}
represents the number of tiles along X and Y respectively
{width}, {height}
represent the tile size
{i},{j}
is optional represents the position of one or more tiles to be added (1 <= i <= {cols} and 1 <= j <= {rows}). If used, all other tiles not in this list will be dropped
For the random tile generator rand=
, {count}
represents the number of tiles to be generated at random locations within the ROI
Every set created using this command MUST be eventually destroyed by the script using script.delete_window_set
to avoid resource leaks
script.delete_window_set $set={set_id}
script.new_window_set
{set_id}
represents name of the variable of type QisMBoxSet*
associated with set to be destroyedscript.window_set_to_file $set={set_id} path={txt_file_path}
{set_id}
represents name of the variable of type QisMBoxSet*
associated with set to be used{txt_file_path}
is the path of a TEXT file to be written where each line of the text file represents one window from the set in the format {minx},{miny},{maxx},{maxy}
xxxxxxxxxx
script.window_set_to_string
$set={set_id}
&out={var_name}
sep={char}
{set_id}
represents name of the variable of type QisMBoxSet*
associated with set to be used{var_name}
and can be accessed in the subsequent command using (({var_name}))
{minx},{miny},{maxx},{maxy}[{char}{minx},{miny},{maxx},{maxy}]*
where {char}
is the new separator of windowsSee qismlib.h for corresponding API
xxxxxxxxxx
/* C++ code to initialize and close QisMLib ONCE in the duration of the program */
​
/*------------------------------------------------------------------------------
Initialize the QisMLib once at the start of the application
* `qism_dl_path_` is the path to qismlib64.dll (libqism64.so on linux)
* `cfg_path_` is the path to the config. file (default: qismlib.cfg in the same
directory as qismlib dll)
* `log_path_` is the path of the log file (default: empty/null)
* on success, returns the handle to the QisMLib api
------------------------------------------------------------------------------*/
static QisMLib* qm_lib_initialize(
const char* qism_dl_path_, const char* cfg_path_ = 0
)
{
assert(qism_dl_path_ && qism_dl_path_[0]);
​
fprintf(
stdout, "\n> initializing qismlib (%s).. (%s %s : %d)\n", qism_dl_path_,
__FUNCTION__, __FILE__, __LINE__
);
vector<const char*> argt;
vector<void*> argv;
//if config. path specified
if(cfg_path_ && cfg_path_[0]) {
argt.resize(argt.size() + 1);
argv.resize(argv.size() + 1);
argt.back() = QISM_ARG_USECFG;
argv.back() = (void*)(cfg_path_);
}
​
//print QisMLib version
fprintf(stderr, "\n%s\n", ::QisMLib_get_lib_info());
​
//initialize QisMLib
char emsg[1024]; int ecode = 0;
QisMLib* qismlib = (QisMLib*)(QisMLib_initialize_once(
qism_dl_path_, 0, argt.size(), argt.size() ? (&argt[0]) : 0,
argv.size() ? (&argv[0]) : 0, emsg, sizeof(emsg), &ecode
));
if(!qismlib) {
fprintf(
stderr, "error: failed to initialize qismlib, [%d] %s\n", ecode, emsg
);
} else {
//print extension report
fprintf(stdout, "\n%s\n", qismlib->Get_extension_report());
}
​
return qismlib;
}
​
/*------------------------------------------------------------------------------
Close QisMLib once at the end of the application
* `qismlib_` is the handle to the QisMLib api
------------------------------------------------------------------------------*/
static void qm_lib_close(
QisMLib* qismlib_
)
{
fprintf(
stdout, "\n> closing qismlib.. (%s %s : %d)\n", __FUNCTION__,
__FILE__, __LINE__
);
QisMLib_close_once(qismlib_);
}
xxxxxxxxxx
lib.load_file
&filedb={filedb_id}
input={input_file_path}
[layermap={layer_map_str}]
[notext] [diskload] [emptyrefs]
Create a database from a GDSII/OASIS/DBLOAD file
Equivalent to QisMLib::Load_file
in qismlib.h
{filedb_id}
represents name of a variable of type QisMFile*
associated with the newly created database
{input_file_path}
is the path of a valid GDSII/OASIS/DBLOAD file
{layer_map_str}
if used, is a string specifying the layer mapping. e.g. ALL-NULL,1-100,2:2-200:2,3-300:0
1:*
to 100:*
2:2
to 200:2
3:*
to 300:0
(combine all datatypes of 3)notext
if used, drops all TEXT items
diskload
if used, retains the data section of the database on disk to reduce the memory footprint at the cost of operational speed
emptyrefs
if used, loads references to empty cells
Every database created using this command MUST be eventually unloaded using lib.unload_file to avoid resource leaks
This command will define two new string variables {filedb_id}.grid
and {filedb_id}.units
corresponding to the file grid (in meters) and units (in meters). They can be referenced elsewhere in the script using (({filedb_id}.grid))
and (({filedb_id}.units))
respectively. These will only be available while the database is alive (until lib.unload_file is called)
xxxxxxxxxx
//C++ equivalent of lib.load_file
using namespace NsQisMLib;
​
/*------------------------------------------------------------------------------
Callback class to receive notifications from QisMLib during file loading
(see qismbase.h for full API reference)
------------------------------------------------------------------------------*/
class QmLibNotify: public QisMNotify
{
public:
/*----------------------------------------------------------------------------
Implement this to tell QisMLib that this callback only subscribes to
QisMNotifyV1 (i.e QisMNotify)
----------------------------------------------------------------------------*/
void* QisMNotify_cast(const int version) {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<QisMNotify*>(this);
}
return 0;
}
​
/*----------------------------------------------------------------------------
Implement this to tell QisMLib that this callback only subscribes to
QisMNotifyV1 (i.e QisMNotify)
----------------------------------------------------------------------------*/
const void* QisMNotify_cast(const int version) const {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<const QisMNotify*>(this);
}
return 0;
}
​
/*----------------------------------------------------------------------------
Implement this to tell QisMLib that this callback only subscribes to
QisMNotifyV1 (i.e QisMNotify)
----------------------------------------------------------------------------*/
int QisMNotify_latest_version() const {
return 1;
}
/*----------------------------------------------------------------------------
Recieve the progress notification
----------------------------------------------------------------------------*/
int On_qismt_progress(
const char* pre_, const char* msg_, const char* post_
)
{
if(msg_ && msg_[0]) fprintf(stderr, "%s%s%s", pre_ ? pre_ : "", msg_, post_ ? post_ : "");
return 0;
}
​
/*----------------------------------------------------------------------------
Recieve the warning notification
----------------------------------------------------------------------------*/
int On_qismt_warning(
const char* pre_, const char* msg_, const char* post_
)
{
if(msg_ && msg_[0]) fprintf(stderr, "\n**warning** %s\n", msg_);
return 0;
}
};
​
/*------------------------------------------------------------------------------
Load the file database (see qismlib.h for full API reference)
* `qismlib_` is the handle to the QisMLib api
* `input_path_` is the path of a valid GDSII/OASIS/DBLOAD file
* `input_layer_map_` if specified is the input layer mapping scheme
* `no_text_` if specified controls if the TEXT elements are loaded or not
* `disk_load_` if specified controls if the database is disk based or not
* `empty_refs_` if specified controls if references to empty cells are loaded
or not
* Returns handle to the newly created QisMFile database
------------------------------------------------------------------------------*/
static QisMFile* qm_lib_load_file(
QisMLib* qismlib_, const char* input_path_, const char* input_layer_map_ = 0,
const bool no_text_ = false, const bool disk_load_ = false,
const bool empty_refs_ = false
)
{
fprintf(
stdout, "\n> loading file.. (%s %s : %d)\n", __FUNCTION__,
__FILE__, __LINE__
);
assert(qismlib_ != 0);
assert(input_path_ && input_path_[0]);
​
QisMFileLoadCtrl* load_opts = qismlib_->New_loadFile_ctrl();
assert(load_opts != 0);
​
load_opts->Set_layer_map(input_layer_map_);
load_opts->Set_file_data_on_disk(disk_load_);
load_opts->Set_ignore_texts(no_text_);
load_opts->Set_load_empty_refs(empty_refs_);
​
QmLibNotify cb;
QisMFile* filedb = qismlib_->Load_file(
input_path_, load_opts, dynamic_cast<QisMNotify*>(&cb)
);
if(!filedb) {
fprintf(
stderr, "error: failed to load '%s', %s\n", input_path_,
qismlib_->Get_last_error_msg()
);
}
​
qismlib_->Delete_loadFile_ctrl(load_opts);
return filedb;
}
xxxxxxxxxx
lib.load_gds_with_mmaps
&filedb={id}
gds={path}
[mapsdir={dir_path}]
[layermap={layermap_string}]
[notext]
[memload]
[emptyrefs]
.load
memory maps (database disk image) to speed up the loadingQisMLibV3::Load_gds_with_memory_maps
(qismlib.h){id}
is name of a variable of type QisMFile*
to be associated with the newly created database object{path}
is the path of the source GDSII file to be loaded (which was also used to create the memory maps){dir_path}
if specified is the directory to find the .load
and .scan
memory map files. If omitted, the map files are implied to reside in the current working directory{layermap_string}
if specified filters/re-maps layers. See lib.load_file
for syntaxnotext
if specified ignores TEXT elements. (default: TEXT elements if present are loaded)memload
if specified loads the database in memory for faster operations. (default: the database is loaded from disk)emptyrefs
if specified drops all references to empty cellslib.unload_file
to avoid memory/resource leakslib.load_file
lib.unload_file $filedb={filedb_id}
Destroy a QisMFile database
Equivalent to QisMLib::Unload_file
in qismlib.h
{filedb_id}
represents name of a variable of type QisMFile*
associated with the database to be destroyed
xxxxxxxxxx
//C++ equivalent of lib.unload_file
using namespace NsQisMLib;
​
/*------------------------------------------------------------------------------
Destroy the file database (see qismlib.h for full API reference)
* `qismlib_` is the handle to the QisMLib api
* `filedb_` is the handle to a valid QisMFile database
------------------------------------------------------------------------------*/
static void qm_lib_unload_file(QisMLib* qismlib_, QisMFile* filedb_)
{
fprintf(
stdout, "\n> un-loading file.. (%s %s : %d)\n", __FUNCTION__,
__FILE__, __LINE__
);
assert(qismlib_ != 0);
qismlib_->Unload_file(filedb_);
}
xxxxxxxxxx
store.write_as_polys
$bin={bin_id}
path={output_base_path}
grid={grid_m}
units={units_m}
[format={GDS | OAS}]
[top={top_cellname}]
{bin_id}
represents name of a variable of type QisMBStore*
associated with the container to be written{output_base_path}
is the directory + file name of the output file. The extension (.gds or .oas) is automatically added based on the format{grid_m}
and {units_m}
are the file grid and units in meters. e.g for a micron file with nano meter resolution, grid = 1e-9 (nm) and units = 1e-6 (um)format
if used determines the file format. Default -- GDS{top_cell_name}
if used writes the top cell name as specified. Default -- "TOP"xxxxxxxxxx
store.write_as_image
$bin={bin_id}
path={output_base_path}
grid={grid_m}
units={units_m}
resolution={PXSIZE | DPI | GRID},{x}[,{y}]
[format={TIF | BMP | RAW}]
[invert]
[right_to_left]
[dither=0.0-1.0]
Write a boundary container as a monochrome bitmap image in TIFF/BMP/RAW format
Requires the QisMRaster extension to be installed and configured
Requires 1 license of (14827) per call
{bin_id}
represents name of a variable of type QisMBStore*
associated with the container to be written
{output_base_path}
is the directory + file name of the output file. The extension (.tif, .bmp or .raw) is automatically added based on the format
{grid_m}
and {units_m}
are the file grid and units in meters. e.g for a micron file with nano meter resolution, grid = 1e-9 (nm) and units = 1e-6 (um)
resolution
can be specified in both X and Y directions as :-
PXSIZE
-- size of 1 pixel in file units DPI
-- dots per inchGRID
-- as a multiple of the file grid Pixels can be square {x} == {y}
or rectangle {x} != {y}
. If {y}
is omitted, {y} = {x}
format
if specified, determines the file format. Default -- TIF
invert
if used, reverses the image polarity (black (0) data on white (1) background)
right_to_left
if used, rasterizes the data from right to left. i.e. min-x of the data appears on the right hand size (max-x) of the image
dither
if used, generates a dithered image using a 8x8 Bayer matrix. The dithering value must be from 0.0 (max. 0 pixels/8x8 pixel data block) to 1.0 (max. 64 pixels/8x8 pixel data block)
store.print_info $bin={bin_id}
{bin_id}
represents name of a variable of type QisMBStore*
associated with the container to be writtenfile.print_report $filedb={filedb_id}
Print the report for the specified database
Equivalent to QisMFile::Get_file_report
in qismfile.h
{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_job
xxxxxxxxxx
/* Equivalent C++ code */
using namespace NsQisMLib;
​
/*------------------------------------------------------------------------------
Print a report of the specified QisMFile database
* `filedb_` is the handle to the database in question
------------------------------------------------------------------------------*/
static void qm_file_print_report(
QisMFile* filedb_
)
{
assert(filedb_);
fprintf(
stdout, "\n> printing database report.. (%s %s : %d)\n", __FUNCTION__,
__FILE__, __LINE__
);
fprintf(stdout, "\n%s\n", filedb_->Get_file_report());
}
file.get_default_cell $filedb={filedb_id} [&var={var_id}]
QisMFile::Get_default_top_cell
in qismfile.h{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_job{var_id}
if used, sets a string variable of that name to the returned cell name so that it can be used in the subsequent script commands using (({var_id}))
. e.g. &var=CELL
will cause all occurrences of ((CELL))
in the subsequent commands to be replaced by the returned cell name before those commands are executedfile.print_cells $filedb={filedb_id} [extents] [&var={var_name}]
QisMFile::Get_cell_list
in qismfile.h{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_jobextents
if used, also prints the extents of each cell in the list{var_name}
if used represents name of a string variable to store comma-separated list of cell names. It can be referenced in subsequent commands using (({var_name}))
file.print_top_cells $filedb={filedb_id} [extents] [&var={var_name}]
QisMFile::Get_top_cell_list
in qismfile.h{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_jobextents
if used, also prints the extents of each cell in the list{var_name}
if used represents name of a string variable to store comma-separated list of cell names. It can be referenced in subsequent commands using (({var_name}))
file.print_child_cells $filedb={filedb_id} cell={cellname} [extents] [&var={var_name}]
QisMFile::Get_cell_children_list
in qismfile.h{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_jobextents
if used, also prints the extents of each cell in the list{var_name}
if used represents name of a string variable to store comma-separated list of cell names. It can be referenced in subsequent commands using (({var_name}))
file.get_cell_extents $filedb={filedb_id} [cell={cellname}] [&var={var_id}]
QisMFile::Get_cell_extents
in qismfile.h{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_job{cellname}
if used, represents the name of the cell in question. If omitted, the default cell is used{var_id}
if used, sets a string variable of that name to the returned extents so that it can be used in the subsequent script commands using (({var_id}))
. e.g. &var=EXTS
will cause all occurrences of ((EXTS))
in the subsequent commands to be replaced by the returned extents before those commands are executed. The extents are preserved in the format {minx},{miny},{maxx},{maxy}
file.print_layers $filedb={filedb_id} &var={var_name}
QisMFile::Get_layer_list
in qismfile.h{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_job{var_name}
if used represents a string variable to store a comma-separated list of layer:datatype
. It can be referenced in subsequent commands using (({var_name}))
file.save_memory_maps $filedb={filedb_id} [outdir={output_directory}]
QisMFileV2::SaveAs_memory_maps
in qismfile.h{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_jobfile.print_cell_tree $filedb={filedb_id} [cell={cellname}]
{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_job{cellname}
if used, is the name of the cell whose tree is to be printed. If omitted, the entire database hierarchy (trees of all top cells) is printedfile.create_exploder &exploder={exploder_id} $filedb={filedb_id}
QisMFile::Create_exploder
in qismfile.h{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_job{exploder_id}
represents name of a variable of type QisMExploder*
associated with the exploder to be createdfile.destroy_exploder $exploder={exploder_id} $filedb={filedb_id}
QisMFile::Destroy_exploder
in qismfile.h{filedb_id}
represents name of a variable of type QisMFile*
associated with a file database created using lib.load_file or rtcr.setup_job that was used to create this exploder{exploder_id}
represents name of a variable of type QisMExploder*
associated with the exploder to be destroyedxxxxxxxxxx
explcounter.break_window_by_vertnum
$filedb={filedb_id}
maxvert={max_vert_per_window}
[cell={cellname}]
[layers={layer_list}]
[$tiles={window_set_id}]
[thrnum={n_threads}]
[gds={output_gds_path}]
[minvert={min_vert_per_window}]
[&var={new_set_id}]
Break a region of interest into tiles based on the no. vertices contained within (a.k.a density map of the ROI)
Equivalent to QisMExplCounterV3::Break_window_by_vertnum
in qismexplcounter.h
{filedb_id}
is name of a variable of type QisMFile*
associated with the file database to be used
{max_vert_per_window}
is the max. no. vertices contained in any of the computed tiles. Larger windows will be broken up into smaller ones until this criteria is satisfied
{cellname}
if specified is the view cell to be used. Default : default top cell
{layer_list}
is a comma-separated list of layer
or layer:datatype
numbers to be treated as a single group. Default: ALL available layers
{window_set_id}
if specified is name of a variable of type QisMBoxSet*
associated with a list of windows that represents a pre-computed tiles over which this computation will be performed. Use this to:
{n_threads}
if specified is the no. threads to be used to perform this operation. Default: 0 i.e no. cpus in the system. If {n_threads} > 1
, the input ROI(s) may be further split into smaller tiles for better multi-threaded load sharing
{output_gds_path}
if specified generates a .sf
(GDSII) file at the specified path illustrating the newly computed windows
{min_vert_per_window}
is the min. no. vertices per window. Windows smaller than this count will be dropped from the output
{set_id}
if specified, is name of a variable of type QisMBoxSet*
associated with a newly created list of tiles. It MUST be eventually destroyed using explcounter.delete_windows
xxxxxxxxxx
explcounter.break_window_by_crossing
$filedb={filedb_id}
gds={output_gds_path}
[cell={cellname}]
[layers={layer_list}]
[window={minx},{miny},{maxx},{maxy}]
[maxd={max_quad_depth}]
[maxv={max_vertices_per_quad}]
[limitpct={percentage}]
[lout={output_layer}]
[&var={set_id}]
{filedb_id}
is name of a variable of type QisMFile*
associated with the file database to be used{cellname}
if specified is the view cell to be used. Default : default top cell{layer_list}
is a comma-separated list of layer
or layer:datatype
numbers to be treated as a single group. Default: ALL available layerswindow
if specified represents the region of interest (default: extents of the view cell){output_gds_path}
generates a (GDSII) file at the specified path illustrating the newly computed windows{max_quad_depth}
if specified controls the resolution of the density map by setting the max. depth of the quad-tree. Increasing the depth increases the resolution of the density map (default: 8){max_vertices_per_quad}
if specified controls the breaking up of quads based on the max. no. vertices per leaf quad (default: 1024). Increasing the max. no. vertices reduces the resolution of the density map{percentage}
if specified limits the no. output tiles to the specified percentage of the original no. computed tiles (default: 100){output_layer}
if specified writes the tiles to {output_layer}:0
in the output file{set_id}
if specified, is name of a variable of type QisMBoxSet*
associated with a newly created list of tiles. It MUST be eventually destroyed using explcounter.delete_windows
explcounter.delete_windows $windows={set_id}
explcounter
commands{set_id}
is name of a variable of type QisMBoxSet*
associated with the list of windows to be destroyedsee qismwindowprobe.h for corresponding API
xxxxxxxxxx
/* C++ code to get access to QisMWindowProbe extension API */
using namespace NsQisMLib;
​
bool probe_get_extension_api(QisMLib* qismlib, QisMWindowProbe*& probe_api)
{
assert(qismlib != NULL);
QisMExtensionAPI* extn = qismlib->Get_extension_api(QISMEXTENSION_WINDOWPROBE);
if(!extn) {
fprintf(
stderr, "error: failed to locate extension '%s'", QISMEXTENSION_WINDOWPROBE
);
return false;
}
probe_api = (QisMWindowProbe*)(extn->Extension_class_ptr());
return true;
}
xxxxxxxxxx
probe.window
$filedb={filedb_id}
window={minx},{miny},{maxx},{maxy}
[cell={cellname}]
[layers={layer_list}]
[nesting={nesting_level}]
Probe a rectangular window to collect statistical information corresponding to an extensible list of parameters
Makes use of QisMWindowProbeObj
class in qismwindowprobe.h
{filedb_id}
represents name of a variable of type QisMFile*
associated with the file database to be probed
{minx}..{maxy}
are the extents of the window to be probed
{cellname}
if used represents the view cell (otherwise, the default top cell is used)
{layer_list}
if used is a comma separated list of layer[:datatype] or "ALL". Default is ALL layers
{nesting_level}
if used is the max. nesting level to probe up to. Default is 0 (all nesting levels)
At the moment, the following parameters are probed and printed:
xxxxxxxxxx
/* C++ equivalent to probe.window */
using namespace NsQisMLib;
​
bool probe_window(
QisMWindowProbe* probe_api, QisMFile* filedb, const double lx, const double ly,
const double ux, const double uy, const char* cell, const char* layers,
const int nesting
)
{
assert(probe_api != NULL);
assert(filedb != NULL);
QisMWindowProbeObj* probe_obj = 0;
int ecode = probe_api->Create_probe(probe_obj, filedb);
if(ecode != 0) {
fprintf(
stderr, "error: failed to create probe, %s", probe_api->Get_error_msg(ecode)
);
return false;
}
const QisMWindowProbeData* results = 0;
ecode = probe_obj->Probe_window(results, lx, ly, ux, uy, cell, layers, nesting);
if(ecode != 0) {
fprintf(stderr, "probe failed, %s", probe_obj->Get_error_msg(ecode));
probe_api->Destroy_probe(probe_obj);
return false;
}
double p_lx = 0.0, p_ly = 0.0, p_ux = 0.0, p_uy = 0.0; long long n_p = 0, n_pv = 0;
results->Get_param_info(
QisMWProbeParam::PRB_POLY_EXTENTS, &p_lx, &p_ly, &p_ux, &p_uy
);
results->Get_param_info(QisMWProbeParam::PRB_POLY_COUNT, &n_p);
results->Get_param_info(QisMWProbeParam::PRB_POLY_VERT_COUNT, &n_pv);
fprintf(stdout, "Actual polygon extents: %g, %g, %g, %g\n", p_lx, p_ly, p_ux, p_uy);
fprintf(stdout, "Polygon counts: %lld (%lld vertices)\n", n_p, n_pv);
probe_api->Destroy_probe(probe_obj);
return true;
}
xxxxxxxxxx
exploder.set_view
$exploder={exploder_id}
[reset] | {
[cell={cellname}]
[layers_on={list} | layers_off={list}]
[window={minx},{miny},{maxx},{maxy}]
[nesting={level>0}]
[inside]
}
QisMExploder::Set_*
methods in qismexploder.h or qismview.h{exploder_id}
represents name of a variable of type QisMExploder*
associated with the exploderreset
is specified, all other options are ignored and the view is reset to default options{cellname}
if used, represents the view cell (default -- file.get_default_cell){list}
if used, represents a comma-separated list of layers or "ALL"
. e.g. 1,2:2,3:3,3:4,4
(default -- ALL on){minx}..{maxy}
if used, represents the window co-ordinates in file units (default -- extents of the view cell){level}
if used, represents the max. number of nesting levels to traverse (default -- all levels)inside
if used, only vectors fully inside the view window will be returned. Partially crossing vectors will be dropped (default -- all vectors crossing the view window, partial or full, will be processed)exploder.get_boundaries $exploder={exploder_id} &bin={bin_id}
QisMExploderV2::Get_boundaries
in qismexploder.h{exploder_id}
represents name of a variable of type QisMExploder*
associated with the exploder{bin_id}
represents name of a variable of type QisMBStore*
associated with the container where the boundaries will be storedexploder.delete_store $bin={bin_id}
QisMBStore*
only created by exploder.get_boundaries{bin_id}
represents name of a variable of type QisMBStore*
associated with the container to be destroyedexploder.write_texts_to_file $exploder={exploder_id} file={ascii_file_path} [sort]
QisMExploder::Get_vector_data
in qismexploder.h to collect TEXT vectors from a view{exploder_id}
represents name of a variable of type QisMExploder*
associated with the exploder{ascii_file_path}
is the path where an ASCII (text) file will be created{text_string},{parent_cell},{x_dbu},{y_dbu},{layer},{texttype}
sort
if specified will sort the items in format order before writingexploder.write_srefs_to_file $exploder={exploder_id} file={ascii_file_path} [sort]
QisMExploder::Get_vector_data
in qismexploder.h to collect SREF vectors from a view{exploder_id}
represents name of a variable of type QisMExploder*
associated with the exploder{ascii_file_path}
is the path where an ASCII (text) file will be created{ref_cell},{parent_cell},{x_dbu},{y_dbu},{scale},{angle},{mirror 'N' | 'X'}
sort
if specified will sort the items in format order before writingexploder.write_arefs_to_file $exploder={exploder_id} file={ascii_file_path} [sort]
QisMExploder::Get_vector_data
in qismexploder.h to collect AREF vectors from a view{exploder_id}
represents name of a variable of type QisMExploder*
associated with the exploder{ascii_file_path}
is the path where an ASCII (text) file will be created{ref_cell},{parent_cell},{x_dbu},{y_dbu},{scale},{angle},{mirror 'N' | 'X'},{columns},{rows},{col_dx_dbu},{col_dy_dbu},{row_dx_dbu},{row_dy_dbu}
sort
if specified will sort the items in format order before writingxxxxxxxxxx
draw.window
$filedb={filedb_id}
[path={img_path_base}]
[cell={cellname}]
[layers={layer_list}]
[window={minx},{miny},{maxx},{maxy}]
[nesting={level}]
[format={GIF | DIB | XPM}]
[background={BLACK | WHITE}]
[filtersize={dfs}]
[fill={ON | OFF}]
[text={ON | OFF}]
[res={x},{y}]
[refboxes={ON | OFF | NL}]
QisMDraw
API defined in qismdraw.h(11057)
per call{filedb_id}
is name of the variable of type QisMFile*
associated with the file database{img_base_path}
if specified generates an output file at the specified path (extension automatically added). Otherwise, the image is generated but not written to disk{cellname}
if specified set the view cell. Default view cell is the deepest top cell{layer_list}
if specified, is a comma-separated list of layer and/or layer:datatype numbers to be visible. Default: ALL loaded layers{minx}..{maxy}
if specified represents the window to be set (adjusted to match the image aspect ratio). Default: Extents of the view cell is used{level}
if specified sets a max. nesting level for drawing. Default: ALL levelsformat
if specified sets the output file format. Default: GIF. XPM
is only available on Linux. background
if specified sets the background color. Default: BLACK{dfs}
if specified sets the display filter size (for both geometries and references). Default: 0fill
controls the fill mode. Default : OFFtext
controls if TEXT
elements are drawn. Default: ON{x},{y}
if used is the image resolution in pixels along X and Y. Default: 800, 600 pixelsrefboxes
if specified controls if the references are drawn with outlines and labels. If ON
, references at all nesting levels are drawn with outline and labels. If OFF
, outlines and labels are not drawn. If NL
, outlines and labels are only drawn for references at the specified nesting level (> 0)xxxxxxxxxx
bool.create_instance &bool={boolinst_id}
QisMBool::Create_instance
in qismbool.h{boolinst_id}
is name of a variable of type QisMBoolInst*
to be associated with the newly created Boolean objectbool.destroy_instance
bool.destroy_instance
to avoid resource leaksxxxxxxxxxx
bool.destroy_instance $bool={boolinst_id}
QisMBool::Destroy_instance
in qismbool.h{boolinst_id}
is name of a variable of type QisMBoolInst*
associated with the object to be destroyedxxxxxxxxxx
bool.create_settings &settings={settings_id}
QisMBool::New_settings
in qismbool.h{settings_id}
is name of a variable of type QisMBoolSettingsV2*
to be associated with the newly created objectbool.destroy_settings
to avoid memory leakxxxxxxxxxx
bool.destroy_settings $settings={settings_id}
QisMBool::Delete_settings
in qismbool.h{settings_id}
is name of a variable of type QisMBoolSettingsV2*
associated with the object to be destroyedxxxxxxxxxx
boolsettings.set
$settings={settings_id}
[reset]
[sliver={sliver_value}]
[clip={minx},{miny},{maxx},{maxy}]
[butting={overlap}]
[maxvert={count}]
[passthru={ON | OFF}]
[mergestripes={ON | OFF}]
[convex={OFF | X | Y | FULL | HTRAP | VTRAP}]
[sizing={OFF | STD | ISOTR | NONISOTR}[,{sizing_x}[,{sizing_y}]]]
[rndcorners={RTANGLE | THREEPT | FIVEPT}]
[cutlines] [lnvout] [lnvin={A | B | ALL | NONE}]
[grid={grid_m}] [units={units_m}]
QisMBoolSettingsV2::Set_param
in qismbool.h{settings_id}
is name of a variable of type QisMBoolSettingsV2*
associated with the settings object to be usedreset
if specified, resets all the settings to default values first before applying any other parameters{sliver_value}
if specified sets the sliver parameter for removal of polygons (slivers) smaller than the specified threshold (in file units). Default: no filtering of tiny polygons{minx}..{maxy}
if specified sets the clipping window (in file units). Any polygon crossing this window will be clipped. Default: no clipping{overlap}
if specified (even 0.0), sets the polygon output mode to BUTTING
with the specified overlap value along butting edges (in file units). Default: Polygons with holes have cutlines{count}
if specified sets the max. vertex count for any output polygon. Larger polygons are broken up into smaller ones. Default: 8190 verticespassthru
if specified sets/resets the pass through mode. If ON
, the core boolean operation will be bypassed and only the output formatting procedures (such as clipping) will be run (Works only with boolinst.union
). Default: OFFmergestripes
if ON
will force the removal of all edges that were created because of data partitioning across multiple threads. Default: OFFconvex
if specified activates convex mode for the output polygons. Default: OFFsizing
if specified activates the sizing mode for output polygons. Default: OFF. For STD
and ISOTR
, {sizing_x}
MUST be specified (in file units). For NONISOTR
, both {sizing_x}
and {sizing_y}
MUST be specifiedrndcorners
if specified controls sharp corners are handled during sizing. Default: (if ISOTR
| NONISOTR
sizing) THREEPT
lnvout
if specified sets the output polygon format to Leonovcutlines
if specified sets the output polygon format to cutlineslnvin
if specified indicates the format for the source polygons. A
, B
implies that only the specified operand is in Leonov format. ALL
implies both operands are Leonov. NONE
(default) implies none of the operands are Leonov.{grid_m}
and {units_m}
if specified represent the data units and resolution. Default: 1e-9 (nm) and 1e-6 (um) respectivelyxxxxxxxxxx
boolinst.union
$bool={boolinst_id}
$settings={settings_id}
$in={input_bin_id}
&out={output_bin_id}
[thrnum={n_threads}]
[layer={layer}]
QisMBoolInst::UnionMT
in qismbool.h{boolinst_id}
is name of a variable of type QisMBoolInst*
associated with the boolean object to be used{settings_id}
is name of a variable of type QisMBoolSettingsV2*
associated with the object holding the boolean settings{input_bin_id}
is name of a variable of type QisMBStore*
associated with a set of polygons to be used as the source{output_bin_id}
is name of a variable of type QisMBStore*
to be associated with the newly created set of resulting polygons{n_threads}
if specified indicates the number of threads to be used for this operation. Default: no. system processorslayer
if specified indicates the layer number to be associated with the output polygons. Default : 0boolinst.delete_store
to avoid memory leakxxxxxxxxxx
boolinst.binary
$bool={boolinst_id}
$settings={settings_id}
$bin_a={operand_a_bin_id}
$bin_b={operand_b_bin_id}
&out={output_bin_id}
[op={UNION | INTERSECTION | DIFFERENCE | XOR}]
[thrnum={n_threads}]
[layer={layer}]
QisMBoolInst::BinaryMT
in qismbool.h{boolinst_id}
is name of a variable of type QisMBoolInst*
associated with the boolean object to be used{settings_id}
is name of a variable of type QisMBoolSettingsV2*
associated with the object holding the boolean settings{operand_a_bin_id}
and {operand_b_bin_id}
are names of variables of type QisMBStore*
associated with a set of polygons to be used as the operand A and operand B respectively. The operation to be performed is A op
B.{output_bin_id}
is name of a variable of type QisMBStore*
to be associated with the newly created set of resulting polygonsop
if specified represents the boolean operator. Default: UNION
{n_threads}
if specified indicates the number of threads to be used for this operation. Default: no. system processorslayer
if specified indicates the layer number to be associated with the output polygons. Default : 0boolinst.delete_store
to avoid memory leakboolinst.delete_store $bin={bin_id}
boolinst.union
or boolinst.binary
ONLY{bin_id}
is name of a variable of type QisMBStore*
associated with the polygon set to be destroyedQisMBoolInst::Release
in qismbool.hxxxxxxxxxx
cadwriter.open
&writer={writer_id}
grid_m={grid_in_meters}
units_m={units_in_meters}
path={output_file_path}
[format={GDS|OAS}]
{writer_id}
is name of a variable of type QisMCADWriterV2*
to be associated with the writer object{grid_in_meters}
is the file resolution expressed in meters{units_in_meters}
is the file units expressed in meters{output_file_path}
is the path (dir + name + extension) where the output file will be createdformat
if specified determines the file format (default : GDS)open
MUST have a corresponding close
cadwriter.begin_cell $writer={writer_id} name={cellname}
{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with an open writer object{cellname}
is name of the cell to be definedbegin_cell
MUST have a corresponding end_cell
xxxxxxxxxx
cadwriter.box
$writer={writer_id}
box={minx},{miny},{maxx},{maxy}
[layer={layer}:{datatype}]
{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with an open writer object{minx}..{miny}
are the min-max extents of the box in file units{layer}:{datatype}
if specified is the layer to be associated with the box (default: 0:0
)xxxxxxxxxx
cadwriter.box_set
$writer={writer_id}
$set={box_set_id}
[layer={layer}:{datatype}]
{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with an open writer object{box_set_id}
is name of a variable of type QisMBoxSet*
associated with the set of boxes to be written{layer}:{datatype}
if specified is the layer to be associated with the box (default: 0:0
)xxxxxxxxxx
cadwriter.bstore
$writer={writer_id}
$bin={bstore_id}
{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with an open writer object{bstore_id}
is name of a variable of type QisMBStore*
associated with the set of boundaries to be writtenxxxxxxxxxx
cadwriter.boundary
$writer={writer_id}
{{deltas={dx0},{dy0},{dx1},{dy1}[,{dx},{dy}]* pos={x},{y}} | xy={x1},{y1}..{xn},{yn}}
[repeat=NM,{n},{ndx},{ndy},{m},{mdx},{mdy} | repeat=PTS,{dx0},{dy0}..{dxn},{dyn}]
[layer={layer}:{datatype}]
Write a boundary to the current cell (with or without repetitions)
All co-ordinates are in file units
{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with an open writer object
deltas
is a list of offsets from the boundary origin 0,0
that form the vertices of the boundary. There MUST be at least two deltas to form a boundary (with 4 vertices). When specifying the deltas, the origin 0,0
and the last delta (to close the boundary) are implied and therefore omitted. e.g deltas=100,0,0,100,-100,0
defines a square of length 100.
Alongside deltas
, pos
is the location where the first instance of the boundary is to be placed
Alternately, one can specify the co-ordinates of the boundary using an x,y list xy=
{layer}:{datatype}
if specified is the layer to be associated with the box (default: 0:0
)
Repetitions (optional) can be specified in two forms:
{n}
in one direction with offsets {ndx},{ndy}
and {m}
instances in an orthogonal direction with offsets {mdx},{mdy}
. {dx},{dy}
from the first instancexxxxxxxxxx
cadwriter.path
$writer={writer_id}
{{deltas={dx0},{dy0},{dx1},{dy1}[,{dx},{dy}]* pos={x},{y}} | xy={x1},{y1}..{xn},{yn}}
width={path_width}
[type={FLUSH | HALF | ROUND}]
[repeat=NM,{n},{ndx},{ndy},{m},{mdx},{mdy} | repeat=PTS,{dx0},{dy0}..{dxn},{dyn}]
[layer={layer}:{datatype}]
Write a path to the current cell (with or without repetitions)
All co-ordinates are in file units
{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with an open writer object
deltas
is a list of offsets from the path origin 0,0
that form the vertices of the path. There MUST be at least one delta to form a path (with 2 vertices). When specifying the deltas, the origin 0,0
is implied and therefore omitted. e.g deltas=100,0
defines a one-segment horizontal path of length 100 units.
Alongside deltas
, pos
is the location where the first instance of the boundary is to be placed
Alternately, one can specify the co-ordinates of the path using an x,y list xy=
{path_width}
MUST be specified (> 0.0)
{layer}:{datatype}
if specified is the layer to be associated with the box (default: 0:0
)
type
if specified represents the path type. Default: FLUSH
Repetitions (optional) can be specified in two forms:
{n}
in one direction with offsets {ndx},{ndy}
and {m}
instances in an orthogonal direction with offsets {mdx},{mdy}
. {dx},{dy}
from the first instancexxxxxxxxxx
cadwriter.circle
$writer={writer_id}
circle={x},{y},{radius},{arcres},{arcsag}
[repeat=NM,{n},{ndx},{ndy},{m},{mdx},{mdy} | repeat=PTS,{dx0},{dy0}..{dxn},{dyn}]
[layer={layer}:{datatype}]
Write a circle (converted to a polygon) to the current cell (with or without repetitions)
All co-ordinates are in file units
{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with an open writer object
{x},{y}
are the co-ordinates of the center, {arcres}
and {arcsag}
specify the fineness of the approximation of the polygon w.r.t the circle
{layer}:{datatype}
if specified is the layer to be associated with the box (default: 0:0
)
Repetitions (optional) can be specified in two forms:
{n}
in one direction with offsets {ndx},{ndy}
and {m}
instances in an orthogonal direction with offsets {mdx},{mdy}
. {dx},{dy}
from the first instancexxxxxxxxxx
cadwriter.reference
$writer={writer_id}
name={cellname}
pos={x},{y}
[repeat=NM,{n},{ndx},{ndy},{m},{mdx},{mdy} | repeat=PTS,{dx0},{dy0}..{dxn},{dyn}]
[scale={scale}]
[angle={degrees}]
[flipy]
Write a cell reference to the current cell (with or without repetitions)
All co-ordinates are in file units
{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with an open writer object
{cellname}
is name of the cell to be referenced
pos
is the location where the first instance of the boundary is to be placed
{scale}
, {angle}
and flipy
if specified apply transformation to the reference
Repetitions (optional) can be specified in two forms:
{n}
in one direction with offsets {ndx},{ndy}
and {m}
instances in an orthogonal direction with offsets {mdx},{mdy}
. {dx},{dy}
from the first instancecadwriter.end_cell $writer={writer_id}
{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with an open writer objectcadwriter.close $writer={writer_id}
{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with the writer object to be closedRequires the QisMRTCR extension to be installed and loaded (qismrtcr64.dll/so)
Select commands may require a valid license
See qismrtcr.h for the corresponding API
xxxxxxxxxx
/* C++ code to get access to QisMRTCR extension API */
using namespace NsQisMLib;
using namespace NsQisMRTCR;
​
bool rtcr_get_extension_api(QisMLib* qismlib, QisMRTCR*& rtcr_api)
{
assert(qismlib != NULL);
QisMExtensionAPI* extn = qismlib->Get_extension_api(QISMEXTENSION_RTCR);
if(!extn) {
fprintf(stderr, "error: failed to locate extension '%s'", QISMEXTENSION_RTCR);
return false;
}
rtcr_api = (QisMRTCR*)(extn->Extension_class_ptr());
return true;
}
rtcr.create_opts &opts={opts_id} [layers={layer_filter}] [diskload] [keeptmp]
Create a new instance of the basic RTCR options object (QisMRTCROpts*
)
Equivalent to QisMRTCR::Create_object("QisMRTCROpts")
in qismrtcr.h
{opts_id}
represents name of the variable of type QisMRTCROpts*
associated with the newly created object
{layer_filter}
if used, can be a comma-separated list of layers w/o datatypes OR a layer map
"1,2:2,3"
for a simple list of layers of interest"ALL-NULL,1-100,2:2-200:0,3-300:3"
for a layer map that re-maps 1:*
to 100:*
, 2:2
to 200:0
and merges all datatypes of layer 3
to 300:3
diskload
if used creates the new database in 'disk' mode to reduce the memory footprint
keeptmp
if used will retain the temporary files used by an RTCR job in it's job directory after the job has been closed. This can be useful for troubleshooting and diagnosis
Every object created using this command MUST be destroyed by the script using rtcr.destroy_opts to avoid resource leak
xxxxxxxxxx
/* C++ equivalent of rtcr.create_opts */
using namespace NsQisMRTCR;
​
bool rtcr_create_opts(
QisMRTCR* rtcr_api, const char* layers, const bool diskload, const bool keeptmp,
QisMRTCROpts*& handle
)
{
assert(rtcr_api != NULL);
handle = (QisMRTCROpts*)(rtcr_api->Create_object("QisMRTCROpts"));
assert(handle != NULL);
if(layers && layers[0]) handle->Set_layers(layers);
handle->Set_load_from_disk(diskload);
handle->Set_keep_working_files(keeptmp);
return true;
}
rtcr.destroy_opts $opts={opts_id}
Destroy an instance of the basic RTCR options object
Equivalent to QisMRTCR::Destroy_object("QisMRTCROpts")
in qismrtcr.h
{opts_id}
represents name of the variable of type QisMRTCROpts*
associated with the object to be destroyed
xxxxxxxxxx
/* C++ equivalent of rtcr.destroy_opts */
using namespace NsQisMRTCR;
​
void rtcr_destroy_opts(QisMRTCR* rtcr_api, QisMRTCROpts* opts)
{
assert(rtcr_api != NULL);
if(opts) rtcr_api->Destroy_object("QisMRTCROpts", opts);
}
xxxxxxxxxx
rtcr.create_corrections
&corr={corr_id}
{{point={x},{y},{dx},{dy}}+4x} | file={corr_file}
[tolerance={value}]
Create an instance of the RTCR corrections object
Equivalent to QisMRTCR::Create_object("QisMRTCRCorrections")
in qismrtcr.h
{corr_id}
represents name of the variable of type QisMRTCRCorrections*
associated with the newly created object
{x},{y},{dx},{dy}
represents one correction point. Each domain contains exactly FOUR such points. Specify one or more domains using a series of point=
arguments
{corr_file}
represents the path of a correction text file to be imported. See QisMRTCRCorrections
in qismrtcr.h for file syntax
{value}
represents the amount of tolerance to be applied for correcting cell references
Every object created using this command MUST be destroyed by the script using rtcr.destroy_corrections to avoid resource leak
xxxxxxxxxx
/* C++ equivalent of rtcr.create_corrections */
using namespace NsQisMRTCR;
​
struct CorrectionPt
{
double x, y, dx, dy;
CorrectionPt(): x(0.0), y(0.0), dx(0.0), dy(0.0) {}
};
​
bool rtcr_create_corrections(
QisMRTCR* rtcr_api, const char* file, const CorrectionPt* points,
const int n_points, const double tolerance, QisMRTCRCorrections*& corr
)
{
assert(rtcr_api != NULL);
corr = (QisMRTCRCorrections*)(rtcr_api->Create_object("QisMRTCRCorrections"));
assert(corr != NULL);
if(file && file[0]) {
int ecode = corr->Add_from_file(file);
if(ecode != 0) {
fprintf(
stderr, "error: failed to apply '%s', %s", file, corr->Get_error_msg(ecode)
);
return false;
}
}
if(points && (n_points > 0)) {
if((n_points % 4) != 0) {
fprintf(stderr, "error: each correction domain contains exactly FOUR points");
return false;
}
for(int p=0; p<n_points; p+=4) {
corr->Add_domain(
points[p+0].x, points[p+0].y, points[p+0].dx, points[p+0].dy,
points[p+1].x, points[p+1].y, points[p+1].dx, points[p+1].dy,
points[p+2].x, points[p+2].y, points[p+2].dx, points[p+2].dy,
points[p+3].x, points[p+3].y, points[p+3].dx, points[p+3].dy
);
}
}
corr->Set_tolerance(tolerance);
return true;
}
rtcr.destroy_corrections $corr={corr_id}
Destroy an instance of the RTCR corrections object
Equivalent to QisMRTCR::Destroy_object("QisMRTCRCorrections")
in qismrtcr.h
{corr_id}
represents name of the variable of type QisMRTCRCorrections*
associated with the object to be destroyed
xxxxxxxxxx
/* C++ equivalent of rtcr.destroy_corrections */
using namespace NsQisMRTCR;
​
void rtcr_destroy_corrections(QisMRTCR* rtcr_api, QisMRTCRCorrections* corr)
{
assert(rtcr_api != NULL);
if(corr) rtcr_api->Destroy_object("QisMRTCRCorrections", corr);
}
rtcr.create_annotations &ann={ann_id} [file={ann_file}]
Create an instance of the RTCR annotations object
Equivalent to QisMRTCR::Create_object("QisMRTCRAnnotations")
in qismrtcr.h
{ann_id}
represents name of the variable of type QisMRTCRAnnotations*
associated with the newly created object
{ann_file}
if specified, represents the path of a annotation text file to be imported. See QisMRTCRAnnotations
in qismrtcr.h for file syntax
Every object created using this command MUST be destroyed by the script using rtcr.destroy_annotations to avoid resource leak
xxxxxxxxxx
/* C++ equivalent of rtcr.create_annotations */
using namespace NsQisMRTCR;
​
bool rtcr_create_annotations(
QisMRTCR* rtcr_api, const char* file, QisMRTCRAnnotations*& ann
)
{
assert(rtcr_api != NULL);
ann = (QisMRTCRAnnotations*)(rtcr_api->Create_object("QisMRTCRAnnotations"));
assert(ann != NULL);
int ecode = ann->Add_from_file(file);
if(ecode != 0) {
fprintf(
stderr, "error: failed to apply '%s', %s", file, ann->Get_error_msg(ecode)
);
return false;
}
return true;
}
xxxxxxxxxx
rtcrannotations.add
$ann={id}
text={string}
{pos={x},{y},{height} | box={lx},{ly},{ux},{uy}}
units_m={value}
[angle={degrees}]
[margin={mm_value}]
[inverse]
[frame]
[backwards]
{id}
is name of a variable of type QisMRTCRAnnotations*
associated with the annotations settings object obtained via rtcr.create_annotations{string}
is the annotation text{x},{y},{height}
are the position and size of the annotation in file units. The width is calculated based on the text string and the height. Alternately, the annotation can be fit into a fixed size bounding box with min-max extents {lx} .. {uy}
. One of these two options MUST be specifiedunits_m
is the file units in meters. e.g um = 1e-6angle
is the rotation to be applied to the text. In box mode, the rotated text is made to fit inside the specified box. The box itself is not rotatedmargin
is the amount of margin (in mm) to be applied between the text and the outer frame when frame
is enabledframe
if specified places the text inside a frameinverse
if specified inverts the polarity of the text polygons (the text is subtracted from a base rectangle)backwards
if specified reverses the appearance of the text so that it reads backwardsrtcr.destroy_annotations $ann={ann_id}
Destroy an instance of the RTCR annotations object
Equivalent to QisMRTCR::Destroy_object("QisMRTCRAnnotations")
in qismrtcr.h
{ann_id}
represents name of the variable of type QisMRTCRAnnotations*
associated with the object to be destroyed
xxxxxxxxxx
/* C++ equivalent of rtcr.destroy_annotations */
using namespace NsQisMRTCR;
​
void rtcr_destroy_annotations(QisMRTCR* rtcr_api, QisMRTCRAnnotations* ann)
{
assert(rtcr_api != NULL);
if(ann) rtcr_api->Destroy_object("QisMRTCRAnnotations", ann);
}
xxxxxxxxxx
rtcr.setup_job
&job={job_id}
outdir={output_dir}
input={input_gdsii}
[$opts={opts_id}]
[$corr={corr_id}]
[$ann={ann_id}]
Create a new RTCR job and a new database associated with it
Equivalent to QisMRTCR::Setup_job
in qismrtcr.h
Requires 1 license of (1303) which will be released during rtcr.end_job
RTCR job represents a database created from a micron (um) GDSII file optionally with corrections and annotations
{job_id}
represents name of the variable of type QisMRTCRJob*
associated with the newly created job
{output_dir}
is the path of an existing directory to be used as a working directory for this job
{input_gdsii}
is the path of the source GDSII file. It MUST has micron units. Usually, it would be generated by SFGen
{opts_id}
if used, represents name of the variable of type QisMRTCROpts*
associated with the RTCR basic options object created using rtcr.create_opts
{corr_id}
if used, represents name of the variable of type QisMRTCRCorrections*
associated with RTCR corrections object created using rtcr.create_corrections
{ann_id}
if used, represents name of the variable of type QisMRTCRAnnotations*
associated with RTCR annotations object created using rtcr.create_annotations
Every job created using this command MUST be eventually destroyed using rtcr.end_job to avoid resource leaks
This command also creates a new script variable of type QisMFile*
with the name {job_id}
so that it can be used wherever QisMFile can be used. DO NOT use this variable with lib.unload_file as the associated database will be destroyed automatically during rtcr.end_job
xxxxxxxxxx
/* C++ equivalent of rtcr.setup_job */
using namespace NsQisMRTCR;
using namespace NsQisMLib;
​
class ProgressCb: public QisMNotify
{
public:
void* QisMNotify_cast(const int version) {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<QisMNotify*>(this);
}
return 0;
}
const void* QisMNotify_cast(const int version) const {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<const QisMNotify*>(this);
}
return 0;
}
int QisMNotify_latest_version() const { return 1; }
int On_qismt_progress(
const char* pre, const char* msg, const char* post
)
{
if(msg && msg[0]) {
fprintf(stdout, "%s%s%s", pre ? pre : "", msg, post ? post : "");
}
return 0;
}
};
​
bool rtcr_setup_job(
QisMRTCR* rtcr_api, QisMLib* qismlib, const char* outdir, const char* input,
QisMRTCROpts* opts, QisMRTCRCorrections* corr, QisMRTCRAnnotations* ann,
QisMRTCRJob*& job
)
{
assert(rtcr_api != NULL);
assert(qismlib != NULL);
assert(outdir && outdir[0]); //outdir is a valid directory
assert(input && input[0]); //input is a valid GDSII file
ProgressCb progress_cb;
int ecode = rtcr_api->Setup_job(
job, outdir, qismlib, input, opts, dynamic_cast<QisMNotify*>(&progress_cb),
corr, ann
);
if(ecode != 0) {
fprintf(stderr, "error: failed to setup job, %s", rtcr_api->Get_error_msg(ecode));
return false;
}
return true;
}
rtcr.end_job $job={job_id}
Destroy an RTCR job and the database associated with it
Equivalent to QisMRTCR::End_job
in qismrtcr.h
Releases 1 license of (1303) acquired during rtcr.setup_job
{job_id}
represents name of the variable of type QisMRTCRJob*
associated with the job to be destroyed
xxxxxxxxxx
/* C++ equivalent of rtcr.end_job */
using namespace NsQisMRTCR;
​
void rtcr_end_job(QisMRTCR* rtcr_api, QisMRTCRJob* job)
{
assert(rtcr_api != NULL);
if(job) rtcr_api->End_job(job);
}
xxxxxxxxxx
rtcrjob.create_rasterizer
$job={job_id}
&rstr={rasterizer_id}
{pixelsize={x}[,{y}] | dpi={x}[|{y}]}
[cell={cellname}]
[layers={std_layers}]
[dlayers={dither_layers}]
[dither={0.0-1.0}]
[thrnum={num_threads}]
{correct={x},{y},{dx},{dy}}*
Create a new rasterizer object associated with a particular RTCR job
Equivalent to QisMRTCRJob::Create_rasterizer
in qismrtcr.h
Requires 1 license of (14827) per call which will be released during rtcrjob.destroy_rasterizer
{job_id}
represents name of the variable of type QisMRTCRJob*
associated with the newly created job
{rasterizer_id}
represents name of the variable of type QisMRTCRasterizer*
associated with the newly created rasterizer object
{x},{y}
represents the desired image resolution in DPI (dots per inch) or as a pixel size (in file units). The {y}
value is optional. If not used, the resolution is uniform along X and Y axes
{cellname}
is name of the view cell. If not used, the default top cell is used as the view cell
{std_layers}
is a comma-separated list of layers representing the layers to be rasterized in each image. If not used, ALL layers in the database as rasterized in each image. e.g layers=1,2:2,3:0,3:3,4
{dither_layers}
is a comma-separated list of layers to be rasterized with the specified dither
value. If not used, dithering is disabled for the subsequent images. Dithering is applied using a 8x8 bayer matrix
{num_threads}
is the number of threads to be used to generate each raster image
Use one or more correct={x},{y},{dx},{dy}
to apply second-level corrections to any image generated using this rasterizer object. By default, no additional corrections are applied to rasterized images. Applying second-level corrections requires 1 license of (11093) in addition to (14827) per rasterizer object
Each rasterizer created using this command MUST be destroyed eventually using rtcrjob.destroy_rasterizer to avoid resource leaks
xxxxxxxxxx
/* C++ equivalent of rtcrjob.create_rasterizer */
using namespace NsQisMRTCR;
​
bool rtcrjob_create_rasterizer(
QisMRTCRJob* job, const double dpi_x, const double dpi_y, const char* cell,
const char* layers, const char* dlayers, const double dither, const int thrnum,
QisMRTCRasterizer*& rstr
)
{
assert(job != NULL);
double pixelsize_x = job->DPI_to_pixelsize(dpi_x);
double pixelsize_y = job->DPI_to_pixelsize(dpi_y);
int ecode = 0;
rstr = job->Create_rasterizer(
&ecode, pixelsize_x, pixelsize_y, cell, layers, dlayers, dither, thrnum
);
if(!rstr) {
fprintf(
stderr, "error: failed to create rasterizer, %s", job->Get_error_msg(ecode)
);
return false;
}
return true;
}
xxxxxxxxxx
/* C++ equivalent of rtcrjob.create_rasterizer with second-level corrections */
using namespace NsQisMRTCR;
​
bool rtcrjob_create_rasterizer_corrx(
QisMRTCRJob* job, const double dpi_x, const double dpi_y, const char* cell,
const char* layers, const char* dlayers, const double dither, const int thrnum,
const double* correction_pts_xy, const int n_pts
QisMRTCRasterizer*& rstr
)
{
assert(job != NULL);
QisMRTCRJobV2* jobv2 = (QisMRTCRJobV2*)(job->QisMRTCRJob_cast(2));
if(jobv2 == NULL) {
fprintf(stderr, "error: feature not supported. requires QisMRTCRJobV2");
return false;
}
double pixelsize_x = job->DPI_to_pixelsize(dpi_x);
double pixelsize_y = job->DPI_to_pixelsize(dpi_y);
int ecode = 0;
rstr = jobv2->Create_corrx_rasterizer(
&ecode, pixelsize_x, pixelsize_y, correction_pts_xy, n_pts, cell, layers, dlayers,
dither, thrnum
);
if(!rstr) {
fprintf(
stderr, "error: failed to create rasterizer, %s", jobv2->Get_error_msg(ecode)
);
return false;
}
return true;
}
rtcr.destoy_rasterizer $job={job_id} $rstr={rasterizer_id}
Destroy a rasterizer object
Equivalent to QisMRTCRJob::Destroy_rasterizer
in qismrtcr.h
Releases 1 license of (14827) acquired during rtcrjob.create_rasterizer
{rasterizer_id}
represents name of the variable of type QisMRTCRasterizer*
associated with the rasterizer to be destroyed
{job_id}
represents name of the variable of type QisMRTCRJob*
associated with the job that created the rasterizer in question
xxxxxxxxxx
/* C++ equivalent of rtcr.destroy_rasterizer */
using namespace NsQisMRTCR;
​
void rtcrjob_destroy_rasterizer(QisMRTCRJob* job, QisMRTCRasterizer* rstr)
{
assert(job != NULL);
if(rstr) job->Destroy_rasterizer(rstr);
}
xxxxxxxxxx
rtcrjob.get_raster_image
$job={job_id}
$rstr={rasterizer_id}
$windows={window_set_id}
[invert]
[right_to_left]
[shiftpx={INS_B | INS_W | REM}]
[pxrows={px}[,{px}]*]
[pxcols={px}[,{px}*]]
[format={TIF | BMP | RAW}]
Generate one or more raster images
Equivalent to multiple calls to QisMRTCRJob::Get_raster_image
in qismrtcr.h
{job_id}
represents name of the variable of type QisMRTCRJob*
associated with the job in question
{rasterizer_id}
represents name of the variable of type QisMRTCRasterizer*
associated with the rasterizer to used for generating these images
{window_set_id}
represents name of the variable of type QisMBoxSet*
associated with a set of windows created using script.new_window_set
invert
is used, inverts the image polarity to white-on-black i.e bit=0 for data, bit=1 for background
right_to_left
rasterizes the image from right to left i.e min-x of the data appears on the right hand size of the raster image
shiftpx
, pxrows
and/or pxcols
is used, apply row/column shifting to each image. {px}
represents a row/column number in pixel space (MUST be within the bounds of the image). pixel 0,0 appears at the top-left corner of the image. INS_B
inserts a black line (white line in invert mode), INS_W
inserts a white line (black line in invert mode) and REM
removes a line. The image size does not change in either case
format
is used writes the image to disk in TIFF, BMP or RAW format. The job directory is used as the output directory. The name of each file is derived from the associated window-name (see script.new_window_set)
xxxxxxxxxx
/* C++ equivalent of rtcr.get_raster_image */
using namespace NsQisMLib;
using namespace NsQisMRTCR;
using namespace NsQisMRaster;
​
bool rtcr_get_raster_image(
QisMRTCRJob* job, QisMRTCRasterizer* rstr, const QisMBoxSet* windows,
const bool invert, const bool right_to_left,
const QisMRTCRFlags::Shift_type shiftpx, const int n_cols,
const long long* pxcols, const int n_rows, const long long* pxrows
)
{
assert(job != NULL);
assert(rstr != NULL);
assert(windows != NULL);
int n_windows = windows->Get_count();
for(int w=0; w<n_windows; w++)
{
double lx = 0.0, ly = 0.0, ux = 0.0, uy = 0.0;
const char* name = windows->Get_box(w, lx, ly, ux, uy);
assert(name != NULL);
const QisMRasterImage* img = 0;
int ecode = job->Get_raster_image(
img, rstr, lx, ly, ux, uy, invert, right_to_left, shift_type, n_cols, pxcols,
n_rows, pxrols
);
if(ecode != 0) {
fprintf(
stderr, "failed to rasterize window (%g, %g, %g, %g), %s", lx, ly, ux, uy,
job->Get_error_msg(ecode)
);
return false;
}
assert(img != NULL);
fprintf(stdout, "%s\n", img->Report());
}
return true;
}
Requires the QisMLayerSynth extension to be installed and loaded (qismlayersynth64.dll/so)
Select commands may require a valid license
See qismlayersynth.h for the corresponding API
Learn more about QisMLayerSynth
xxxxxxxxxx
/* C++ code to get access to the QisMLayerSynth API */
using namespace NsQisMLayerSynth;
using namespace NsQisMLib;
​
bool lsynth_get_extension_api(QisMLib* qismlib, QisMLayerSynth*& qismlsynth)
{
assert(qismlib != NULL);
QisMExtensionAPI* extn = qismlib->Get_extension_api(QISMEXTENSION_QISMLSYNTH);
if(!extn) {
fprintf(
stderr, "error: failed to locate extension '%s'", QISMEXTENSION_QISMLSYNTH
);
return false;
}
qismlsynth = (QisMLayerSynth*)(extn->Extension_class_ptr());
return true;
}
lsynth.new_synthesizer &lsynth={lsynth_id} $filedb={filedb_id}
Create a new layer synthesizer object
Equivalent to QisMLayerSynth::New_synthesizer
in qismlayersynth.h
Requires 1 license of (11069) which will be release during lsynth.delete_synthesizer
{lsynth_id}
represents name of a variable of type QisMLayerSynthObject*
associated with the object to be created
{filedb_id}
represents name of a variable of type QisMFile*
associated with the file database linked with the synthesizer
Every object created using this command MUST be eventually destroyed using lsynth.delete_synthesizer to avoid resource leaks
xxxxxxxxxx
/* C++ equivalent of lsynth.new_synthesizer */
using namespace NsQisMLayerSynth;
​
bool lsynth_new_synthesizer(
QisMLayerSynth* qismlsynth, QisMFile* filedb, QisMLayerSynthObject*& lsynth
)
{
assert(qismlsynth != NULL);
assert(filedb != NULL);
​
lsynth = qismlsynth->New_synthesizer(filedb);
if(!lsynth) {
fprintf(
stderr, "error: failed to create synthesizer, %s",
qismlsynth->Get_last_error_msg()
);
return false;
}
return true;
}
lsynth.delete_synthesizer $lsynth={lsynth_id}
Destroy a layer synthesizer object
Releases 1 license of (11069) acquired during lsynth.new_synthesizer
{lsynth_id}
represents name of a variable of type QisMLayerSynthObject*
associated with the object to be destroyed
xxxxxxxxxx
/* C++ equivalent of lsynth.delete_synthesizer */
using namespace NsQisMLayerSynth;
​
void lsynth_delete_synthesizer(
QisMLayerSynth* qismlsynth, QisMLayerSynthObject* lsynth
)
{
assert(qismlsynth != NULL);
if(lsynth) qismlsynth->Delete_synthesizer(lsynth);
}
xxxxxxxxxx
lsynth.synthesize_layers
$lsynth={lsynth_id}
&bin={bin_id}
spec={lsynth_spec}
[cell={cellname}]
[clip]
[window={minx},{miny},{maxx},{maxy}]
[butting={overlap}]
[nostripes]
[thrnum={n_threads}]
Synthesize layers based on an expression
Equivalent to QisMLayerSynthObject::Synthesize_layers
in qismlayersynth.h
{lsynth_id}
represents name of a variable of type QisMLayerSynthObject*
associated with the synthesizer object
{bin_id}
represents name of a variable of type QisMBStore*
associated with the set of boundaries to be created to store the synthesized polygons
{lsynth_spec}
is the layer synthesis expression. See this page for expression syntax
{cellname}
if used indicates the view cell. Default -- default top cell
clip
is used causes the output to be clipped to the specified window. Default -- no clipping
{minx}..{maxy}
if used represents a window of interest with min/max extents in file units. Default -- extents of the view cell
butting
if used causes output polygons with holes to be broken up into butting polygons (along X) with the specified {overlap}
value. Default -- Polygons with holes have cutlines
nostripes
if used, causes partitioning lines in the output to be merged. Default -- off
{n_threads}
if used indicates the number of threads to be used for performing boolean operations. Default -- 0 (automatic based on no. cpus in the system)
The newly created {bin_id}
MUST be eventually destroyed using lsynth.delete_store to avoid resource leaks
xxxxxxxxxx
/* C++ equivalent of lsynth.synthesize_layers */
using namespace NsQisMLayerSynth;
​
class LSynthStore: public LSynthNotify
{
public:
void* LSynthNotify_cast(const int version) {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<LSynthNotify*>(this);
}
return 0;
}
const void* LSynthNotify_cast(const int version) const {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<const LSynthNotify*>(this);
}
return 0;
}
int LSynthNotify_latest_version() const { return 1; }
​
int Synthesized_polygon(
const int* xy, const int nv, const double grid, const int layer,
const int dttp
)
{
//Add polygon to container
return 0;
}
};
​
bool lsynth_synthesize_layers(
QisMLayerSynthObject* lsynth, const char* spec, const char* cell,
const double lx, const double ly, const double ux, const double uy,
const bool clip, const bool butting, const double overlap,
const bool nostripes, const int thrnum, LSynthStore*& store
)
{
assert(lsynth != NULL);
assert(spec && spec[0]);
assert((ux > lx) && (uy > ly));
​
LSynthSpec* spec_obj = lsynth->New_spec();
assert(spec_obj != NULL);
​
if(cell && cell[0]) spec_obj->Set_view_cell(cell);
double wndw[4];
wndw[0] = lx; wndw[1] = ly; wndw[2] = ux; wndw[3] = uy;
spec_obj->Set_view_window(wndw);
spec_obj->Set_clip(clip);
spec_obj->Set_butting_mode(butting, overlap);
spec_obj->Set_remove_partitions(nostripes);
spec_obj->Set_layer_spec(spec);
​
store = new LSynthStore;
if(!lsynth->Synthesize_layers(
spec_obj, dynamic_cast<LSynthNotify*>(store), thrnum
))
{
fprintf(stderr, "error: synthesis failed, %s", lsynth->Get_last_error_msg());
lsynth->Delete_spec(spec_obj);
return false;
}
​
lsynth->Delete_spec(spec_obj);
return true;
}
lsynth.delete_store $bin={bin_id}
Delete a container of boundaries created only by lsynth.synthesize_layers
{bin_id}
represents name of a variable of type QisMBStore*
associated with the container to be destroyed
xxxxxxxxxx
/* C++ equivalent of lsynth.synthesize_layers */
using namespace NsQisMLayerSynth;
​
void lsynth_delete_store(LSynthStore* store)
{
if(store) delete store;
}
Requires the QisMClipExtract extension be installed and loaded (qismclipextract64.dll/so)
Select commands may require a valid license
See qismclipextract.h for the C++ API
xxxxxxxxxx
/* C++ code to get access to the QisMClipExtract extension API */
using namespace NsQisMClipExtract;
using namespace NsQisMLib;
​
bool clipextract_get_extension_api(QisMLib* qismlib, QisMClipExtract*& qismclipx)
{
assert(qismlib != NULL);
QisMExtensionAPI* extn = qismlib->Get_extension_api(QISMEXTENSION_CLIPEXTRACT);
if(!extn) {
fprintf(
stderr, "error: failed to locate extension '%s'", QISMEXTENSION_CLIPEXTRACT
);
return false;
}
qismclipx = (QisMClipExtract*)(extn->Extension_class_ptr());
return true;
}
xxxxxxxxxx
clip.extract_polygons
$filedb={filedb_id}
$windows={window_set_id}
[layers={layer_list}]
[cell={cellname}]
[thrnum={n_window_threads},{n_threads_per_window}]
[per_layer_union]
[clip]
[maxvert={max_vertices_per_polygon}]
[format={GDS | OAS}]
[butting={overlap}]
Extract clips (windows) of polygons to GDSII or OASIS files on disk (flat polygonal data)
Equivalent to QisMClipExtract::Extract_polygons
in qismclipextract.h
Requires N licenses of (31209) where N = {n_window_threads} i.e no. clips to extract in parallel
{filedb_id}
represents name of the variable of type QisMFile*
associated with the source database
{window_set_id}
represents name of a variable of type QisMBoxSet*
associated with a set of windows created using script.new_window_set. It MUST contain at least one window
{layer_list}
if specified is a comma-separated list of layer(s) or layer:datatype(s) representing the layers to be extracted. Default: ALL layers are extracted
{cellname}
if specified represents the view cell. Default: default top cell is used
{n_window_thread}
represents the no. clips to be extracted in parallel. {n_threads_per_window}
represents the no. threads to be used per clip for processing (boolean operations)
per_layer_union
if specified unionizes all polygons by layer. Default: extract polygons as-is
clip
if specified clips the data along the window extents. Default: no clipping
{max_vertices_per_polygon}
if specified may result in large polygons being broken up into smaller ones. Default: max. 8190 vertices/polygon
format
represents the output file format. If not specified, clips are extracted but not written to disk
butting
if specified results in unionized polygons with holes represented as pairs of butting polygons where {overlap}
is the amount of overlap along X. This only works if per_layer_union
is used
All the clips are created in the current working directory
xxxxxxxxxx
/* C++ equivalent of clip.extract_polygons */
using namespace std;
using namespace NsQisMLib;
using namespace NsQisMClipExtract;
​
class ClipExtractClient: public QisMClipExtractNotify
{
public:
void* QisMClipExtractNotify_cast(const int version) {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<QisMClipExtractNotify*>(this);
}
return 0;
}
const void* QisMClipExtractNotify_cast(const int version) const {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<const QisMClipExtractNotify*>(this);
}
return 0;
}
int QisMClipExtractNotify_latest_version() const { return 1; }
​
int On_clipextract_polygons(
const char* img_name, const unsigned short layer, const unsigned short dttp,
const QisMClipExtractPolySet* in_set, const QisMClipExtractPolySet* out_set,
const int thread_id, const char* info_msg
)
{
if(info_msg && info_msg[0]) {
fprintf(stdout, "%s\n", info_msg);
}
return 0;
}
};
​
bool clip_extract_polygons(
QisMClipExtract* qismclipx, QisMFile* filedb, QisMBoxSet* wndws,
const char* layers, const char* cell, const int thrnum_w,
const int thrnum_p, const bool per_layer_union, const bool clip,
const int maxvert, const bool butting, const double overlap,
const QisMClipExtractFlags::PolygonFormat format
)
{
assert(qismclipx != NULL);
assert(filedb != NULL);
assert(wndws != NULL);
assert(wndws->Get_count() > 0);
QisMClipExtractPolygonArgs* opts = qismclipx->New_polygon_args();
assert(opts != NULL);
opts->Set_unionize_per_layer(per_layer_union);
opts->Set_max_vert_per_polygon(maxvert);
opts->Set_clip(clip);
opts->Set_polygon_format(format);
opts->Set_butting_mode(butting, overlap);
QisMClipExtractWindowSet* clipwins = qismclipx->New_window_set();
assert(clipwins);
​
string name; double lx = 0.0, ly = 0.0, ux = 0.0, uy = 0.0;
for(int i=0, n=wndws->Get_count(); i<n; i++) {
name = wndws->Get_box(i, lx, ly, ux, uy);
clipwins->Add_window(name.c_str(), lx, ly, ux, uy);
}
acs_assert(clipwins->Count() > 0);
ClipExtractClient clbk;
if(!qismclipx->Extract_polygons(
filedb, layers, cell, clipwins, opts,
dynamic_cast<QisMClipExtractNotify*>(&clbk),
thrnum_w, thrnum_p
))
{
fprintf(
stderr, "error: failed to extract clips, %s",
this->qismclipextract->Last_error_msg()
);
qismclipx->Delete_window_set(clipwins);
qismclipx->Delete_polygon_args(opts);
return false;
}
qismclipx->Delete_window_set(clipwins);
qismclipx->Delete_polygon_args(opts);
return true;
}
xxxxxxxxxx
clip.extract_images
$filedb={filedb_id}
$windows={window_set_id}
resolution={PXS | DPI | DBU},{x}[,{y}]
[layers={layer_list}]
[cell={cellname}]
[thrnum={n_window_threads}]
[invert]
[dither={0.0_to_1.0}]
[right_to_left]
[bottom_to_top]
[format={TIF | BMP | RAW | VBMP}]
Extract clips (windows) of monochrome bitmaps to TIFF/BMP/RAW files on disk
Equivalent to QisMClipExtract::Extract_image
in qismclipextract.h
Requires N licenses of (31209) where N = {n_window_threads} i.e no. clips to extract in parallel
{filedb_id}
represents name of the variable of type QisMFile*
associated with the source database
{window_set_id}
represents name of a variable of type QisMBoxSet*
associated with a set of windows created using script.new_window_set. It MUST contain at least one window
{layer_list}
if specified is a comma-separated list of layer(s) or layer:datatype(s) representing the layers to be extracted. Default: ALL layers are extracted
{cellname}
if specified represents the view cell. Default: default top cell is used
{n_window_threads}
represents the no. clips to be extracted in parallel
invert
if used reverses the image polarity to white (data) on black (background)
dither
if used applies dithering using a 8x8 bayer matrix
right_to_left
if used reverses the bits each row along X. i.e first pixel of a row will represent max-x instead of min-x.
bottom_to_top
is used reverses the order of rows of pixels so that the first row represents the min-y position in data space instead of max-y
format
determines the output file format. TIF is compressed (packbits). BMP and RAW are uncompressed. VBMP
implied bottom-to-top BMP where the BiHeight
parameter of the BITMAPINFOHEADER
is flipped
resolution
can be specified as size of a pixel in file units PXS
, or dots/pixels per inch DPI
, or no. file grids per pixel DBU
. A pixel can be rectangular ( {x}
!= {y}
) or square. If {y}
is omitted, the {x}
value is used to form a square pixel
All the clips are created in the current working directory
xxxxxxxxxx
/* C++ equivalent of clip.extract_images */
using namespace std;
using namespace NsQisMLib;
using namespace NsQisMClipExtract;
​
class ClipExtractClient: public QisMClipExtractNotify
{
public:
void* QisMClipExtractNotify_cast(const int version) {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<QisMClipExtractNotify*>(this);
}
return 0;
}
const void* QisMClipExtractNotify_cast(const int version) const {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<const QisMClipExtractNotify*>(this);
}
return 0;
}
int QisMClipExtractNotify_latest_version() const { return 1; }
​
int On_clipextract_image(
const char* imgName, unsigned char* bufferPtr,
const QisMClipExtractImageInfo* imageInfo, const int threadId,
const char* infoMsg
)
{
if(infoMsg && infoMsg[0]) {
fprintf(stdout, "%s\n", infoMsg);
}
return 0;
}
};
​
bool clip_extract_images(
QisMClipExtract* qismclipx, QisMFile* filedb, QisMBoxSet* wndws,
const char* layers, const char* cell, const int thrnum_w,
const double pixelsize_x, const double pixelsize_y, const bool invert,
const bool right_to_left, const double dither,
const QisMClipExtractFlags::ImageFormat format
)
{
assert(qismclipx != NULL);
assert(filedb != NULL);
assert(wndws != NULL);
assert(wndws->Get_count() > 0);
QisMClipExtractImageArgs* opts = qismclipx->New_image_args();
acs_assert(opts);
opts->Set_dither(dither);
opts->Set_invert(invert);
opts->Set_right_to_left_raster(right_to_left);
opts->Set_image_format(format);
opts->Set_pixelsize(pixelsize_x, pixelsize_y);
QisMClipExtractWindowSet* clipwins = qismclipx->New_window_set();
assert(clipwins);
​
string name; double lx = 0.0, ly = 0.0, ux = 0.0, uy = 0.0;
for(int i=0, n=wndws->Get_count(); i<n; i++) {
name = wndws->Get_box(i, lx, ly, ux, uy);
clipwins->Add_window(name.c_str(), lx, ly, ux, uy);
}
acs_assert(clipwins->Count() > 0);
ClipExtractClient clbk;
if(!qismclipx->Extract_image(
filedb, layers, cell, clipwins, opts,
dynamic_cast<QisMClipExtractNotify*>(&clbk),
thrnum_w, 1
))
{
fprintf(
stderr, "error: failed to extract clips, %s",
this->qismclipextract->Last_error_msg()
);
qismclipx->Delete_window_set(clipwins);
qismclipx->Delete_image_args(opts);
return false;
}
qismclipx->Delete_window_set(clipwins);
qismclipx->Delete_image_args(opts);
return true;
}
xxxxxxxxxx
clip.extract_lsynth
$filedb={filedb_id}
$windows={window_set_id}
lsynth={lsynth_spec}
[cell={cellname}]
[thrnum={n_window_threads},{n_threads_per_window}]
[clip]
[maxvert={max_vertices_per_polygon}]
[format={GDS | OAS}]
[butting={overlap}]
Extract clips (windows) of polygons created from layer synthesis to GDSII or OASIS files on disk (flat polygonal data)
Equivalent to QisMClipExtractV2::Extract_synthesized_polygons
in qismclipextract.h
Requires N licenses of (31209) where N = {n_window_threads} i.e no. clips to extract in parallel
{filedb_id}
represents name of the variable of type QisMFile*
associated with the source database
{window_set_id}
represents name of a variable of type QisMBoxSet*
associated with a set of windows created using script.new_window_set. It MUST contain at least one window
{lsynth_spec}
is the expression for layer synthesis. The detailed syntax can be found here
{cellname}
if specified represents the view cell. Default: default top cell is used
{n_window_thread}
represents the no. clips to be extracted in parallel. {n_threads_per_window}
represents the no. threads to be used per clip for processing (boolean operations)
clip
if specified clips the data along the window extents. Default: no clipping
{max_vertices_per_polygon}
if specified may result in large polygons being broken up into smaller ones. Default: max. 8190 vertices/polygon
format
represents the output file format. If not specified, clips are extracted but not written to disk
butting
if specified results in unionized polygons with holes represented as pairs of butting polygons where {overlap}
is the amount of overlap along X. This only works if per_layer_union
is used
All the clips are created in the current working directory
xxxxxxxxxx
/* C++ equivalent of clip.extract_lsynth */
using namespace std;
using namespace NsQisMLib;
using namespace NsQisMClipExtract;
​
class ClipExtractClient: public QisMClipExtractNotify
{
public:
void* QisMClipExtractNotify_cast(const int version) {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<QisMClipExtractNotify*>(this);
}
return 0;
}
const void* QisMClipExtractNotify_cast(const int version) const {
switch(version) {
case 0: return this;
case 1: return dynamic_cast<const QisMClipExtractNotify*>(this);
}
return 0;
}
int QisMClipExtractNotify_latest_version() const { return 1; }
​
int On_clipextract_polygons(
const char* img_name, const unsigned short layer, const unsigned short dttp,
const QisMClipExtractPolySet* in_set, const QisMClipExtractPolySet* out_set,
const int thread_id, const char* info_msg
)
{
if(info_msg && info_msg[0]) {
fprintf(stdout, "%s\n", info_msg);
}
return 0;
}
};
​
bool clip_extract_polygons(
QisMClipExtract* qismclipx, QisMFile* filedb, QisMBoxSet* wndws,
const char* lsynth_spec, const char* cell, const int thrnum_w,
const int thrnum_p, const bool per_layer_union, const bool clip,
const int maxvert, const bool butting, const double overlap,
const QisMClipExtractFlags::PolygonFormat format
)
{
assert(qismclipx != NULL);
assert(filedb != NULL);
assert(wndws != NULL);
assert(wndws->Get_count() > 0);
assert(lsynth_spec && lsynth_spec[0]);
QisMClipExtractV2* qismclipxv2 = (QisMClipExtractV2*)(
qismclipx->QisMClipExtract_cast(2)
);
if(!qismclipxv2) {
fprintf(stderr, "error: feature not supported. missing API QisMClipExtractV2");
return false;
}
QisMClipExtractSynthArgs* opts = qismclipxv2->New_synth_args();
assert(opts != NULL);
opts->Set_max_vert_per_polygon(maxvert);
opts->Set_clip(clip);
opts->Set_polygon_format(format);
opts->Set_butting_mode(butting, overlap);
QisMClipExtractWindowSet* clipwins = qismclipxv2->New_window_set();
assert(clipwins);
​
string name; double lx = 0.0, ly = 0.0, ux = 0.0, uy = 0.0;
for(int i=0, n=wndws->Get_count(); i<n; i++) {
name = wndws->Get_box(i, lx, ly, ux, uy);
clipwins->Add_window(name.c_str(), lx, ly, ux, uy);
}
acs_assert(clipwins->Count() > 0);
ClipExtractClient clbk;
if(!qismclipxv2->Extract_synthesized_polygons(
filedb, lsynth_spec, cell, clipwins, opts,
dynamic_cast<QisMClipExtractNotify*>(&clbk),
thrnum_w, thrnum_p
))
{
fprintf(
stderr, "error: failed to extract clips, %s",
qismclipxv2->Last_error_msg()
);
qismclipxv2->Delete_window_set(clipwins);
qismclipxv2->Delete_synth_args(opts);
return false;
}
qismclipxv2->Delete_window_set(clipwins);
qismclipxv2->Delete_synth_args(opts);
return true;
}
xxxxxxxxxx
raster.create_params
¶ms={params_id}
pixelsize={x}[,{y}]
[invert]
[dither={0.0_to_1.0}]
[right_to_left]
[bottom_to_top]
[est_buffer_cnt={n_vertices}]
[no_patterns]
[thrnum={n_threads}]
[fill={SOLID | OUTLINE}]
[format={TIF | BMP | VBMP | RAW}]
[nesting={level}]
QisMRaster::New_object("QisMRasterParams")
from qismraster.h{params_id}
represents name of a variable of type QisMRasterParams*
to be associated with the newly created object{x}[,{y}]
represents the resolution for rasterization as size of a pixel along X and Y axes. If {y}
is omitted, {x}
is used along both axesinvert
if used, reverses the image polarity to white (0) data pixels on a black (1) backgrounddither
if used applies dithering to the data areas using 8x8 bayer matrixright_to_left
if used reverses the rasterization direction along X so that the first pixel of each row represents the max-x point in the data space. The last pixel represents the min-x pointbottom_to_top
is used reverses the rasterization direction along Y so that the first row of pixels represent the min-y points in the data space. The last row represents the max-y points{n_vertices}
if used indicates the size of the polygon buffer when thrnum
> 1 (multi-threaded rasterization). Default value is 1,000,000. If set to 0, multi-threading is disabled and each polygon is rasterized on-the-fly (same happens when {n_theads}
== 1)no_patterns
if used, disables cellular pattern recognition. i.e repeating cell data within the image space is NOT used for faster rasterization{n_threads}
determines the number of threads used for rasterization. Default -- no. cpusfill
if used controls the fill mode. Default -- SOLIDformat
if used controls if the image is written to disk in the specified format after rasterization is complete. Default -- no writing to disk {level}
if > 0 specifies the nesting level at which data is to be rasterized. This does not do anything in paint&scratch and layer synthesis modes. Also, if set, cellular pattern recognition will be disabledraster.destroy_params $params={params_id}
QisMRaster::Delete_object("QisMRasterParams")
from qismraster.h{params_id}
represents name of a variable of type QisMRasterParams*
associated with the object to be destroyedraster.create_rasterizer &rstr={rstr_id} $filedb={filedb_id}
QisMRaster::Create_rasterizer
from qismraster.h{filedb_id}
is name of a variable of type QisMFile*
associated with the database linked to serve as the data source for the rasterizer{rstr_id}
is name of the variable of type QisMRasterizer*
to be associated with the newly created rasterizer objectraster.destroy_rasterizer $rstr={rstr_id}
QisMRaster::Destroy_rasterizer
from qismraster.hxxxxxxxxxx
raster.window
$rstr={rstr_id}
outbase={output_dir_and_name}
$params={params_id}
{window={lx},{ly},{ux},{uy} | $windows={window_set_id}}
[cell={cellname}]
[layers={layer_list}]
[grayscale={sample_rate},{bpp}]
Generate a monochrome bitmap from a view of the database
Equivalent to QisMRasterizer::Rasterize_window
from qismraster.h
{rstr_id}
is name of the variable of type QisMRasterizer*
associated with the a rasterizer object
{output_dir_and_name}
is the base path of the output image (directory + file name). The extension will be automatically added based on the format (.tif, .bmp or .raw). See raster.create_params
{params_id}
is name of a variable of type QisMRasterParams*
containing the rasterization parameters. See raster.create_params
{lx},{ly},{ux},{uy}
is the extents of the window (in file units) for which the image is to be generated. Alternately a set of windows can be specified where {window_set_id}
is name of a variable of type QisMBoxSet*
(See script.new_window_set) representing a set of windows to be rasterized with the same parameters
{cellname}
if used is the name of the view cell. Default -- default top cell
{layer_list}
if used is a comma-separated list of layer(s) or layer:datatype(s) to be rasterized in this image
If a format was specified, an image file will be created on disk at the specified base path
grayscale
if specified generates a gray scale image with the specified sampling rate (uniform sampling) and bits per pixel (bpp). Only the following gray scale modes are supported based on the output format:
Format | {sample_rate},{bits_per_px} |
---|---|
TIF , TIF8 , NONE | 2,2 2,4 2,8 4,4 4,8 8,8 |
BMP , VBMP | 2,4 2,8 4,4 4,8 8,8 |
xxxxxxxxxx
raster.synthesized
$rstr={rstr_id}
outbase={output_dir_and_name}
$params={params_id}
{window={lx},{ly},{ux},{uy} | $windows={window_set_id}}
[cell={cellname}]
lsynth={lsynth_spec}
[grayscale={sample_rate},{bpp}]
QisMRasterizer::Rasterize_window_synthesized
from qismraster.h{rstr_id}
is name of the variable of type QisMRasterizer*
associated with the a rasterizer object{output_dir_and_name}
is the base path of the output image (directory + file name). The extension will be automatically added based on the format (.tif, .bmp or .raw). See raster.create_params{params_id}
is name of a variable of type QisMRasterParams*
containing the rasterization parameters. See raster.create_params{lx},{ly},{ux},{uy}
is the extents of the window (in file units) for which the image is to be generated. Alternately a set of windows can be specified where {window_set_id}
is name of a variable of type QisMBoxSet*
(See script.new_window_set) representing a set of windows to be rasterized with the same parameters{cellname}
if used is the name of the view cell. Default -- default top cell{lsynth_spec}
specifies the expression to be used for layer synthesis. See here for syntaxgrayscale
if specified generates a gray scale image. See raster.window for detailsraster.overlay_polys $rstr={rstr_id} $bin={bin_id} [mode={PAINT | SCRATCH | DITHER}]
QisMRasterizerV2::Overlay_polygon_set
from qismraster.h{rstr_id}
is name of the variable of type QisMRasterizer*
associated with the a rasterizer object{bin_id}
is name of the variable of type QisMBStore*
associated with a set of polygons. It can be obtained using various other commands such as exploder.get_boundariesmode
if used specified the overlay mode. Default -- DITHER (overlay polygons with the same dither value as the underlying image). PAINT causes the overlay to be solid regardless of the dither value of the underlying image. SCRATCH causes the overlay to be etched out (cleared) from the underlying imagexxxxxxxxxx
raster.compute_tile_sz
buf_mb={buf_size_mb}
pixelsize={x}[,{y}]
[roi={minx},{miny},{maxx},{maxy}]
[&width={width_id}]
[&height={height_id}]
{buf_sz_mb}
is the estimated buffer size in Mb. to be filled with 1 bit pixels{x}[,{y}]
is the resolution in terms of size of a pixel along X and Y (in file units)roi
if specified determines the aspect ratio of the computed tile size. The aspect ratio of the tile is made to match that of the region of interest (in file units){widht_id}
, {height_id}
if specified represents names of string variables to be associated with the computed width and height respectively. These can then be referenced subsequently in the script as (({width_id}))
and (({height_id}))
respectivelyxxxxxxxxxx
raster.compute_buf_sz
size={width}[,{height}]
pixelsize={x}[,{y}]
{width},[{height}]
are the dimensions of the data window in file units. Square tile implied if {height}
is omitted{x}[,{y}]
is the image resolution in term of size of a pixel in file units. Square pixel implied of {y}
is omittedraster.get_dpi pixelsize={x}[,{y}] [units_m={units_in_meter}] [&var={var_id}]
raster.get_pixelsize dpi={x}[,{y}] [units_m={units_in_meter}] [&var={var_id}]
{x}[,{y}]
is the image resolution in term of size of a pixel in file units (or dots per inch). Square pixel implied of {y}
is omittedunits_m
if specified is the data units in meters. Default: 1e-6 (um){var_id}
if specified represents name of a string variable to be associated with the computed resolution in the format {res_x},{res_y}
. It can be referenced subsequently in the script as (({var_id}))
xxxxxxxxxx
raster.queue_mt
$filedb={filedb_id}
$windows={window_set_id}
$params={raster_params_id}
basepath={image_base_path}
[cell={cellname}]
[layers={layer_string}]
[thrnum_win={n_window_threads}]
[grayscale={sample_rate},{bpp}]
[p&s]
QisMRasterV3::Rasterize_win_queue_mt
or QisMRasterV4::Raster_win_queue_mt_paint_scratch_v2
in qismraster.h{filedb_id}
is name of a variable of type QisMFile*
associated with the database to be used{window_set_id}
is name associated with a variable of type QisMBoxSet*
associated with a list of rectangular windows{raster_params_id}
is name associated with a variable of type QisMRasterParams*
associated with the raster settings object{image_base_path}
is the base path (directory + base-name) of the images. A suffix of the format .{number}
will be added where {number}
is the position of the window in the list. The file extension will be automatically added based on the specified format{cellname}
if specified sets the view cell. Default view cell is the deepest top cell{layer_string}
if specified sets the view layers. Default all layers are ON{n_window_threads}
if specified sets the number of windows to be processed simultaneously. Each window thread will require 1 license of (14827)
for rasterization. Default -- no. of processors in the systemp&s
if specified uses the paint and scratch model instead of the default paint-only model$params
spec.grayscale
if specified generates a gray scale image. See raster.window for detailsxxxxxxxxxx
raster.window_paint_scratch
$rstr={rstr_id}
outbase={output_dir_and_name}
$params={params_id}
{window={lx},{ly},{ux},{uy} | $windows={window_set_id}}
[cell={cellname}]
[spec={layer_spec}]
[grayscale={sample_rate},{bpp}]
Generate a monochrome bitmap from a view of the database with layer based paint-scratch data (v1)
Equivalent to QisMRasterizerV3::Rasterize_window_paint_scratch
from qismraster.h
{rstr_id}
is name of the variable of type QisMRasterizer*
associated with the a rasterizer object
{output_dir_and_name}
is the base path of the output image (directory + file name). The extension will be automatically added based on the format (.tif, .bmp or .raw). See raster.create_params
{params_id}
is name of a variable of type QisMRasterParams*
containing the rasterization parameters. See raster.create_params
{lx},{ly},{ux},{uy}
is the extents of the window (in file units) for which the image is to be generated. Alternately a set of windows can be specified where {window_set_id}
is name of a variable of type QisMBoxSet*
(See script.new_window_set) representing a set of windows to be rasterized with the same parameters
OR {window_set_id}
is name of a variable of type QisMBoxSet*
associated with a set of windows to be rasterized
{cellname}
if used is the name of the view cell. Default -- default top cell
{spec}
if used is a spec. that controls the order of paint and scratch layers as follows --
{{"+"|"-"}<lnum>[:<dnum>]}+
If a format was specified, an image file will be created on disk at the specified base path
grayscale
if specified generates a gray scale image. See raster.window for details
xxxxxxxxxx
raster.px_window
$rstr={rstr_id}
outbase={output_dir_and_name}
$params={params_id}
extents={px_lx},{px_ly},{width_bytes},{height_px}
[cell={cellname}]
[layers={layer_list}]
[grayscale={sample_rate},{bpp}]
QisMRasterizerV4::Rasterize_px_window
in qismraster.h{rstr_id}
is name of the variable of type QisMRasterizer*
associated with the a rasterizer object{output_dir_and_name}
is the base path of the output image (directory + file name). The extension will be automatically added based on the format (.tif, .bmp or .raw). See raster.create_params{params_id}
is a name of a variable of type QisMRasterParams*
associated with the rasterization parameters{px_llx},{px_lly}
are the lower-left co-ordinates of the window in pixel space{width_bytes}
is the image width in bytes{height_px}
is the image height in pixels (or bytes){cellname}
if specified is the view cell (default: default top cell of the file)layers
(if specified) is a comma-separated list of layers to be rasterized (default: ALL)pixel_coordinate = round(file_coordinate/pixelsize)
grayscale
if specified generates a gray scale image. See raster.window for detailsxxxxxxxxxx
raster.create_pns_v2_spec
$rstr={rstr_id}
&spec={spec_id}
[cell={name}]
pxsize={x},{y}
[window={lx},{ly},{ux},{uy}]
​
raster.destroy_pns_v2_spec
$rstr={rstr_id}
$spec={spec_id}
QisMRasterizerV4::Create_paint_scratch_v2_spec / Destroy_paint_scratch_v2_spec
in qismraster.h{rstr_id}
is name of the variable of type QisMRasterizer*
associated with the a rasterizer object{spec_id}
is name of a variable of type QisMRasterPSInfo_p
to be associated with the newly created spec.{name}
(if specified) is the cell to be rasterized{x},{y}
is the resolution in pixel-size (file units){lx}..{uy}
if specified is the window if interest (in file units)raster.destroy_pns_v2_spec
to avoid memory leaksxxxxxxxxxx
raster.window_pns_v2
$rstr={rstr_id}
outbase={output_dir_and_name}
$params={params_id}
{window={lx},{ly},{ux},{uy} | $windows={window_set_id}}
[cell={cellname}]
[$spec={spec_id}]
[layers={layer_string}]
[grayscale={sample_rate},{bpp}]
QisMRasterizerV4::Rasterize_window_paint_scratch_v2
in qismraster.h{rstr_id}
is name of the variable of type QisMRasterizer*
associated with the a rasterizer object{output_dir_and_name}
is the name associated with this raster image. It will be used as the base path (directory + filename) if this image is written to disk as TIFF/BMP/RAW{params_id}
is a name of a variable of type QisMRasterParams*
associated with the rasterization parameters{lx} .. {uy}
are the lower-left and upper-right co-ordinates of the window to be rasterized (in file units){window_set_id}
is name of a variable of type QisMBoxSet*
associated with the set of windows to be rasterized{cellname}
(if specified) is the name of the cell to be rasterized. (default: the deepest top cell in the file){spec_id}
(if specified) is name of a variable of type QisMRasterPSInfo_p
associated with the spec. (default: spec will be computed internally)layers
if specified is a comma-separated list of layer
(s) or layer:datatype
(s) to be rasterized. Default: ALL
grayscale
if specified generates a gray scale image. See raster.window for detailsxxxxxxxxxx
raster.large_disk_image
$filedb={filedb_id}
window={lx},{ly},{ux},{uy}
$params={params_id}
bufsz={mb}
[overlap={px}]
[base={path}]
[cell={name}]
[layers={list}]
[thrnum={n}]
[alloc={rn}{rd}{sn}{sd}]
[grayscale={sample_rate},{bpp}]
[p&s]
Rasterize an image to disk that is too large to hold in a single buffer in memory
Equivalent to C++ QisMRasterV4::Rasterize_large_disk_image
or QisMRasterV4::Rasterize_large_disk_image_paint_scratch_v2
in qismraster.h
{filedb_id}
is name of a variable of type QisMFile*
associated with the database to be used
{lx}..{uy}
are the extents of the window in file units
{params_id}
is name of a variable of type QisMRasterParams*
containing the rasterization parameters. See raster.create_params
{mb}
is the buffer size to be used as a guide to control how much memory is allocated for rasterization (in Megabytes). See alloc=
to understand how memory is allocated based on this parameter
overlap=
if specified is the amount of overlapping rows between bands in pixels (default: 10)
base=
if specified is the output dir+filename. (default: out)
cell=
if specified is the view cell to be rasterized (default: deepest top cell)
layers=
if specified is the comma-separated list of layers to be rasterized (default:ALL)
thrnum=
if specified is the number of bands to be rasterized in parallel threads (default: no. cpus)
alloc=
if specified is the allocation scheme to be used
(A/B)*(bufsz_mb)
while the amount of memory to be allocated for stitching the bands is (C/D)*(bufsz_mb)p&s
if specified uses the paint and scratch model instead of the default paint-only model
If a format was specified, an image file will be created on disk at the specified base path
grayscale
if specified generates a gray scale image. See raster.window for details
xxxxxxxxxx
corrx.create_opts
&opts={opts_id}
[thrnum={n_threads}]
[bufcount={polygon_buffer_count}]
[source={layer_offset}]
QisMCorrX::Create_object("QisMCorrOpts")
from qismcorrx.h{opts_id}
is name of a variable of type QisMCorrOpts*
to be associated with the newly created options object {n_threads}
if specified is the number of threads to use for computing corrections. Default = 0 (use the no. logical processors in the system){polygon_buffer_count}
if specified is the estimated buffer size (no. polygon vertices) for storing polygons for multi-threaded processing (n_threads > 1). Default: 64K{layer_offset}
if specified outputs source polygons (in addition to the corrected polygons) at the specified layer offset from the source polygons. i.e the source polygons will be sent to (layer + layer_offset):datatype and the corrected polygons will be sent to the original layer:datatype. Default: Source polygons are not sent to outputcorrx.destroy_opts
to avoid memory leakcorrx.destroy_opts $opts={opts_id}
QisMCorrX::Destroy_object("QisMCorrOpts", ..)
from qismcorrx.h{opts_id}
is name of a variable of type QisMCorrOpts*
to be associated with the options object to be destroyedxxxxxxxxxx
corrx.create_corrx_obj
&corrx={corrx_id}
$filedb={filedb_id}
corrections={x},{y},{dx},{dy}{,{x},{y},{dx},{dy}}*
[cell={cellname}]
QisMCorrX::Create_correction_object
from qismcorrx.h{corrx_id}
is name of a variable of type QisMCorrXObj*
to be associated with the newly created correction object{filedb_id}
is name of a variable of type QisMFile*
that represents the file database to be used as the source for polygons{x},{y},{dx},{dy}
represents a single measured correction point. At least ONE such correction point MUST be specified{cellname}
if specified represents the view cell. Default: The deepest top cell in the file is usedcorrx.destroy_corrx_obj
corrx.destroy_corrx_obj $corrx={corrx_id}
QisMCorrX::Destroy_correction_object
from qismcorrx.h{corrx_id}
is name of a variable of type QisMCorrXObj*
associated with the correction object to be destroyedxxxxxxxxxx
corrx.scale_view
$filedb={filedb_id}
scale={x}[,{y}]
[cell={cellname}]
[&var={var_id}]
{filedb_id}
is name of a variable of type QisMFile*
associated with the database in question{x}
is the scale value in X. {y}
if specified, is the scale value in Y. Otherwise, {y} = {x}
. Scale values MUST be greater than the file grid{cellname}
if specified sets the view cell. Default: deepest top cell{var_id}
if specified, sets a string variable of that name to the computed correction points in the format {x1},{y1},{dx1},{dy1} ... {x4},{y4},{dx4},{dy4}
so that it can be reference elsewhere in the script using (({var_id}))
. E.g it can be used for corrx.create_corrx_objxxxxxxxxxx
corrx.rotate_view
$filedb={filedb_id}
angle={degrees}
[cell={cellname}]
[&var={var_id}]
{filedb_id}
is name of a variable of type QisMFile*
associated with the database in question{cellname}
if specified sets the view cell. Default: deepest top cell{var_id}
if specified, sets a string variable of that name to the computed correction points in the format {x1},{y1},{dx1},{dy1} ... {x4},{y4},{dx4},{dy4}
so that it can be reference elsewhere in the script using (({var_id}))
. E.g it can be used for corrx.create_corrx_objxxxxxxxxxx
corrx.shear_view
$filedb={filedb_id}
edge={RIGHT | LEFT | BOTTOM | TOP}
amount={shear_value}
[cell={cellname}]
[&var={var_id}]
{filedb_id}
is name of a variable of type QisMFile*
associated with the database in questionedge
specifies the direction of applying shear of amount {shear_value}
in file units{cellname}
if specified sets the view cell. Default: deepest top cell{var_id}
if specified, sets a string variable of that name to the computed correction points in the format {x1},{y1},{dx1},{dy1} ... {x4},{y4},{dx4},{dy4}
so that it can be reference elsewhere in the script using (({var_id}))
. E.g it can be used for corrx.create_corrx_objxxxxxxxxxx
corrx.mirror_view
$filedb={filedb_id}
about={X | Y | XY}
[cell={cellname}]
[&var={var_id}]
{filedb_id}
is name of a variable of type QisMFile*
associated with the database in question{cellname}
if specified sets the view cell. Default: deepest top cell{var_id}
if specified, sets a string variable of that name to the computed correction points in the format {x1},{y1},{dx1},{dy1} ... {x4},{y4},{dx4},{dy4}
so that it can be reference elsewhere in the script using (({var_id}))
. E.g it can be used for corrx.create_corrx_objcorrxobj.print_corrected_extents $corrx={corrx_id} [&var={var_id}]
QisMCorrXObj::Get_corrected_extents
from qismcorrx.h{corrx_id}
is name of a variable of type QisMCorrXObj*
associated with a correction object{var_id}
if specified is name of a string variable that will store the corrected extents in {minx},{miny},{maxx},{maxy}
format so that it can be references elsewhere in the script using (({var_id}))
xxxxxxxxxx
corrxobj.correct_view
$corrx={corrx_id}
window={minx},{miny},{maxx},{maxy}
&bin={bin_id}
[$opts={opts_id}]
[layers={layer_string}]
[domains={domain_layer}]
QisMCorrXObj::Get_corrected_polys
from qismcorrx.h{corrx_id}
is name of the variable of type QisMCorrXObj*
associated with the correction object to be used for computing corrections{minx}..{maxy}
are the co-ordinates of the window to be processed (in file units){bin_id}
is name of a variable of type QisMBStore*
to be associated with the newly created container of corrected polygons{opts_id}
if specified is name of a variable of type QisMCorrOpts*
associated with the correction options object. Default: default options apply{layer_string}
if specified sets the layers of interest. Default: ALL loaded layers are usedcorrxobj.delete_store
to avoid memory leak{domain_layer}
if specified, requires the original and corrected domains (quadrilaterals formed by anchor points in the data space where corrections are pre-computed) to be added to the polygon container on the specified layer number. {domain_layer}:0
represents domains in the original data space and {domain_layer}:1
represents domains in the corrected data spacexxxxxxxxxx
corrx.correct_polys
$corrx={corrx_id}
$in={input_bin_id}
&out={output_bin_id}
[$opts={opts_id}]
[domains={domain_layer}]
QisMCorrXObj::Correct_polygons
from qismcorrx.h{corrx_id}
is name of the variable of type QisMCorrXObj*
associated with the correction object to be used for computing corrections{input_bin_id}
is name of a variable of type QisMBStore*
associated with the set of polygons to be corrected{output_bin_id}
is name of a variable of type QisMBStore*
to be associated with the newly created set of corrected polygons{opts_id}
if specified is a variable of type QisMCorrOpts*
associated with the corrections options object{domain_layer}
if specified, requires the original and corrected domains (quadrilaterals formed by anchor points in the data space where corrections are pre-computed) to be added to the polygon container on the specified layer number. {domain_layer}:0
represents domains in the original data space and {domain_layer}:1
represents domains in the corrected data spacecorrxobj.delete_store
to avoid memory leakxxxxxxxxxx
corrxobj.rasterize_window
$corrx={corrx_id}
$rstr={rstr_id}
$params={rstr_params_id}
window={minx},{miny},{maxx},{maxy}
[layers={layer_string}]
QisMCorrXObjV2::Rasterize_corrected_window
from qismcorrx.h{corrx_id}
is name of the variable of type QisMCorrXObj*
associated with the correction object to be used for computing corrections{rstr_id}
is name of the variable of type QisMRasterizer*
associated with a rasterizer object to be used for generating the image{rstr_params_id}
is name of the variable of type QisMRasterParams*
associated with the raster settings object{minx}..{maxy}
are the extents of the window in the original data space to be corrected and rasterized. The data extents of the image will be corrected equivalent (manhattan) of the specified window{layer_string}
if specified set the layers to be used. Default: all loaded layers are used and rasterized to the same imagecorrxobj.delete_store $bin={bin_id}
corrxobj.correct_view
xxxxxxxxxx
corrxobj.correct_window_extents
$corrx={corrx_id}
window={lx},{ly},{ux},{uy}
[&var={var_id}]
{corrx_id}
is name of variable of type QisMCorrXObj*
associated with the correction object{lx}..{uy}
are the extents of the window to be corrected in file units{var_id}
if specified is name of a string variable to store the extents of the new corrected windowRequires the QisMGerber extension to be installed and loaded
Some commands may require a license (2756)
See qismgerber.h for corresponding C++ API
xxxxxxxxxx
/* C++ code to get a handle to the QisMGerber API */
​
using namespace NsQisMGerber;
using namespace NsQisMLib;
​
/*------------------------------------------------------------------------------
Get access to the QisMGerber api
* `qismlib_` is the handle to the QisMLib api
* on success, returns a handle to the QisMGerber api
------------------------------------------------------------------------------*/
static QisMGerber* qm_gerber_api(
QisMLib* qismlib_
)
{
assert(qismlib_);
​
fprintf(
stdout, "\n> locating qismgerber api.. (%s %s : %d)\n", __FUNCTION__,
__FILE__, __LINE__
);
​
QisMExtensionAPI* extn = qismlib_->Get_extension_api(QISMEXTENSION_GERBER);
if(!extn) {
fprintf(
stderr,
"error: failed to locate extension '%s', check the installation, " \
"config. file and extension report for qismgerber dll/so",
QISMEXTENSION_GERBER
);
return 0;
}
return (QisMGerber*)(extn->Extension_class_ptr());
}
xxxxxxxxxx
gerber.load
&filedb={filedb_id}
path={gerber_file_path}
[workdir={working_dir_path}]
[arcres={value}] [arcsag={value}[,{unit}]]
[butting={overlap}[,{unit}]] [cutlines]
[thrnum={n_threads}]
[dbg]
[advanced={adv_args}]
[newunits={INCH | MIL | CM | MM | UM}]
Create a QisM database from a Gerber file
Equivalent to QisMGerber::Load_gerber
in qismgerber.h
filedb_id
is name of variable of type QisMGerberFile*
to be associated with the newly created database object
{gerber_file_path}
is the path to a valid RS274X file to be used as the source
{working_dir_path}
if specified, is path of an existing directory with read+write+execute permissions to be used to create the working directory
arcres
and arcsag
control how arcs are approximated as line segments. Default arc resolution is 45.0 and default arcsag (chord error) is 1.0 um. {unit}
if specified MUST be INCH, MIL, CM, MM or UM and indicates the unit for the specified chord error. If chord error is specified without a unit, it assumes the unit of the source Gerber file
butting
if specified converts polygons with holes into polygons with butting edges along X. {overlap}
indicates the amount of overlap about the butting edges in the specified {unit}
(INCH, MIL, CM, MM or UM). butting
is ON by default with an overlap of 0.0. Using cutlines
instead, turns butting OFF and polygons with holes have cutlines (along Y) connecting the holes to outer boundary
{n_threads}
if specified indicates the no. threads to be used for processing Gerber source. By default, it is set to the no. cpus in the system
dbg
if specified retains the temporary working files and execution logs for troubleshooting. By default, all working files are deleted once the database is destroyed
{adv_args}
are reserved for internal use
newunits
if specified creates the QisM database in the specified units (INCH, MIL, CM, MM or UM). By default, the database is created in UM
Requires ONE license of (2756). The license is released once the database is created
Multiple databases can be active simultaneously
Every Gerber database MUST be eventually destroyed using gerber.unload
This command also creates a new variable of type QisMFile*
with the name {filedb_id}
so that the database can be used with other commands in the QisMScript system
xxxxxxxxxx
/* Equivalent C++ code */
using namespace NsQisMGerber;
using namespace NsQisMLib;
​
/*------------------------------------------------------------------------------
Notification handler for QisMGerber progress updates
------------------------------------------------------------------------------*/
class QmGerberProgress: public QisMGerberNotify
{
public:
/*----------------------------------------------------------------------------
Required as part of the class version system
----------------------------------------------------------------------------*/
const char* QisMGerberNotify_name() const { return "QmGerberProgress"; }
void* QisMGerberNotify_cast(const int version_) {
switch(version_) {
case 0: return this;
case 1: return dynamic_cast<QisMGerberNotify*>(this);
}
return 0;
}
​
const void* QisMGerberNotify_cast(const int version_) const {
switch(version_) {
case 0: return this;
case 1: return dynamic_cast<const QisMGerberNotify*>(this);
}
return 0;
}
​
int QisMGerberNotify_latest_version() const { return 1; }
​
/*----------------------------------------------------------------------------
Progress update notification
----------------------------------------------------------------------------*/
int On_qismgerber_progress(const char* msg_) {
if(msg_ && msg_[0]) fprintf(stdout, "%s\n", msg_);
return 0;
}
};
​
/*------------------------------------------------------------------------------
Create a QisM database from a Gerber file
* `qismlib_` is the handle to the QisMLib api
* `qismgerber_` is the handle to the QisMGerber api
* `gerber_path_` is the path of a valid Gerber (RS274X) file
* `working_dir_` is the path of a writable working directory (default: CWD)
* `arcres_` is the arc resolutin in degrees
* `arcsag_` is the chord error in the specified units (`arcsag_unit_`)
* `butting_` if true breaks polygons with holes into polygons with butting edge
along X
* `butting_overlap_` is the amount of overlap along the butting edges in the
specified units (`overlap_unit_`)
* `thrnum_` is the no. threads to be used for the gerber translation
* `filedb_units_` are the units for the new database
* `dbg_` if true retains the temporary working files for debugging
* `advanced_` is reserved for internal use
* on success, returns a handle to the QisMGerber api
------------------------------------------------------------------------------*/
static QisMGerberFile* qm_gerber_load(
QisMLib* qismlib_,
QisMGerber* qismgerber_,
const char* gerber_path_,
const char* working_dir_ = 0,
const double arcres_ = 45.0,
const double arcsag_ = 1.0,
const int arcsag_unit_ = QisMGerberOpts::UNT_UM,
const bool butting_ = true,
const double butting_overlap_ = 0.0,
const int overlap_unit_ = QisMGerberOpts::UNT_UM,
const int thrnum_ = 0,
const int filedb_units_ = QisMGerberOpts::UNT_UM,
const bool dbg_ = false,
const char* advanced_ = 0
)
{
assert(qismlib_);
assert(qismgerber_);
assert(gerber_path_ && gerber_path_[0]);
​
fprintf(
stdout, "\n> loading gerber '%s'.. (%s %s : %d)\n", gerber_path_, __FUNCTION__,
__FILE__, __LINE__
);
​
//create the options object
QisMGerberOpts* opts = (QisMGerberOpts*)(qismgerber_->New_object("QisMGerberOpts"));
assert(opts);
​
//set various options as specified
opts->Set_param(QisMGerberOpts::PRM_ARCRES, arcres_);
opts->Set_param(QisMGerberOpts::PRM_ARCSAG, arcsag_);
opts->Set_param(QisMGerberOpts::PRM_ARCSAG_UNIT, arcsag_unit_);
opts->Set_param(QisMGerberOpts::PRM_POLY_BUTTING, butting_ ? 1 : 0);
if(butting_) {
opts->Set_param(QisMGerberOpts::PRM_POLY_BUTTING_OVERLAP, butting_overlap_);
opts->Set_param(QisMGerberOpts::PRM_POLY_BUTTING_OVERLAP_UNIT, overlap_unit_);
}
opts->Set_param(QisMGerberOpts::PRM_THRNUM, thrnum_);
opts->Set_param(QisMGerberOpts::PRM_OUTPUT_UNIT, filedb_units_);
opts->Set_param(QisMGerberOpts::PRM_DBG_MODE, dbg_ ? 1 : 0);
if(advanced_ && advanced_[0]) opts->Set_param(QisMGerberOpts::PRM_ADV_ARGS, advanced_);
​
//load the gerber file
QisMGerberFile* filedb = 0; QmGerberProgress progress_cb;
int ecode = qismgerber_->Load_gerber(
filedb, qismlib_, gerber_path_, working_dir_, opts,
dynamic_cast<QisMGerberNotify*>(&progress_cb)
);
if(ecode != 0) {
fprintf(
stderr, "error: failed to load gerber [%s] %s\n",
qismgerber_->Get_error_tag(ecode),
qismgerber_->Get_error_msg(ecode)
);
}
​
//delete the options object
qismgerber_->Delete_object("QisMGerberOpts", opts);
return filedb;
}
gerber.unload $filedb={filedb_id}
Destroy a database created from Gerber source
filedb_id
is name of variable of type QisMGerberFile*
associated with the database to be destroyed
Equivalent to QisMGerber::Unload_gerber
in qismgerber.h
xxxxxxxxxx
/* Equivalent C++ code */
using namespace NsQisMGerber;
using namespace NsQisMLib;
​
/*------------------------------------------------------------------------------
Destroy a QisMGerber database
* `qismgerber_` is the handle to the QisMGerber database
* `filedb_` is the handle to the database to be destroyed
------------------------------------------------------------------------------*/
static void qm_gerber_unload(
QisMGerber* qismgerber_, QisMGerberFile* filedb_
)
{
if(qismgerber_ && filedb_) {
fprintf(
stdout, "\n> unloading gerber db.. (%s %s : %d)\n", __FUNCTION__,
__FILE__, __LINE__
);
qismgerber_->Unload_gerber(filedb_);
}
}
gerberfile.save_gds $filedb={filedb_id} path={output_gds_path}
Create a GDSII file from the current Gerber data
filedb_id
is name of variable of type QisMGerberFile*
associated with the Gerber database
{output_gds_path}
is the path of the output GDSII file
The output will have the same layers, units and grid as the database.
Equivalent to QisMGerberFile::Save_to_gdsii
in qismgerber.h
xxxxxxxxxx
/* Equivalent C++ code */
using namespace NsQisMGerber;
using namespace NsQisMLib;
​
/*------------------------------------------------------------------------------
Export a GDSII file from the QisMGerber database
* `filedb_` is the handle to the database to be destroyed
* `gds_path_` is the path for the output file to be created
------------------------------------------------------------------------------*/
static bool qm_gerberfile_save_gds(
QisMGerberFile* filedb_, const char* gds_path_
)
{
assert(filedb_);
assert(gds_path_ && gds_path_[0]);
​
fprintf(
stdout, "\n> exporting gdsii '%s' from gerber.. (%s %s : %d)\n", gds_path_,
__FUNCTION__, __FILE__, __LINE__
);
​
int ecode = filedb_->Save_to_gdsii(gds_path_);
if(ecode != 0) {
fprintf(
stderr, "error: failed to save gdsii, [%s] %s\n",
filedb_->Get_error_tag(ecode),
filedb_->Get_error_msg(ecode)
);
return false;
}
return true;
}
hextract.create_extractor &extractor={extractor_id} $filedb={filedb_id}
QisMHExtract::Create_extractor
in qismhextract.h{extractor_id}
is name of a variable of type QisMHExtractor*
to be associated with the newly created object{filedb_id}
is name of a variable of type QisMFile*
associated with the database to be used as the source for extractionhextract.destroy_extractor $extractor={extractor_id}
{extractor_id}
is name of variable of type QisMHextractor*
associated with the extractor to be destroyedhextract.create_extractor
xxxxxxxxxx
hextract.create_opts
&opts={opts_id}
[flatten]
[text]
[nopaths]
[sliver={sliver_value},{min_area}]
[top={top_cell_name}]
[onlyrefs={cellname_or_regex}]
[droprefs={ALL | CHILD},{cellname_or_regex}]
[txy={dx},{dy}]
[scale={scale}]
[angle={degrees}] [flipy]
[prename={cellname_prefex}]
[postname={cellname_suffix}]
[layeroffx={l_offx},{d_offx}]
[clip={OFF | DROP_POLYS | DROP_DATA}]
Create an instance of the extraction settings object
Equivalent to QisMHExtract::New_object("QisMHExtractOpts")
in qismhextract.h
Every settings object MUST be eventually destroyed using hextract.destroy_opts
{opts_id}
is name of variable of type QisMHExtractOptsV2*
to be associated with the newly created object
flatten
if used, removes all hierarchy and generates a flat output (boundaries, paths, texts). Default: hierarchical output
text
if used extracts TEXT elements. (default: no TEXTs)
nopaths
if used converts paths to boundaries. Default: Paths are extracted as-is (except for the ones that are clipped)
{sliver_value}
and {min_area}
represent the sliver and min. area for polygons to be extracted. Default: all polygons are extracted no matter how small.
{top_cell_name}
if used sets the name of the top cell in the output file. Default: same name as the view cell (being extracted)
onlyrefs
if used extracts references only to those cells whose names match the specified list of name(s) or regular expression(s) and are immediate children of the cell being extracted. Any child reference whose cell name does not match the specified filter will be dropped. Default: all applicable references are extracted
droprefs
if used drops references only to those cells whose names match the specified list of name(s) or regular expression(s). If ALL
is specified, all matching references are dropped regardless of the nesting level. If CHILD
is specified, only the matching references that are immediate children of the view cell are dropped. Default: all applicable references are extracted
txy
if used translates the output by the specified offset {dx},{dy}
in file units. Default: 0.0,0.0
scale
if used scales the output. Default: 1.0
angle
if used rotates the output with the specified amount in degrees. Default: 0.0
{cellname_prefix}
adds a pre-fix to names of all the extracted cells. Default: No prefix
{cellname_suffix}
adds a suffix to names of all the extracted cells. Default: No suffix
layeroffx
offsets all extracted layers by the specified layer number {l_offx}
and datatype number {d_offx}
. Default: 0,0
clip
if used sets the clipping policy for elements partially crossing the clipping regions as follows:
OFF
DROP_DATA
DROP_POLYS
Default
hextract.destroy_opts $opts={opts_id}
QisMHExtract::Delete_object("QisMHExtractOpts")
in qismhextract.h{opts_id}
is name of variable of type QisMHExtractOptsV2*
associated with the object to be destroyedhextract.create_regions ®ions={regions_id} [complement]
QisMHExtract::New_object("QisMHextractRegions")
in qismhextract.h{regions_id}
is name of variable of type QisMHextractRegions*
to be associated with the newly created containercomplement
if specified creates a complement of the specified regions w.r.t the extents of the view cell. Default: offhextract.destroy_regions
to avoid memory leakxxxxxxxxxx
hextractregions.add
$regions={regions_id}
[$boxes={boxset_id}]
[$bstore={grid_m},{units_m},{bstore_id}]
{box={minx},{miny},{maxx},{maxy}}*
{poly={x1},{y1}..{xn},{yn},{x1},{y1}}*
{circle={x},{y},{radius},{arcres},{arcsag}}*
{regions_id}
is name of variable of type QisMHextractRegions*
associated with the container to store regions of interest{boxset_id}
if specified is name of variable of type QisMBoxSet*
associated with a set of boxes to be imported into this container$bstore
if specified represents a set of polygons to be added to this container. {bstore_id}
is name of a variable of type QisMBStore*
associated with the set of polygons to be added. {grid_m}
and {units_m}
are the grid and units in meters associated with the polygon set (or the file db)box
if specified (one or more times) represents a single box to be added to this container. {minx}..{maxy}
are it's extents in file unitspoly
if specified (one or more times) represents a single closed polygon to be added to this container. {x1},{y1}...
are the co-ordinates in file unitscircle
if specified (one or more times) represents a single circular polygon to be added to this container. {x},{y}
(the center) and {radius}
are in file units.hextract.extract_regions $regions={regions_id}
QisMHExtract::Delete_object("QisMHextractRegions")
in qismhextract.h{regions_id}
is name of variable of type QisMHextractRegions*
to be associated with the container to be destroyedxxxxxxxxxx
hextractor.extract_to_file
$extractor={extractor_id}
out={output_base_path}
units={grid_m},{units_m}
[format={GDS | OAS}]
[cell={cellname}]
[layers={layer_string}]
[$regions={regions_id}]
[$opts={opts_id}]
QisMHExtractor::Extract
along with QisMHExtractor::Create_file_writer
from qismhextract.h{extractor_id}
is name of a variable of type QisMHExtractor*
associated with the hierarchy extractor{output_base_path}
is the base path (directory + filename) where the output file will be created. Extension will be added automatically depending on the format{grid_m}
and {units_m}
are the output grid and units respectively in metersformat
if specified sets the output file format (default: GDS){cellname}
if specified sets the view cell (to be extracted). Default: deepest top cell{layer_string}
is a comma-separated list of layers to be extracted{regions_id}
if specified is name of a variable of type QisMHextractRegions*
associated with the container of regions of interest. Default: Extents of the view cell{opts_id}
if specified is name of a variable of type QisMHExtractOptsV2*
associated with the extraction settingsxxxxxxxxxx
hextractor.extract_to_writer
$extractor={extractor_id}
$writer={cadwriter_id}
[cell={cellname}]
[layers={layer_string}]
[$regions={regions_id}]
[$opts={opts_id}]
[cnvunits]
QisMHExtractor::Extract
from qismhextract.h{extractor_id}
is name of a variable of type QisMHExtractor*
associated with the hierarchy extractor{cadwriter_id}
is name of a variable of type QisMCADWriterV2*
associated with a writer open for composing a GDSII/OASIS file{cellname}
if specified sets the view cell (to be extracted). Default: deepest top cell{layer_string}
is a comma-separated list of layers to be extracted{regions_id}
if specified is name of a variable of type QisMHextractRegions*
associated with the container of regions of interest. Default: Extents of the view cell{opts_id}
if specified is name of a variable of type QisMHExtractOptsV2*
associated with the extraction settingscnvunits
if specified scales the extracted data appropriately to match the grid, units of the output file so that the dimension of the extracted data (in meters) remains unchanged. This option is only used if the grid of the source data does not match the grid of the outputxxxxxxxxxx
hextract.create_db
&hextdb={hextdb_id}
$filedb={filedb_id}
[cell={cellname}]
[layers={layer_string}]
[$regions={regions_id}]
[$opts={opts_id}]
[dbg]
[workdir={path}]
[format=GDS|OAS]
[layermap={layermap_str}]
[notext]
{hextdb_id}
is name of variable of type QisMHExtractFile*
associated with the database object to be created{filedb_id}
is name of variable of type QisMFile*
associated with the database object to serve as the source for extraction{cellname}
if specified is the view cell to extract from (default: top cell with the deepest hierarchy or the largest extents){layer_string}
if specified is a comma-separated list of {layer}[:{datatype}]
representing the layers to be extracted (default: all layers){regions_id}
if specified is name of variable of type QisMHExtractRegions*
associated with a set of clipping regions (default: no clipping){opts_id}
if specified is name of variable of type QisMHExtractOptsV2*
associated with the extraction settings (default: extraction with default parameters)dbg
if specified preserves the temporary working files even after the database is destroyed for the purpose of debugging/diagnostics (default: temporary working files are removed upon database deletion)workdir
if specified sets the location for creating temporary working files (default: current working directory)format
if specified controls the underlying format of the database (default: OAS)layermap
if specified applies a layer map to the new database being created. See lib.load_file
for details. (default: all extracted layers are loaded as-is)notext
if specified ignores TEXT elements from the extracted datahextract.destroy_db
to avoid resource leakshextract.destroy_db $hextdb={hextdb_id}
QisMHExtractV2::Destroy_db
from qismhextract.h{hextdb_id}
is name of variable of type QisMHExtractFile*
associated with the database object to be destroyedhextractfile.save_as $hextdb={hextdb_id} path={output_file_path}
{hextdb_id}
is name of variable of type QisMHExtractFile*
associated with the database object to be created{output_file_path}
is the path where the copy is to be madexxxxxxxxxx
hextract.select_dbu
{dbu={grid_m},{units_m}}+
&grid_m={grid_id}
&units_m={units_id}
grid_m
is the source grid in meters. units_m
is the source units in meters. e.g a um file with nm resolution has a dbu of 1e-9,1e-6
{grid_id}
is name of a string variable to store the grid value of the selection. {units_m}
is name of a string variable to store the units of the selectionxxxxxxxxxx
twofiles.xor
$filedb={id1},{id2}
[cell={cell1},{cell2}]
[layers={layers_string}]
[limit={count}]
[thrnum={n_tiles},{n_per_tile}]
[gds={output_gds_path}]
[sliver={sliver_fileunits}]
[complexity={n_vertices_per_tile}]
[partial=TILES,{pct_tiles}]
[partial=LAYERS,{pct_layers}]
{id1},{id2}
are names of variables of type QisMFile*
associated with the databases to be compared{cell1},{cell2}
if specified are the names of the view cells of each database to be compared (default: deepest/largest top cell of each db){layers_string}
if specified is a comma-separated list of layers of interest. Only the specified layers will be compared (default: ALL layers from the first db). Each layer of interest MUST be present in both databases{count}
if specified terminates the comparison as soon as the computed differences exceed the specified limit. If {count} == 0
, the comparison computes all the differences (default: 1){n_tiles}
represents the no. threads to be created to process one tile of the view at a time (default: no. processors in the system). {n_per_tile}
is the no. threads per tile to perform XOR (default: 1){output_gds_path}
if specified writes the computed XOR to a GDSII file (default: no GDSII output)sliver
if specified removes XOR results smaller than the specified value (in file units){n_vertices_per_tile}
if specified determines how the per-layer space is broken up into tiles for parallel computation (default: 5000). The larger the value of {n_vertices_per_tile}
, the more intensive the XOR computation is and should be matched with an appropriate no. threads ({n_per_tile}
){pct_tiles}
if specified limits the no. tiles to be compared per layer to the specified percentage of the total no. of tiles allocated to that layer. The selection of tiles is random and therefore this can be used to do a quicker test (default: 100 -- full test){pct_layers}
if specified limits the no. layers to be compared to the specified percentage of the layers of interest (or all layers). The selection of layers is random and therefore this can be used to do a quicker test (default: 100 -- all of the specified/available layers)xxxxxxxxxx
semiflat.new_opts
&opts={opts_id}
[workdir={path}]
[dbg]
[cell={cellname}]
[layers={layers_str}]
[notext]
[nopath]
[repeats={min_repetitions}]
[format=GDS|OAS]
[noaref]
[match=NAMES:{comma_sep_cellnames}]
[nesting={min},{max}]
[minarea={value}]
[reparea={value}]
[noxform]
[window={lx},{ly},{ux},{uy}]
[topname={output_top_name}]
[prename={pre}]
[postname={post}]
[loffset={layer},{dttp}]
QisMSemiFlat::New_object("QisMSemiFlatOpts")
in qismsemiflat.h{opts_id}
is name of a variable of type QisMSemiFlatOpts*
to be associated with the newly created objectworkdir
if specified sets the working directory for temporary files. Default: current working directorydbg
if specified retains the temporary working files even after the database is destroyed{cellname}
if specified set the view cell to be extracted. Default: top cell will the deepest nesting level{layers_str}
if specified is a comma-separated string of layer or layer:datatype representing the layers to be extracted. Default: ALL layersnotext
if specified ignores TEXT elements during extraction. Default: TEXT elements are also extractednopath
if specified converts paths to boundaries. Default: paths are extracted as-is{min_repetitions}
if specified is the minimum number of times a cell reference with a unique transformation must occur to be extracted as a reference instead of being flattened. Default: 2format
if specified set the format of the semi-flat file. Default: OASnoaref
if specified writes array references as component single references in the output. Default: arefs are written as-ismatch:NAMES
if specified preserves only references to the specified cells (comma-separated list of names) as references in the output. References to all other cells will be flattened. nesting
if specified sets the minimum and maximum nesting level for a cell reference to be extracted as a reference in the output. Default: All nesting levelsminarea
if specified sets the minimum area in file units for a cell reference to be extracted as a reference. Default: 0.0reparea
if specified sets the minimum total area (in file units) of repeating elements of cell references for those references to be extracted as a reference. Default: 0.0noxform
if specified ensures that all references in the output have no transformation. Candidate cell references with different transformations are extracted as new cells. This also causes arefs to be converted to component srefs. Default: cell references in the output can have transformationswindow
if specified extracts only the data crossing the specified window (without clipping). Default: extents of the view celltopname
if specified sets the name of the top cell in the output. Default: same as the view cellprename
if specified adds a prefix to all child cells in the output. Top cell name is not changedpostname
if specified adds a suffix to all child cells in the output. Top cell name is not changedloffset
if specified offsets all layer and datatype numbers by the specified amountsemiflat.delete_opts
to avoid memory leaksemiflat.delete_opts $opts={opts_id}
QisMSemiFlat::Delete_object("QisMSemiFlatOpts", ..)
in qismsemiflat.hxxxxxxxxxx
semiflat.create_db
&semidb={semidb_id}
$filedb={filedb_id}
[$opts={opts_id}]
Create a new database from semi-flat data extracted from the source database
Equivalent to QisMSemiFlat::Create_semiflat_db
in qismsemiflat.h
Requires ONE license of (11119) which is release once the database is created
{semidb_id}
is name of a variable of type QisMSemiFlatFile*
associated with the semi-flat database to be created
{filedb_id}
is name of a variable of type QisMFile*
associated with the source database
{opts_id}
if specified is name of a variable of type QisMSemiFlatOpts*
associated with the settings object
Every database object created by this commands MUST be eventually destroyed using semiflat.destroy_db
to avoid memory/resource leaks
This command creates FOUR variables for use in subsequent commands:
{semidb_id}
and type QisMSemiFlatFile*
representing the semi-flat db{semidb_id}
and type QisMFile*
representing the underlying QisMFile database{semidb_id}.grid
and type string
representing the database grid in meters{semidb_id}.units
and type string
representing the database units in meterssemiflat.destroy_db $semidb={semidb_id}
QisMSemiFlat::Destroy_semiflat_db
in qismsemiflat.hsemiflatfile.save_as $semidb={semidb_id} path={output_file_path}
{semidb_id}
is name of a variable of type QisMSemiFlatFile*
associated with the semi-flat database{output_file_path}
is the path of the output file on disksemiflat.create_extractor &extractor={extractor_id} $filedb={filedb_id}
QisMSemiFlat::Create_extractor
in qismsemiflat.h{extractor_id}
is name of a variable of type QisMSFExtractor*
to be associated with the newly created object{filedb_id}
is name of a variable of type QisMFile*
associated with the database to be used as a sourcesemiflat.destroy_extractor
to avoid memory/license leakssemiflat.destroy_extractor $extractor={extractor_id}
QisMSemiFlat::Destroy_extractor
in qismsemiflat.h{extractor_id}
is name of a variable of type QisMSFExtractor*
associated with the object to be destroyedxxxxxxxxxx
sfextractor.extract_to_file
$extractor={extractor_id}
path={output_file_path}
[$opts={opts_id}]
[format=GDS|OAS]
QisMSFExtractor::Extract
from qismsemiflat.h{extractor_id}
is name of a variable of type QisMSFExtractor*
associated with the extractor object{output_file_path}
is the path of the file to be created{opts_id}
if specified is name of a variable of type QisMSemiFlatOpts*
associated with the settings objectformat
if specified indicates the output file format. Default: GDSxxxxxxxxxx
sfextractor.extract_to_writer
$extractor={extractor_id}
$writer={writer_id}
[$opts={opts_id}]
QisMSFExtractor::Extract
from qismsemiflat.h{extractor_id}
is name of a variable of type QisMSFExtractor*
associated with the extractor object{writer_id}
is name of a variable of type QisMCADWriterV2*
associated with the CAD writer object{opts_id}
if specified is name of a variable of type QisMSemiFlatOpts*
associated with the settings objectxxxxxxxxxx
patterns.create_from_view
&patterndb={patterndb_id}
$filedb={filedb_id}
[cell={name}]
[layers={list}]
[window={minx},{miny},{maxx},{maxy}]
[jitter={dbu}]
[layerless]
{patterndb_id}
is name of variable of type QisMPolyPatternDB*
to be associated with the newly created pattern db{filedb_id}
is name of a variable of type QisMFile*
associated with the file database to be used as the sourcecell
if specified is the name of the view cell (otherwise, the default top cell is used)layers
is a comma-separated list of layer[:datatype]
numbers representing the layers of interest (otherwise all loaded layers are used)window
if specified is the window of interest in file units (otherwise the entire view cell is used)jitter
if specified is the margin of error in database units to be applied while comparing polygons (default: 0). For a um file with nm grid, 1um = 1000 dbu.layerless
if specified does NOT separate polygons based on layer:datatype numbers (default: two identical polygons with separate layer:datatype are treated as separate patterns)patterns.destroy
to avoid memory, license leaksxxxxxxxxxx
patterns.create_from_bstore
&patterndb={patterndb_id}
$bin={bin_id}
[jitter={dbu}]
[layerless]
{patterndb_id}
is name of variable of type QisMPolyPatternDB*
to be associated with the newly created pattern db{bin_id}
is name of a variable of type QisMBStore*
associated with the file database to be used as the sourcejitter
if specified is the margin of error in database units to be applied while comparing polygons (default: 0). For a um file with nm grid, 1um = 1000 dbu.layerless
if specified does NOT separate polygons based on layer:datatype numbers (default: two identical polygons with separate layer:datatype are treated as separate patterns)patterns.destroy
to avoid memory, license leaksxxxxxxxxxx
patterns.destroy $patterndb={patterndb_id}
{patterndb_id}
of type QisMPolyPatternDB*
xxxxxxxxxx
patterns.write_to_file
$patterndb={patterndb_id}
path={output_dir_and_filename}
units={units_m},{grid_m}
[cellbase={name}]
[format=GDS|OAS]
[layers={ON|OFF},{list}]
[numvert={min},{max}]
[loci={min},{max}]
{patterndb_id}
is name of variable of type QisMPolyPatternDB*
associated with the pattern db in question{output_dir_and_filename}
is the base path of the output file. extension (,gds or .oas) is automatically added based on the file format{units_m}
is the output file units in meter and {grid_m}
is the output file grid in meter. e.g a um file with nm grid has units=1e-6,1e-9
cellbase
if specified represent the name of the top cell and the base name of all pattern (children) cells. default -- POLYformat
if specified sets the file format (and extension). default -- GDSlayers
if specified filters the patterns to be written based on the specification. {list}
is a comma-separated list of layer[:datatype]
numbers. If ON
, only the specified layers are written. If OFF
only the specified layers are NOT written. default -- all qualifying patterns are written regardless of their layer:datatype
numvert
if specified filters the patterns to be written based on the number of vertices it contains. {min}
and {max}
represents the range of acceptable no. vertices. default -- 0,-1 writes all qualifying patterns regardless if their vertex countloci
if specified filters the patterns to be written based on the number of locations where the pattern repeats. {min}
and {max}
represents the range of acceptable no. locations. default -- 0,-1 writes all qualifying patterns regardless of the no. repeating locations
xxxxxxxxxx
gbrpsfile.print_meta $filedb={id}
{id}
is name of a variable of type QisMGbrPSFile* associated with the db created from a Gerber filexxxxxxxxxx
gbrpsfile.save_gds $filedb={filedb_id} path={output_gds_path}
{output_gds_path}
is the path of the output GDSII file{filedb_id}
is name of a variable of type QisMGbrPSFile* associated with the db created from a Gerber filexxxxxxxxxx
gbrps.unload $filedb={filedb_id}
{filedb_id}
is name of a variable of type QisMGbrPSFile* associated with the db created from a Gerber filexxxxxxxxxx
gbrps.load
&filedb={filedb_id}
path={gbr_file_path}
workdir={wdir_path}
[maxpts={num}]
[arcres={degrees}]
[arcsag={value}[{unit}]]
[thrnum={num}]
[unit=um]
[rotate={90x}]
[mirror=x|y|xy]
[scale={x}[,{y}]]
[advanced={args}]
[dbg]
{filedb_id}
is name of a variable of type QisMGbrPSFile* to be associated with the newly created db {gbr_file_path}
is the path of a valid RS274X Gerber file{wdir_path}
if specified sets the working directory for the creation of temporary files. Default: CWDmaxpts
sets the max. no. vertices in the output db. Default: 8190arcres
and arcsag
if specified control the smoothness of arcs as they are converted to polygons. {unit}
can be inch, mils, mm, cm, um or nm. Default: 45 deg and 1,um respectivelythrnum
specifies the no. threads to be used for Gerber translation. Default: no. cpus in the systemunit=um
if specified creates the db in um
. Default: same units as the source dbrotate
if specified rotates the design by the specified angle. MUST be a multiple of 90 degrees. Default: 0mirror
if specified reflects the design along X (flip x), Y (flip y) or XY (both x,y). Default: No reflectionscale
if specified scales the design along X and optionally Y. If Y is omitted, {x} = {y}
advanced
is a comma-separated list of args meant for the underlying Gerber engine. To be only used in consultation with the Artwork teamdbg
if specified preserves the temporary files for troubleshooting. Default: Temp. files are deleted when the db is destroyedQisMFile*
with same name {filedb_id}
so that the db can be used with other commands of the QisMLib scripting system. It also creates two other string variables of names {filedb_id}.grid
and {filedb_id}.units
set to the db grid and units in meters