web_header.gif

Sample Application for GBRUnion LIB

Artwork provides a sample application, gbrunion_dynamic.exe, which illustrates how to use the library. We provide source code and project files for this sample app so that an OEM programmer can study it to see how to effectively use the library.

command line syntax

Command Line Syntax

DLL API Options
---------------

-wdir:dir			Specify working directory.
				(default: current working directory).

 Gerber RS274X Input/Output Controls
------------------------------------ 

-aptin:apt_file			Specify apt_file as aperture file to be used to format RS274d files into RS274X.

 
Conversion Settings and Parameter Controls 

-arcres:degrees			Specify arc resolution in degrees.
				(default: 9.0).

-arcsag:value[unit]		Specify chord error in Gerber input units or units specified.
				unit can be: INCH, MIL, CM, MM, or UM. 
				(default: 0.0).

-useotherunits:unit		Specify output unit where unit can be:
				INCH, MIL, CM, MM, or UM.
				(default: Input_Gerber_Unit).

-outscale:value			Scale output data by value.

-offset:x[unit],y[unit]         Offset data by (x,y).
				unit can be: INCH, MIL, CM, MM, or UM.  No unit implies Gerber input units.

-xform:xform_parms		Set transformation settings (comma separated).
				xform_parms is rotation_parms,mirror_parms,scale_parms,offset_parms
				rotation_parms are anchor_x[units],anchor_y[units],rotation
				mirror_parms are mirror_x,mirror_y
				scale_parms are scale_x,scale_y
				offset_parms are offset_x[units],offset_y[unit]
				unit can be: INCH, MIL, CM, MM, or UM.  No unit implies Gerber input units.

Output Geometry Controls
------------------------

-emblevel                       Order polygons into layers of ascending order reflecting polygonal containment.
				-polyformat argument is made inactive by this.
				
-polyformat:fmt			Specify polygon format where fmt can be.
				leonov
				cutlines
				butting

-overlapvalue:value[unit] 	Generates an overlap of value in butting mode.
				unit can be: INCH, MIL, CM, MM, or UM.  No unit implies Gerber input units.
				(use it with -polyformat:butting).

-outputgrid:value		Specifies value of what output grid the data snaps to.

-maxpoints:vertex_num		Limit polygon vertex count to vertex_num.
				Do not use with leonov polyformat.

-reversal:marginx[unit],marginy[unit] 	Specify image reversal.
                                        unit can be: INCH, MIL, CM, MM, or UM.  
                                        No unit implies Gerber input units.
                                        marginx increases background on leftt and right.
                                        marginy does it on top and bottom.
                                        Do not use with leonov polyformat.

-fmtauto|best			Tells Gerber preconditioner, split274x, to push format
				to best format, 2.6 inch or 3.5 mm, if -fmtbest is called.
				Otherwise, it uses auto mode to correct: bad format, mult-defined apt., high dcode.
				(Default -fmtbest).

-macro_tol:val[unit]		Set Gerber preconditioner, split274x, macro tolerance
				into value, val, used for identifying similar aperture macros.
				unit can be: INCH, MIL, CM, MM, or UM.  No unit implies Gerber input units.
				(Default 0.001 MM or 0.00004 Inch).

-nosplit			Prevent Gerber preconditioner, split274x, from running.

-circularize			Circularize polygons.
				Each circular vertex has 5 data [x y center_x center_y radius]

-circularize:2			Circularize polygons. Use for Debug only.
				But only output [x y] values for each vertex

 
Data Partitioning Controls
--------------------------

-single_part			Turns off data partitioning (not recommended).
				Enforces single threaded operation.  
				Negatively affects throughput.
				To be used for special cases.

-joinpart			Turns on data partition joining.

-manpart			Specifies that data partitioning is user specified.

-partition_nx:number		Specifies the number of vertical stripes for data partitioning.
				(used with -manpart).

-partition_ny:number		Specifies the number of horizontal stripes for data partitioning.
				(used with -manpart).

-autopartrcarray		Partition data in a rectangular array.


Data Sizing and Smoothing Controls
----------------------------------

-sizingvalue:value[unit] 	Grow data by positive value.  Shrink data by negative value.
				unit can be: INCH, MIL, CM, MM, or UM.  No unit implies Gerber input units.

-slivervalue:value[unit] 	Remove data narrower than value.
				unit can be: INCH, MIL, CM, MM, or UM.  No unit implies Gerber input units.

-smoothingvalue:value[unit] 	Specifies value for removing consecutive points closer than value.
				unit can be: INCH, MIL, CM, MM, or UM.  No unit implies Gerber input units.


Clipping Controls
-----------------

-window:xmin[unit],ymin[unit],xmax[unit],ymax[unit] Clip data to specified window.
				unit can be: INCH, MIL, CM, MM, or UM.  No unit implies Gerber input units.

-polywin:file			Clip data to file containing polygonal clipping windows in the following form:
				    No. of polygons == N
				    polygon 1
				    ...
				    polygon N
				Each polygon m where m is [1-N] is in form of:
				    No. of vertices == n
				    xy 1
				    ...
				    xy n
				Each xy m where m is [1-n] is in form of:
				    x y which is a pair of XY data in input Gerber units.


Flow Controls
-------------

-force32bit			Force use of 32 bit executables instead of 64 bit.
				(default: Use 64 bit in 64 bit OS and 32 bit in 32 bit OS).

-skip_gdscompact		Skip using gdscompact program, optimization for RS274X SR data.

-passthru			This flattens incoming Gerber data without unionizing (i.e. no flashes or SR data).

-thrnum:n			Specify the number of threads to be used is n.


Diagnostic Controls
------------------- 

-dbg				Keep intermediate files.
-no_warnings			Suppress warning messages.
-no_errors			Suppress error messages.


Engine Arguments
------------------- 
-bgn_mgr_args [args] -end_mgr_args	         Add additional arguments, [args], to gbrunmgr engine.

-bgn_gdscomp_args [args] -end_gdscomp_args 	 Add additional arguments, [args], to gdscompact engine. 

-engargs [args]		                         Add additional arguments, [args], to boolean engine. This must be placed at the end of the command line.

			
Test Program Options
--------------------

-dll:dll_filename		Specify Gerber Union DLL. 
                                dll_filename is its full name. (default: Same as executable path).
-o:output_txt			Specify output file of Test Program.

-gbr			        Specify output format of Test Program to be Gerber.

-useProgressCB			Use callback function for progress display.




Command Line Examples

We want to convert a file called icsxseed.gbr into ascii using Leonov style polygons. The window we wish to extract goes from 5,5 to 6,6 (i.e about an inch square from a larger board)

Carriage returns have been inserted only for clarity. Comments are in italics.


"C:\WCAD\Gbrunion DLL\bin\gbrunion_dynamic.exe"           starts the calling application

"C:\WCAD\Gbrunion DLL\examples\icsxseed.gbr"              input file to process

"-dll:C:\WCAD\Gbrunion DLL\artwork\gbrunion.dll"          points to the location of the library

"-wdir:C:\WCAD\Gbrunion DLL\examples\work"                working directory is defined

"-o:C:\WCAD\Gbrunion DLL\examples\out\icsxseed_win.txt"   output file location and name

-thrnum:1                                                 number of concurrent threads

-useProgressCB                                            tells the app to use a callback for progress

-polyformat:leonov                                        tells the program to create Leonov polys

-window:5,5,6,6                                           extract this window: LLx,LLy,URx,URy