QisMGbrip - High Performance Gerber Raster Application
This application is a very high performance rasterizer for Gerber(RS274X) data. It replaces both GBR_RIP and GBR2GRAYSCALE — our previous high performance RIPs. Those rasterizers are based on programming architectures which were developed more than 25 years ago and since that time Artwork has made many enhancements to rasterizers that can't be back-ported into GBR_RIP.
Further, this new RIP operates inside of our QisMLib framework which makes adding functionality to the rasterizer much easier due to the modular approach to handling large amounts of vector and bitmap data. It relies very much on two QisMLib extension libraries: QisMRaster and QisMGbrPS.
Usage
The application is driven from a command line. A summary of the command line and it's arguments is shown below:
qismgbrip64.exe {REQUIRED} [GERBER OPTIONS] [WINDOW OPTIONS] [RASTER OPTIONS] [MISC. OPTIONS]
Required Arguments
Input File Path
+input:(gbr_file_name_and_path}
the file name and path to the Gerber file (RS274X) that is to be rasterized
Output Base Path
+out:{output_dir+filename}
the filename extension is automatically generated based on the type of output bitmap selected.
Image Resolution
+resolution:{xres}[,{yres}[,{unit}|dpi]]
- {xres} and {yres} are the resolution along X and Y respectively. If only {xres} is specified, the resolution is uniform along X and Y (square pixels)
- If {unit} is omitted, the resolution values are interpreted as the size of a pixel in the same units as the loaded QisMFile database. See QisMFile units for more information
- If {unit} is specified, the resolution values are interpreted as size of a pixel in the specified units. Allowed values are:
- If dpi is specified, the resolution values are interpreted as dots per inch
- Resolution values can be floating point
GERBER Options
Working Directory
-workdir:{temp_dir_path}
- If specified, set a path where a folder containing temporary files will be created
- If omitted, the temporary files folder is created in the current working directory
- The folder name starts with the keyword qismgbrps
QisMFile units
-um
- specified, all the data in the QisMFile database is in microns. This will also be the default units for all the command-line parameters
- If omitted, the data in the QisMFile database is in the same units as the source Gerber file (inch or mm)
Max. points per polygon
-maxpts:{upto_8190}
- If specified, set the max. vertices per polygon. MUST be less than 8190
- Default is 8190
Arc Resolution
-arcres:{degrees}
- Specify the Arc Resolution in degrees for segmenting arc-like edges of polygons
- If the Chord error is specified, the finer of the two values is used
- If not specified, a default chord error of 1um is used
Chord error
-arcsag:{chord_error}[,{unit}]
- Specify the Chord Error for segmenting arc-like edges of polygons
- {unit} if specified, can be one of the following: inch,mils,cm,mm,um
- If {unit} is omitted, the chord error is assumed to be in QisMFile units
- If the Arc resolution is specified, the finer of the two values is used
- If not specified, a default chord error of 1.0,um is used
Keep temporary files
-dbg
- If specified, keep the temporary folder and all it contents after program exit
- By default, the temporary folder is deleted before program exit
- See Working directory for information about where to find the temporary folder
Apply Transformations
-rotate:{90x}
-mirror:x | -mirror:y | -mirror:xy
-scale:{sx}[,{sy}]
- Rotate by a multiple of 90 degrees and then rasterize
- Mirror along X (:x) or along Y (:y) or both X and Y (:xy)
- Scale in X and Y. If only {sx} is specified, the scaling is uniform ({sx} == {sy}). Otherwise, scaling applied along X and Y separately
Apply Sizing
-sizing:{sizing_x},{sizing_y}[,{units}]
- Apply +ve/-ve sizing along X and Y
- {sizing_x},{sizing_y} MUST have the same sign (>0.0 or <0.0) or MUST be both 0.0
- Unless specified, the units for the sizing values are same as that of the QisMFile units
- {units} can be inch, mils, cm, mm, um
Advanced Gerber options
-advanced:GBR,{option}[,{option}]*
- Specify advanced options for fine control of the Gerber import process
- The options are specified as a comma-separated list
- Use of this feature is only for advanced users who have deeper understanding of the Gerber import process and/or have been instructed by Artwork to do so
Advanced Sizing options
-advanced:SZ,{option}[,{option}]*
- Specify advanced options for fine control of the sizing routine
- The options are specified as a comma-separated list
- Use of this feature is only for advanced users who have deeper understanding of the Gerber import process and/or have been instructed by Artwork to do so
- Options currently supported:
-critdim:{value_um}
-corners:5pt OR -corners:mnh
-pseudoctlnrem:{value_um}
-sliver:{value_um}
GDSII/OASIS/DBLOAD Options
View Layers
Specify a comma-separated list of layer(s) or layer:datatype(s) to be extracted. Data on all other layers will be discarded
e.g -layers:1,2:2,3,4:4,4:5
Default: Data will be sourced from all layers
View Cell
Specify the name of the cell to be extracted (view cell)
Default: Deepest root cell in the file will be used as the view cell
Window Options
Lower left upper right
-tile:LLUR,{lx},{ly},{ux},{uy}[,{unit}]
Add one tile by specifying it's lower left {lx},{ly} and upper right {ux},{uy} co-ordinates
{unit} if specified associates the co-ordinates of the tile in one of the following:inch, mils, cm, mm, um
If {unit} is omitted, the co-ordinates are assumed to be in QisMFile units
Lower left width height
-tile:LLWH,{lx},{ly},{width},{height}[,{unit}]
Add one tile by specifying it's lower left {lx},{ly} and size {width},{height}
{unit} if specified associates the co-ordinates of the tile in one of the following:inch, mils, cm, mm, um
If {unit} is omitted, the co-ordinates are assumed to be in QisMFile units
Center width height
-tile:CWH,{cx},{cy},{width},{height}[,{unit}]
Add one tile by specifying it's center {cx},{cy} and size {width},{height}
{unit} if specified associates the co-ordinates of the tile in one of the following:inch, mils, cm, mm, um
If {unit} is omitted, the co-ordinates are assumed to be in QisMFile units
Lower left upper right text file
@tiles:LLUR,{file_path}[,{unit}]
Specify a list of tiles from a text file at {file_path} where each line is the lower left and upper right co-ordinates of one tile
{width},{height} is the size of every tile in the file
{unit} if specified associates the co-ordinates of the tile in one of the following:inch, mils, cm, mm, um
If {unit} is omitted, the co-ordinates are assumed to be in QisMFile units
Width height lower left text file
@tiles:WHLL,{file_path},{width},{height}[,{unit}]
Specify a list of tiles from a text file at {file_path} where each line is the lower left co-ordinates of one of many equal sized tiles
{width},{height} is the size of every tile in the file
{unit} if specified associates the co-ordinates of the tile in one of the following:inch, mils, cm, mm, um
If {unit} is omitted, the co-ordinates are assumed to be in QisMFile units
Width height center text file
@tiles:WHC,{file_path},{width},{height}[,{unit}]
Specify a list of tiles from a text file at {file_path} where each line is the center co-ordinate of one of many equal sized tiles
{width},{height} is the size of every tile in the file
{unit} if specified associates the co-ordinates of the tile in one of the following:inch, mils, cm, mm, um
If {unit} is omitted, the co-ordinates are assumed to be in QisMFile units
Row column tiles
-tiles:RC,{nx},{ny}[,{lx},{ly},{ux},{uy}[,{unit}]]
Break the region on interest into {nx} x {ny} columns x rows of equal sized tiles
{lx}..{uy} if specified are the extents of the region of interest. If omitted, the home view (extents of the design) is the region of interest
{unit} if specified associates the co-ordinates of the tile in one of the following:inch, mils, cm, mm, um
If {unit} is omitted, the co-ordinates are assumed to be in QisMFile units
Row column tiles by size
-tiles:WH,{width},{height}[,{unit}[,{lx},{ly},{ux},{uy}]]
Break the region on interest into equal sized tiles of size {width} x {height}
{unit} if specified associates the co-ordinates of the tile in one of the following:inch, mils, cm, mm, um
If {unit} is omitted, the co-ordinates are assumed to be in QisMFile units
{lx}..{uy} if specified are the extents of the region of interest. If omitted, the home view (extents of the default top cell) is the region of interest
Arbitrary clips
-tiles:LIST,[{unit}:]{width},{height}{,{cx},{cy}}+
Specify an arbitrary list of points that are centers ({cx},{cy}) of equal sized ({width},{height}) tiles
At least one such point MUST be present
{unit} if specified associates the co-ordinates of the tile in one of the following:inch, mils, cm, mm, um
If {unit} is omitted, the co-ordinates are assumed to be in QisMFile units
Randomly generated clips
-tiles:RAND,{width},{height},{count}[,{unit}[,{lx},{ly},{ux},{uy}]]
Generate a somewhat uniformly distributed yet randomly located list of equal size ({width},{height}) tiles
{count} MUST be > 0
{unit} if specified associates the co-ordinates of the tile in one of the following:inch, mils, cm, mm, um
If {unit} is omitted, the co-ordinates are assumed to be in QisMFile units
{lx}..{uy} if specified serves as the overall bounds a.k.a region of interest. If omitted, the home view (extents of the design) is the region of interest
Raster Options
Invert image polarity
-invert
If specified, the foreground (data) is white (pixel bit = 0), background is black (pixel bit = 1)
Reverse raster direction along X
-right-to-left
If specified, the direction of rasterization is reversed along X. I.e. min-x of the data appears on the R.H.S of the image and the max-x of the data appears on the L.H.S of the image creating the appearance of the image being mirrored about it's local Y axis
Reverse raster direction along Y
-bottom-to-top
If specified, the direction of rasterization is reversed along Y. I.e. min-y of the data appears as the first row of pixels in the image and the max-y of the data appears as the last row of pixels in the image creating the appearance of the image being mirrored about it's local X axis
Image file format
-format:TIF | -format:{BTF | TIF8} | -format:RAW | -format:BMP | -format:VBMP | -format:NONE
Specify the output file format (and the file extension).
TIF refers to TIFF file format with packbits compression and 1bit/pixel (bpp).
BTF or TIF8 refers to Big TIFF file format with packbits compression and 1bit/pixel (bpp).
RAW refers to a dump of the raster image with a small header. The header is defined as follows:
Byte 0-6 (7) : LGRAW00.
Byte 7-10 (4) : Image width in pixels.
Byte 11-14 (4) : Image height in pixels.
Byte 15-22 (8) : Image size in bytes.
Byte 23- (Image size in bytes) : Raster image dump.
BMP is the Bitmap file format without compression and 1bpp.
VBMP is same as BMP except that the height parameter in the header is positive (thereby having the same effect at -bottom-to-top depending on how the BMP reader makes use of the height paramter).
NONE generates the raster image but does not write it to disk.
Default file format is TIF
Dithering using a 8x8 Bayer Matrix
-dither:{0.0_to_1.0}
If specified, get a dithered output using a standard 8x8 Bayer matrix for a value between 0.0 and 1.0.
Default: 1.0
Force the use of large disk image rasterization
-band:{est_buf_size_mb}[,{allocation_scheme}]
If specified and no. tiles = 1, force the rasterizer to use the large disk image technique.
By default, the rasterizer uses information such as no. tiles, raster image size and available system memory to determine the best approach for generating raster image(s). The large disk image technique is used only of no. tiles = 1 and the image size > 75% of the available system memory.
{est_buf_size_mb} controls how much memory to use for rasterization and formatting (writing to disk). Default is 2048 mb.
{allocation_scheme} controls the ratio of the amount allocated for rasterization and that for formatting depending on performance bottle-neck:
It is a four-digit number of the form {A}{B}{C}{D}.
Amount of memory allocated for rasterization = {A} * {est_buf_size_mb} / {B}.
Amount of memory allocated for formatting = {C} * {est_buf_size_mb} / {D}.
Suggested & default: -band:{1/3 total phys. mem},1111.
Generate gray scale image
-grayscale:{sample_rate},{bits_per_px}
If specified, the raster output is converted to gray scale.
Only select values are allowed for {sample_rate},{bits_per_px} based on the desired format as shown below:
Format {sample_rate},{bits_per_px}
TIF, BTF, 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
Misc Options
Thread control
-thrnum:{primary}[,{secondary}]
Control the number of threads to be allocation to different parts of the operation.
For importing Gerber, no. threads = greater value of {primary} and {secondary}.
For rasterization, the use of {primary} and {secondary} depends on the rasterization technique used.
For ONE tile:
In large disk image mode, {primary} controls the no. sub-bands to be rasterized in parallel and {secondary} controls the no. threads to rasterize each sub-band.
Otherwise, no. threads used to rasterize the entire image = greater value of {primary} and {secondary}.
For more than one tiles: {primary} controls no. tiles to be rasterized in parallel and {secondary} controls no. threads to rasterize each tile.
Default: {primary} = {secondary} = no. cpu(s) / 2
Logging
-log:{new_log_file_path} | -log+:{append_log_file_path}
If specified, append to/create an execution log at the specified path
Run quietly in the background
-silent
If specified, run quietly in the background by supressing all execution messages sent to stdout/stderr