nedoPC.org

Electronics hobbyists community established in 2002
Atom Feed | View unanswered posts | View active topics It is currently 28 Mar 2024 11:00



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

Joined: 08 Jan 2003 23:22
Posts: 22411
Location: Silicon Valley
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

_________________
:dj: https://mastodon.social/@Shaos


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



21 Mar 2010 15:20
Profile WWW
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22411
Location: Silicon Valley
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!

_________________
:dj: https://mastodon.social/@Shaos


21 Mar 2010 16:00
Profile WWW
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22411
Location: Silicon Valley
Reply with quote
Post 
This is video that was built from generated images:


_________________
:dj: https://mastodon.social/@Shaos


25 Mar 2010 16:17
Profile WWW
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22411
Location: Silicon Valley
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.)

_________________
:dj: https://mastodon.social/@Shaos


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



12 Aug 2010 21:36
Profile WWW
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22411
Location: Silicon Valley
Reply with quote
Post 
Example of usage (1x3):

Image

_________________
:dj: https://mastodon.social/@Shaos


13 Aug 2010 17:41
Profile WWW
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22411
Location: Silicon Valley
Reply with quote
Post 
Another example (2x2):

Image

P.S. Images were created by grb2gif

_________________
:dj: https://mastodon.social/@Shaos


13 Aug 2010 18:17
Profile WWW
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22411
Location: Silicon Valley
Reply with quote
Post 
Shaos wrote:
Example of usage (1x3):

Image


"Hard copy" is ready:

Image

_________________
:dj: https://mastodon.social/@Shaos


24 Aug 2010 18:53
Profile WWW
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22411
Location: Silicon Valley
Reply with quote
Post 
It's working only with gerbers created by Eagle

_________________
:dj: https://mastodon.social/@Shaos


29 Apr 2011 19:52
Profile WWW
Admin
User avatar

Joined: 08 Jan 2003 23:22
Posts: 22411
Location: Silicon Valley
Reply with quote
Post 
Shaos wrote:
It's working only with gerbers created by Eagle


I will fix it soon...

_________________
:dj: https://mastodon.social/@Shaos


10 Nov 2012 09: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 13 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.