STL2GDS Command Line Syntax
Those who wish to call the stl2gds engine from another program or script should use the following syntax:
The command line uses the following syntax:
stl2gds.exe input_file output_file gds_layer -z:z_value -gds [options]
where stl2gds.exe name (and path) of the executable input_file name (and path) of the input STL file. output_file name (and path) of the output GDSII file. gds_layer layer on which to produce the GDSII data (also a comma delimited list i.e. 0,1,2,3) -z:z_value the z_value for the "slice" (also a comma delimited list i.e. 0.56,0.62,0.75,0.98) -gds tells the engine to output GDSII stream format. [options] -incr:ZZ the -incr (increment) parameter is used when the designer wants a series of equally spaced slices commencing at a given Z value and rising by the increment amount. -linc:N the layer increment controls the stepping of the GDSII layer number and is used together with the -incr command line if the layer increment is to be a value other than 1. -info instead of actually performing the slicing and conversion, the -info command instructs the stl2gds engine to calculate the X,Y,Z extents and to count the number of facets in the database. -scale:X instructs stl2gds to scale up (or down) the data by the scale value X. Default = 1. -units:UNIT units of the output GDSII file: UM, MM, CM, INCH, MIL, NM (default = MM) -grid:XXX grid resolution of the output GDSII file. typical grid values would be 0.001 for UM, 0.000001 for MM
The following examples should help clarify the function of the command line arguments.
Example 1 Getting Info
stl2gds.exe stlinput.stl out.gds -info
This command line executes stl2gds on the input file stlinput.stl. It does not produce an output file (even though one should be listed on the command line) but because of the -info argument it scans the STL file and outputs a file called out.log to disk that contains the X,Y,Z extents and the number of facets in the file.
Example 2 Slice at Z=0.1
stl2gds.exe c:\test_files\input.stl c:\test_files\results\output.gds 1 -z:0.1
in this example stl2gds will process a file called input.stl, slice it at Z=0.1 and output the results to a file called output.gds (note that input.stl and output.gds are not in the same directory). Since the user failed to supply a unit argument the GDSII file will be in units of MM and the output grid is determined by the "extents" of the STL file. This is not a recommended command line - the designer should always specify the units and grid values.
Example 3 Multiple Slices, Comma Delimited
stl2gds.exe input.stl output.gds 1,7,19 -z:1.5,3.2,0.8 -units:MM -grid:0.000001
In this example stl2gds will produce data on multiple layers:
elevation gdsii layer number 1.5 1 3.2 7 0.8 9
by using a comma delimited list for the gdsii layer numbers and the z values for the slices.
Example 4 Multiple Slices, Incremented
stl2gds.exe input.stl output.gds 1 -z:0.1 -incr:0.02 -units:MM -grid:0.000001
In this example stl2gds will produce data on multiple layers starting at z=0.1 and incrementing by Z=0.02 until it reaches the "top" of the data extents. Assuming the Z values top out at 2.1 the following layers would be produced.
elevation gdsii layer number 0.10 MM 1 0.12 2 0.14 3 0.16 4 0.18 5 0.20 6
Example 5 Multiple Slices, Incremented II
stl2gds.exe in.stl out.gds 0 -z:0.1 -incr:0.02 -lincr:5 -units:MM -grid:0.000001
In this example stl2gds will produce data on multiple layers starting at z=0.1 and incrementing by Z=0.02 until it reaches the "top" of the data extents. Assuming the Z values top out at 2.1 the following layers would be produced. The GDSII layers corresponding to these slices begin at 0 and are incremented by 5.
elevation gdsii layer number 0.10 MM 0 0.12 5 0.14 10 0.16 15 0.18 20 0.20 25
Example 6 Scaling & Units
stl2gds.exe input.stl output.gds 1 -z:0.1 -scale:1000 -units:UM -grid:0.001
In this example the STL file was produced in units of millmeters but the GDSII file should be output in microns. This requires that the data be scaled up by 1000; however the slice height is specified prior to scaling.
elevation gdsii layer number 0.1 1