Source Forge | NC Drill files | Gerbv viewer SourceForge.net Logo

gbtiler home page

RS274X Gerber Printed Circuit Board Tiling Utility

 

Summary:

Gbtiler is a program that can offset and merge gerber and NC drill files that represent circuit board artwork. The program is written in Perl and licensed under the GNU public license. Latest release is version 2.0, now considered a beta release by gbtiler's primary maintainer.

An improved gbtiler version 2p1 will soon be posted and available on the Sourceforge download site. A special thanks to programmers at Mercé for bringing the Perl code in line with Perl's 'Use strict' coding standards. Mercé team members have also added a Perl makefile with install target, and a manual page.

For the 2p0 version please read the 2.0 manual for script installation, typical use, and file format information.

When version 2p1 is available please read the file MANIFEST for build and install steps, located in the parent directory of the unbundled gbtiler-2p1 package.

 

 
Important links:

OUTSIDE DOCUMENTS   WITHIN-DOCUMENT LINKS
  • download gbtiler files
  • version 2.0 manual
  • example tiled images
     
  • web CVS repository -- down, see SourceForge site issue.
  • CVS how-to for developers
  • contact the developer
  •  
  • news
  • works in progress
  • works described
  • ideas for future development
  •  

     

    ^ gbtiler news:


    2004-09-08 After successful use of gbtiler for the latest Portland State Aerospace Society prototype board run, two limitations have come to light in gbtiler 2.0.

    First limitation is that the current release of gbtiler does not correctly parse negative coordinate data in gerber files and possibly in drill files. Second limitation is that the drill racks handling part of the program fails to catch embedded tool definition lines in some NC drill files.

    The second issue looks like a relatively simple fix, requiring small changes to the parsing algorithm for embedded drill racks. The first issue may be a little more involved.

    The gbtiler development team is now working on solutions to these shortfalls.

     

    2004-08-15 Gbtiler version 2.0 now released! Visit the file download page to download and use the gzip'd, tarred archive. Please report bugs to developer Ted.

     

    2004-08-06 Gbtiler 2.0 implementation is largely complete. After a day or two more of testing and work on a user manual, developer Ted tentatively plans to release an alpha version of the scripts comprising gbtiler 2.0.

    With this release there will of course be improvements to make and bugs to fix. However, two significant betterments evident during the current 2.0 development work include that: 1) gbtiler 2.0 runs reasonably fast and 2) diagnostics have been simplified and moved closer to a "within project" standard format.

    Gbtiler 2.0 tiles typical input file sets in seconds rather than the minutes taken by the previous version. This improvement in speed of processing files has allowed for rapid testing and debugging. On the development/coders' side, including small hash tables within each package to toggle diagnostic statements on and off has also speeded debugging considerably.

    The version 2.0 release will most likely contain three directories, one each for Perl source code, documentation, and thirdly sample gerber and NC drill and gbtiler arguments files.

     

    2004-07-24 Of the five significant packages in gbtiler 1.0, three are mostly or completely revamped for the new gbtiler 2.0, which supports tiling of multiple layers in a single job. Headers.pm, Macros.pm and Apertures.pm are now running within the gbtiler 2.0 framework. The important offsetting package and a formatting package remain to be incorporated into the new version of gbtiler.

    Implementation wise, the new framework centers around a complex hash table which is passed from package instance to package instance during run time. In some ways this new framework steps away from the "independent modules or building blocks" idea of object oriented coding, which was primary among developer Ted's first version goals. However, routine counts and package sizes have diminished considerably, and coding has become easier to implement with the shared complex hash tree. Given the nature of tiling gerber and NC drill files, an object-oriented approach in Perl may not be ideal.

     

    2004-07-16 gbtiler multi-layer handling implemenation is underway. Developer Ted has incorporated NC drill tiling scripts into the project, and is now incorporating previous gbtiler packages into version 2.0 of the project. Developer Ted apologizes for the brokenness of previous code, in particular the absence of meaningful comments to explain obscure RS274X gerber syntax details, and comments about some of the code within gbtiler version 1.0 packages.

     

     

     
    ^ Works in progress:

     

    TASK PRIORITY STARTED COMPLETED STATUS
    improved documentation HIGH 2004-06-10 2004-08-15 done
    multiple layer handling HIGH 2004-06-16 2004-07-28 done *
    additional file format handling HIGH 2004-07-26 2004-08-15 done
    NC drill file integration HIGH 2007-07-12 2007-07-16 done
    PCB extents calculation MEDIUM --- --- planning
    90 degree rotation on per board basis MEDIUM --- --- waiting
    artwork scaling feature MEDIUM --- --- waiting
    tiling stepping options MEDIUM --- --- waiting
    drill summary report MEDIUM --- --- waiting
    adding graphical user interface LOW --- --- waiting

     

    Internal improvements:

     

    TASK PRIORITY STARTED COMPLETED STATUS
    temporary data files to replace arrays HIGH 2004-07-24 2004-07-28 done *
    error and bounds checking HIGH 2004-08-14 --- in progress
    job hash tree integrity check MEDIUM --- --- waiting

     
    Note: the starred done items in the tables above appear to work with EagleCAD generated PCB artwork files. To be sure these program features are done and functioning, additional testing is needed. In particular, tiling files generated by multiple CAD programs would be a useful test of the gerber parsing logic in gbtiler.  
     
    ^ Gbtiler developments described:

  • Improved documentation
     
    Since the gbtiler 1.0 release, the gbtiler 2.0 manual constitutes the bulk of the improved documentation for this project. The home page is becoming more of a links, news and project progress and status report page. Many of these items do not belong in a software user manual. There is, however, some overlap between the latest released manual and the gbtiler home page. Some notable specific improvements and additions to the gbtiler manual include,  
     

     
     
  • Multiple layer handling
     
    The August release of gbtiler 2.0, an alpha or "needs testing" version of the tiler, supports tiling of multiple circuit board layers. Both gerber and drill layers may be included in the tiling job. Intermediate gerber files and final, tiled gerber and drill files are written to a directory named 'workspace', for which the gbtiler script searches or attempts to create along side itself.
     
     
  • temporary data files to replace arrays
     
    Instead of storing gerber coordinate data in arrays, gbtiler 2.0 now writes merged and then tiled gerber data to intermediate files in a specific, scratch space directory named 'workspace'. It's not clear to the development team whether this change or a reduction in routine calls and counts helped improve run times of the script. The most important result, whatever its cause, is that gbtiler 2.0 tiles larger file sets a couple orders of magnitude faster than the previous version. As of August 2004 the tiler approaches being a useable program.
     
     
  • additional file format handling
     
    In the year 2003 two gbtiler users contributed or offered changes to allow gbtiler to handle some additional file formats which apparently are peculiar to specific CAD programs. One of these improvements adds a capability to the NC drill tiling package to handle a 2.n format in the coordinate data of Protel '99 drill files. And part of that change or request for change was to have gbtiler handle separate rack files, which it now can do.  
     
    As for the numeric formatting, it turns out with further research that all NC drill files have either 2.3 or 3.3 numeric formatting for their coordinate data. If the drill data are in inches, then the numeric data format should always interpreted as two integer digits followed by three decimal digits. If the drill data are in millimeters, then they are interpreted as 2.3 or 3.3 formatted data. Judging from the appearance of drill data in some files, plus GCPrevue's manual settings for interpreting drill data to be displayed, it's clear that drill data may drop trailing zeroes. But either trailing or leading zeroes need to be present for the implicit decimal point to work during data interpretation of both drill and gerber files. Gotta count digits from one end of the string or the other.  
     
    Developer Ted is still searching for the second additional file format capacity written by a gbtiler 1.0 user. Monty, can you remind me what you needed to add to get gbtiler to process your files correctly?
     
     
  • NC drill file integration
     
    RS274X gerber and NC drill file format are two similar but distinct formats. These formats differ enough that at its beginning, the gbtiler project team worked on separate programs to merge and tile these two types of files. On a practical, end-user level however, it's much easier to work with files of both types in a single tiling operation. Gbtiler 2.0 combines the tiling functions of the originally separate scripts. This became possible when developers added the capacity for gbtiler to handle multiple layers in a single tiling job. The previous version only tiled one layer at a time.
     
     
  • PCB extents calculation
     
    The idea of printer circuit extents is to answer the question, what four points created a bounding frame around a given circuit board layer? Many but not all circuit board artworks are close to rectangular, and in these cases it may be important to know what the bounds of a board are. Some of the motivations to add PCB extents calculation to gbtiler include,
     

     
    Board rotation will likely be the first feature to necesitate extents calculations. Board collision is pretty easy to catch visually, reviewing tiled work in a gerber viewer. If tiling were a common activity then manual review would be too time-consuming. But people aren't tiling boards everyday. As for the quick preview, adding graphic capability to gbtiler will be a major undertaking. Until graphics are available, the preview would at best be reduced to a textual report listing, say, boards whose outermost rectangular extents collide, or boards whose extents have a gap greater than some set value.
     
    Boards with non-rectangular shapes, such as many flex boards have, would probably not benefit as much from extent calcuations, in terms of practical collision detection or computer aided tiling optimization.  
     
     
    ^ Improvements awaiting description:


     

    Page updated on 2004-09-13
    Questions or comments? e-mail ted(a)cs.pdx.edu
    Ted Havelka (c) 2003