[Soft] GPL source code of gerber RS-274X converter to GIF

English forum for http://www.nedopc.org/nedopc

Moderator: Shaos

User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

[Soft] GPL source code of gerber RS-274X converter to GIF

Post by Shaos »

Using last two evenings I wrote simple C++ program that converts Gerber/Excellon files to GIF (default resolution is 1000 dpi) to look like real PCB - up to 4 layers are supported. As side-effect the program displays image in the window 640x480 (or full-screen in case of DOS compilation). Program uses libgif to write GIF and "unigraf" library to display image - it's working in DOS (OpenWatcom 1.9 is required), Windows and Linux (SDL) and also using of Linux+SVGAlib is also possible. This is build for DOS with examples (just viewer, not converter):

http://nedopc.org/nedopc/files/GRB4DOS.ZIP (169K)

Source code is available on SourceForge:

http://nedopc.cvs.sourceforge.net/viewv ... c/grb2gif/

Results of conversion (from Linux version):

http://nedopc.org/nedopc/16/nedo16v1-top.gif
http://nedopc.org/nedopc/16/nedo16v1-bot.gif

http://nedopc.org/nedopc/16/nedo16v1t-top.gif
http://nedopc.org/nedopc/16/nedo16v1t-bot.gif

http://nedopc.org/nedopc/17/nedo17v1-top.gif
http://nedopc.org/nedopc/17/nedo17v1-bot.gif
Last edited by Shaos on 05 May 2013 06:41, edited 3 times in total.
Я тут за главного - если что шлите мыло на me собака shaos точка net
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Post by Shaos »

If you run the program as grb2gif filename it will use a set of gerber files:

filename.ovl - board dimension (Gerber)
filename.top or filename.L1 - top layer (Gerber)
filename.L2 (optional) - middle upper layer (Gerber)
filename.L3 (optional) - middle lower layer (Gerber)
filename.bot or filename.L4 - bottom layer (Gerber)
filename.smt - top solder mask (Gerber)
filename.smb - bottom solder mask (Gerber)
filename.slk - silckscreen (Gerber)
filename.drd - drills (Excellon)

to produce 2 images (1000 dpi):

filename-top.gif - top of the board
filename-bot.gif - bottom of the board

P.S. In case of DOS command should look like this: GRB4DOS filename - and it will just display the images with precision worse than 200 dpi (for performance purposes) and no GIF conversion!
Я тут за главного - если что шлите мыло на me собака shaos точка net
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Post by Shaos »

This is video that was built from generated images:

Я тут за главного - если что шлите мыло на me собака shaos точка net
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Post by Shaos »

Today I wrote a multiplier of gerber/excellon files (250 lines of C-code)
Source code under GPL3 is available on the same place of SourceForge:
http://nedopc.cvs.sourceforge.net/viewv ... c/grb2gif/

Usage: grb_mul filename NX NY
The program takes these list of files:
filename.ovl - board dimension (Gerber)
filename.top or filename.L1 - top layer (Gerber)
filename.L2 (optional) - middle upper layer (Gerber)
filename.L3 (optional) - middle lower layer (Gerber)
filename.bot or filename.L4 - bottom layer (Gerber)
filename.smt - top solder mask (Gerber)
filename.smb - bottom solder mask (Gerber)
filename.slk - top silckscreen (Gerber)
filename.drd - drills (Excellon)
and creates for any existing files from that list multiplied version NX x NY - for example if NX=1 and NY=3 it will create 3 copies one above another with suffix _1x3 (as filename_1x3.top etc.)
Last edited by Shaos on 13 Aug 2010 17:44, edited 1 time in total.
Я тут за главного - если что шлите мыло на me собака shaos точка net
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Post by Shaos »

Example of usage (1x3):

Image
Я тут за главного - если что шлите мыло на me собака shaos точка net
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Post by Shaos »

Another example (2x2):

Image

P.S. Images were created by grb2gif
Я тут за главного - если что шлите мыло на me собака shaos точка net
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Post by Shaos »

Shaos wrote:Example of usage (1x3):

Image
"Hard copy" is ready:

Image
Я тут за главного - если что шлите мыло на me собака shaos точка net
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Post by Shaos »

It's working only with gerbers created by Eagle
Я тут за главного - если что шлите мыло на me собака shaos точка net
User avatar
Shaos
Admin
Posts: 24008
Joined: 08 Jan 2003 23:22
Location: Silicon Valley

Post by Shaos »

Shaos wrote:It's working only with gerbers created by Eagle
I will fix it soon...
Я тут за главного - если что шлите мыло на me собака shaos точка net