bfoz / gerber Goto Github PK
View Code? Open in Web Editor NEWTools for working with Gerber RS-274-D and Extended Gerber RS-274X files
Home Page: https://rubygems.org/gems/gerber
Tools for working with Gerber RS-274-D and Extended Gerber RS-274X files
Home Page: https://rubygems.org/gems/gerber
Old gerber files used to define a hole in a plane using a self-intersecting polygon. This can be supported with the existing Geometry::Polygon class, but it might be worth looking into creating a special case for it.
http://en.wikipedia.org/wiki/Simple_polygon#Weakly_simple_polygon
Add a Gerber#name property
Index the geometry by Aperture object, not by definition number.
This implies that the Layer parser needs to convert numbers into Aperture objects.
Instead of the hash that's being used now
The latest version of the specification has renamed Layer to Level to avoid confusion with PCB layers:
Name change: level instead of layer. Previous revisions of the specification contained a construct called a layer. As these were often confused with PCB layers they have been renamed as levels. This does not alter the Gerber files.
Both G04 blocks and Aperture Macro comments.
Older files tend to contain a lot of comments. Stripping comments would save bytes and processing time considering that automated tools tend to ignore them anyway.
"flash aperture:10 at:[1,2]" generates a flash for aperture 10 at Point[1,2]
IPNEG is deprecated and should never be generated. Converting images during import relieves the need to be able to write negative polarity images.
Don't store the rotation value in the final Gerber object, just transform the geometry as it's parsed.
Hi, bfoz,
I want to parser a gerber file in my Mac OS X 10.9. But it seem can't work.
Log:
LoadError: cannot load such file -- units
from /Users/xiaobo/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/xiaobo/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/xiaobo/.rvm/gems/ruby-2.1.1/gems/gerber-1/lib/gerber.rb:2:in `<top (required)>'
from /Users/xiaobo/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
from /Users/xiaobo/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /Users/xiaobo/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from (irb):1
from /Users/xiaobo/.rvm/rubies/ruby-2.1.1/bin/irb:11:in `<main>'
Returns a bounding rectangle
Translate the commands into Geometry::Path objects
Raise an exception if the file doesn't specify units?
Walk the aperture and level arrays to see if any of the values have units set. If no units are set anywhere, default to millimeters.
Maximum aperture number (D-code). In previous revisions the maximum aperture number was 999. This was insufficient for current needs and numerous files in the market use higher aperture numbers. We have therefore increased the limit to the largest number that fits in a signed 32 bit integer.
Returns the size of the bounding rectangle
P-CAD seems to embed a lot of information in G04 comment blocks sprinkled throughout the file. It's probably not useful, but look into it just in case.
The Gerbers that Microchip provides with the MCP1631RD-DCPC1 are an example.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en543898
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.