nedoPC.org

Community of electronics hobbyists established in 2002

...
Atom Feed | View unanswered posts | View active topics It is currently 22 Oct 2017 07:45



Reply to topic  [ 9 posts ] 
[Soft] GPL source code of gerber RS-274X converter to GIF 
Author Message
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15562
Location: Colorado
Reply with quote
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

_________________
:eugeek: https://twitter.com/Shaos1973


Last edited by Shaos on 05 May 2013 09:41, edited 3 times in total.



21 Mar 2010 18:20
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15562
Location: Colorado
Reply with quote
Post 
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!

_________________
:eugeek: https://twitter.com/Shaos1973


21 Mar 2010 19:00
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15562
Location: Colorado
Reply with quote
Post 
This is video that was built from generated images:


_________________
:eugeek: https://twitter.com/Shaos1973


25 Mar 2010 19:17
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15562
Location: Colorado
Reply with quote
Post 
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/viewvc/nedopc/src/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.)

_________________
:eugeek: https://twitter.com/Shaos1973


Last edited by Shaos on 13 Aug 2010 20:44, edited 1 time in total.



13 Aug 2010 00:36
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15562
Location: Colorado
Reply with quote
Post 
Example of usage (1x3):

Image

_________________
:eugeek: https://twitter.com/Shaos1973


13 Aug 2010 20:41
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15562
Location: Colorado
Reply with quote
Post 
Another example (2x2):

Image

P.S. Images were created by grb2gif

_________________
:eugeek: https://twitter.com/Shaos1973


13 Aug 2010 21:17
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15562
Location: Colorado
Reply with quote
Post 
Shaos wrote:
Example of usage (1x3):

Image


"Hard copy" is ready:

Image

_________________
:eugeek: https://twitter.com/Shaos1973


24 Aug 2010 21:53
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15562
Location: Colorado
Reply with quote
Post 
It's working only with gerbers created by Eagle

_________________
:eugeek: https://twitter.com/Shaos1973


29 Apr 2011 22:52
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15562
Location: Colorado
Reply with quote
Post 
Shaos wrote:
It's working only with gerbers created by Eagle


I will fix it soon...

_________________
:eugeek: https://twitter.com/Shaos1973


10 Nov 2012 12:12
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.