summaryrefslogtreecommitdiff
path: root/projects/gerbonara
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-03-19 00:54:56 +0100
committerjaseg <git@jaseg.de>2023-03-19 00:54:56 +0100
commit490ca12809a2625549aae16311affdd546e9c201 (patch)
tree58024389e48d91731efa352ae772a058b376b8cf /projects/gerbonara
parent92e3b5f49f6f5336530988e7839ab3ed283b86e4 (diff)
parentf21dea91904d7bf9628457a5758016c9a0df6d38 (diff)
downloadblog-490ca12809a2625549aae16311affdd546e9c201.tar.gz
blog-490ca12809a2625549aae16311affdd546e9c201.tar.bz2
blog-490ca12809a2625549aae16311affdd546e9c201.zip
deploy.py auto-commit
Diffstat (limited to 'projects/gerbonara')
-rw-r--r--projects/gerbonara/index.html148
1 files changed, 148 insertions, 0 deletions
diff --git a/projects/gerbonara/index.html b/projects/gerbonara/index.html
new file mode 100644
index 0000000..7da7f3e
--- /dev/null
+++ b/projects/gerbonara/index.html
@@ -0,0 +1,148 @@
+<!DOCTYPE html>
+<html><head>
+ <meta charset="utf-8">
+ <title>Gerbonara | Home</title>
+ <meta name="description" content="">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="mobile-web-app-capable" content="yes">
+ <meta name="color-scheme" content="dark light">
+ <link rel="stylesheet" href="/style.css">
+</head>
+<body><nav>
+
+ <a href="/" title="Home">Home</a>
+ <a href="/blog/" title="Blog">Blog</a>
+ <a href="/projects/" title="Projects">Projects</a>
+ <a href="/about/" title="About">About</a>
+ <span class="spacer"></span>
+ <a href="https://git.jaseg.de/" title="cgit">cgit</a>
+ <a href="https://github.com/jaseg" title="Github">Github</a>
+ <a href="https://gitlab.com/neinseg" title="Gitlab">Gitlab</a>
+ <a href="https://chaos.social/jaseg" title="Mastodon">Mastodon</a>
+</nav>
+
+ <header>
+ <h1>Gerbonara</h1>
+<ul class="breadcrumbs">
+ <li><a href="/">jaseg.de</a></li>
+ <li><a href="/projects/">Projects</a></li><li><a href="/projects/gerbonara/">Gerbonara</a></li>
+</ul>
+
+ </header>
+ <main>
+ <div class="document">
+
+
+<p>Gerbonara is a library to read, modify and write PCB manufacturing files such as Gerber, Excellon and IPC-356 through a
+pythonic API. Gerbonara can open a folder of manufacturing files, and parse file names and metadata to figure out which
+file contains what. Gerbonara is tested using an extensive library of real-world example files from CAD tools including
+KiCAD, Altium, Eagle, Allegro, gEDA, Fritzing, Siemens/Mentor Graphics PADS, and Target3001!.</p>
+<p>Gerbonara's API is built on two principles:</p>
+<dl class="docutils">
+<dt><strong>Meaningful, object-oriented API</strong></dt>
+<dd>Gerbonara abstracts away the details of the underlying file format such as tool indices, coordinate notation and
+graphical state, and presents meaningful &quot;graphical objects&quot; such as a <cite>primitives.Line</cite>,
+<cite>primitives.Arc</cite>, or <cite>Region</cite> through its API. These objects can be easily created,
+manipulated or deleted from code without breaking anything else. You can even copy graphical objects between files,
+and Gerbonara will automatically convert coordinate format, units etc. for you. <cite>GerberFile</cite> and
+<cite>ExcellonFile</cite> use the same types of <cite>graphic objects &lt;object-api&gt;</cite>, so objects can be directly
+copied between file types without conversion.</dd>
+<dt><strong>Unit-safety</strong></dt>
+<dd>Gerbonara embeds physical <cite>LengthUnit</cite> information in all objects. The high-level API such as
+<cite>LayerStack.merge</cite> or <cite>GerberFile.offset</cite> accepts arguments with an explicitly given unit and
+automatically converts them as needed. Objects can be copied between <cite>GerberFile</cite> instances and unit
+conversion will be handled transparently in the background.</dd>
+</dl>
+<p>Gerbonara was started as an extensive refactoring of the <a class="reference external" href="https://github.com/opiopan/pcb-tools-extension">pcb-tools</a> and <a class="reference external" href="https://github.com/curtacircuitos/pcb-tools/issues">pcb-tools-extension</a> packages. Both of these
+have statement-based APIs, that is, they parse input files into one python object for every line in the file. This means
+that when saving files they can recreate the input file almost byte by byte, but manipulating a file by changing
+statements without breaking things is <em>hard</em>.</p>
+<p>Gerbonara powers <a class="reference external" href="https://github.com/jaseg/gerbolyze">gerbolyze</a>, a tool for converting <a class="reference external" href="https://en.wikipedia.org/wiki/Scalable_Vector_Graphics">SVG</a> vector graphics files into Gerber, and embedding <a class="reference external" href="https://en.wikipedia.org/wiki/Scalable_Vector_Graphics">SVG</a> into
+existing Gerber files exported from a normal PCB tool for artistic purposes.</p>
+<div class="section" id="features">
+<h2>Features</h2>
+<blockquote>
+<ul class="simple">
+<li>File I/O
+* Gerber, Excellon (drill file), IPC-356 (netlist) read and write
+* supports file-level operations: offset, rotate, merge for all file types</li>
+<li>Modification API (<cite>GraphicObject</cite>)</li>
+<li>Rendering API (<cite>GraphicPrimitive</cite>)</li>
+<li>SVG export</li>
+<li>Full aperture macro support, including transformations (offset, rotation)</li>
+</ul>
+</blockquote>
+</div>
+<div class="section" id="quick-start">
+<h2>Quick Start</h2>
+<p>First, install gerbonara from PyPI using pip:</p>
+<pre class="code shell literal-block">
+pip<span class="whitespace"> </span>install<span class="whitespace"> </span>--user<span class="whitespace"> </span>gerbonara
+</pre>
+<p>Then, you are ready to read and write gerber files:</p>
+<pre class="code python literal-block">
+<span class="keyword namespace">from</span> <span class="name namespace">gerbonara</span> <span class="keyword namespace">import</span> <span class="name">LayerStack</span><span class="whitespace">
+
+</span><span class="name">stack</span> <span class="operator">=</span> <span class="name">LayerStack</span><span class="operator">.</span><span class="name">from_directory</span><span class="punctuation">(</span><span class="literal string single">'output/gerber'</span><span class="punctuation">)</span><span class="whitespace">
+</span><span class="name">w</span><span class="punctuation">,</span> <span class="name">h</span> <span class="operator">=</span> <span class="name">stack</span><span class="operator">.</span><span class="name">outline</span><span class="operator">.</span><span class="name">size</span><span class="punctuation">(</span><span class="literal string single">'mm'</span><span class="punctuation">)</span><span class="whitespace">
+</span><span class="name builtin">print</span><span class="punctuation">(</span><span class="literal string affix">f</span><span class="literal string single">'Board size is </span><span class="literal string interpol">{</span><span class="name">w</span><span class="literal string interpol">:</span><span class="literal string single">.1f</span><span class="literal string interpol">}</span><span class="literal string single"> mm x </span><span class="literal string interpol">{</span><span class="name">h</span><span class="literal string interpol">:</span><span class="literal string single">.1f</span><span class="literal string interpol">}</span><span class="literal string single"> mm'</span><span class="punctuation">)</span>
+</pre>
+</div>
+<div class="section" id="command-line-interface">
+<h2>Command-Line Interface</h2>
+<p>Gerbonara comes with a <cite>built-in command-line interface&lt;cli-doc&gt;</cite> that has functions for analyzing, rendering,
+modifying, and merging Gerber files. To access it, use either the <tt class="docutils literal">gerbonara</tt> command that is part of the python
+package, or run <tt class="docutils literal">python <span class="pre">-m</span> gerbonara</tt> For a list of functions or help on their usage, you can use:</p>
+<pre class="code console literal-block">
+<span class="generic prompt">$ </span>python<span class="whitespace"> </span>-m<span class="whitespace"> </span>gerbonara<span class="whitespace"> </span>--help<span class="whitespace">
+</span><span class="generic output">[...]
+</span><span class="generic prompt">$ </span>python<span class="whitespace"> </span>-m<span class="whitespace"> </span>gerbonara<span class="whitespace"> </span>render<span class="whitespace"> </span>--help
+</pre>
+</div>
+<div class="section" id="development">
+<h2>Development</h2>
+<p>Gerbonara is developed on Gitlab under the gerbolyze org:</p>
+<p><a class="reference external" href="https://gitlab.com/gerbolyze/gerbonara/">https://gitlab.com/gerbolyze/gerbonara/</a></p>
+<p>A mirror of the repository can be found at:</p>
+<p><a class="reference external" href="https://git.jaseg.de/gerbonara">https://git.jaseg.de/gerbonara</a></p>
+<p>Our issue tracker is also on Gitlab:</p>
+<p><a class="reference external" href="https://gitlab.com/gerbolyze/gerbonara/-/issues">https://gitlab.com/gerbolyze/gerbonara/-/issues</a></p>
+<p>The documentation can be found at gitlab:</p>
+<p><a class="reference external" href="https://gerbolyze.gitlab.io/gerbonara/">https://gerbolyze.gitlab.io/gerbonara/</a></p>
+<p>With Gerbonara, we aim to support as many different format variants as possible. If you have a file that Gerbonara can't
+open, please file an issue on our issue tracker. Even if Gerbonara can open all your files, for regression testing we
+are very interested in example files generated by any CAD or CAM tool that is not already on the list of supported
+tools.</p>
+</div>
+<div class="section" id="supported-cad-tools">
+<h2>Supported CAD Tools</h2>
+<p>Compatibility with the output of these CAD tools is tested as part of our test suite using example files generated by
+these tools. Note that not all of these tools come with default Gerber file naming rules, so YMMV if your Gerbers use
+some non-standard naming convention.</p>
+<blockquote>
+<ul class="simple">
+<li>Allegro</li>
+<li>Altium</li>
+<li>Diptrace</li>
+<li>Eagle</li>
+<li>EasyEDA</li>
+<li>Fritzing</li>
+<li>gEDA</li>
+<li>KiCAD</li>
+<li>pcb-rnd</li>
+<li>Siemens / Mentor Graphics Xpedition</li>
+<li>Siemens PADS</li>
+<li>Target 3001!</li>
+<li>Upverter</li>
+<li>Zuken CR-8000</li>
+</ul>
+</blockquote>
+</div>
+</div>
+ </main><footer>
+ Copyright © 2023 Jan Sebastian Götte
+ / <a href="http://jaseg.de/about/">About</a>
+ / <a href="http://jaseg.de/imprint/">Imprint</a>
+</footer>
+</body>
+</html>