192 lines
9.7 KiB
HTML
192 lines
9.7 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
|
||
|
||
<title>Burn correction — boxes.py 0.1 documentation</title>
|
||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||
<link rel="stylesheet" type="text/css" href="_static/nature.css" />
|
||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||
<script src="_static/jquery.js"></script>
|
||
<script src="_static/underscore.js"></script>
|
||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
|
||
<script src="_static/doctools.js"></script>
|
||
<script src="_static/sphinx_highlight.js"></script>
|
||
<link rel="shortcut icon" href="_static/favicon.ico"/>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="next" title="Examples" href="api_examples.html" />
|
||
<link rel="prev" title="Drawing commands" href="api_drawing.html" />
|
||
</head><body>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="genindex.html" title="General Index"
|
||
accesskey="I">index</a></li>
|
||
<li class="right" >
|
||
<a href="py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="api_examples.html" title="Examples"
|
||
accesskey="N">next</a> |</li>
|
||
<li class="right" >
|
||
<a href="api_drawing.html" title="Drawing commands"
|
||
accesskey="P">previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="index.html">boxes.py 0.1 documentation</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="apidoc.html" accesskey="U">Using the Boxes.py API</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">Burn correction</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<section id="burn-correction">
|
||
<h1>Burn correction<a class="headerlink" href="#burn-correction" title="Permalink to this heading">¶</a></h1>
|
||
<p>The burn correction – aka kerf – is done in two separate steps. The
|
||
first mechanism is used during drawing. After rendering there is
|
||
a post processing step that replaces the inverted arcs of the inner corners by
|
||
Bezier loops that can be cut in a continous motion.</p>
|
||
<p>The first mechanism is integrated into the low level
|
||
commands of Boxes.py. So for the most part developers do not need to
|
||
care about it. Nevertheless they need to understand how it works to
|
||
catch the places the do need to care.</p>
|
||
<p>Burn correction is done by increasing the radius of all outer
|
||
corners. This moves all the straight lines outward by the same
|
||
amount. This has the added benefit of not needing to change the length
|
||
of the straight lines – making them independent of the adjacent
|
||
angles. An issue arises when it comes to inner corners. If they do
|
||
have a radius reducing it by the burn value does the right thing. But
|
||
for small radii and sharp corners (radius zero) this results in a
|
||
negative values. It turns out flipping over the arc for negative radii
|
||
allows keeping the lengths of the straight lines unchanged. So this is
|
||
what Boxes.py does:</p>
|
||
<img alt="_images/burn.svg" src="_images/burn.svg" /><p>This results in the straight lines touching the piece. This would lead to
|
||
overcuts that are not as nice as proper dog bones as might be used by
|
||
a dedicated CAM software. But as Boxes.py is meant to be used for laser
|
||
cutting this deemed acceptable for a long time:</p>
|
||
<img alt="_images/overcuts.svg" src="_images/overcuts.svg" /><section id="programmer-s-perspective">
|
||
<h2>Programmer’s perspective<a class="headerlink" href="#programmer-s-perspective" title="Permalink to this heading">¶</a></h2>
|
||
<p>For this to work it is important that outside is drawn in a counter
|
||
clock wise direction while holes are drawn in a clock wise direction.</p>
|
||
<p><a class="reference internal" href="boxes.html#boxes.Boxes.corner" title="boxes.Boxes.corner"><code class="xref py py-meth docutils literal notranslate"><span class="pre">boxes.Boxes.corner()</span></code></a> adjusts the radius automatically
|
||
according to <strong>.burn</strong>. This propagates to higher level
|
||
functions. Parts shipped with Boxes.py do take the
|
||
burn out-set into account and execute callbacks at the correct position.</p>
|
||
<p>In case developers move to a feature inside of a part or executing
|
||
callbacks while implementing a part they need to be aware of the burn
|
||
correction. <a class="reference internal" href="boxes.html#boxes.Boxes.cc" title="boxes.Boxes.cc"><code class="xref py py-meth docutils literal notranslate"><span class="pre">boxes.Boxes.cc()</span></code></a> does correct for the out-set if
|
||
called without an <strong>y</strong> parameter. But if a value is given one has to
|
||
add <strong>self.burn</strong> to compensate. Note that the <strong>x</strong> value typically
|
||
does not have to be corrected as the callbacks are executed from right
|
||
underneath the part.</p>
|
||
<p>A similar approach is necessary when moving to a feature drawn inside
|
||
the part without the use of callbacks. Here you typically have to
|
||
correct for the out-set at the outside of the part and again for in-set
|
||
of the hole one is about to cut. This can be done in <strong>x</strong> or <strong>y</strong>
|
||
direction depending on whether the cut ist started vertical or
|
||
horizontally.</p>
|
||
</section>
|
||
<section id="replacing-the-inverted-arcs">
|
||
<h2>Replacing the inverted arcs<a class="headerlink" href="#replacing-the-inverted-arcs" title="Permalink to this heading">¶</a></h2>
|
||
<p>The inverted arcs have several drawbacks. For one they remove more
|
||
material than needed. This is not a big deal for laser cutters. But if
|
||
the boxes are cut with a CNC milling machine that can be
|
||
annoying. Another drawback is that the direction is reversed twice
|
||
which requires the tool (typically the laser head) to come to a total stop.</p>
|
||
<p>To solve this issue all paths are scanned for intersecting lines that
|
||
are connected by an inverted arc. There the lines are shortened to the
|
||
intersection point and the arc is replaced by a Bezier loop that is
|
||
continues the lines and loops on the outside of the corner. That way
|
||
the path still removes additional material to make sure the full
|
||
inner corner is cleared out. The current implementation uses the
|
||
former end points of the lines as control points. This gives
|
||
reasonable results but errs on the save side. The amount of material
|
||
removed can probably be further optimized.</p>
|
||
<img alt="_images/burn2.svg" src="_images/burn2.svg" /></section>
|
||
</section>
|
||
|
||
|
||
<div class="clearer"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<p class="logo"><a href="index.html">
|
||
<img class="logo" src="_static/boxes-logo.svg" alt="Logo"/>
|
||
</a></p>
|
||
<div>
|
||
<h3><a href="index.html">Table of Contents</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">Burn correction</a><ul>
|
||
<li><a class="reference internal" href="#programmer-s-perspective">Programmer’s perspective</a></li>
|
||
<li><a class="reference internal" href="#replacing-the-inverted-arcs">Replacing the inverted arcs</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
</div>
|
||
<div>
|
||
<h4>Previous topic</h4>
|
||
<p class="topless"><a href="api_drawing.html"
|
||
title="previous chapter">Drawing commands</a></p>
|
||
</div>
|
||
<div>
|
||
<h4>Next topic</h4>
|
||
<p class="topless"><a href="api_examples.html"
|
||
title="next chapter">Examples</a></p>
|
||
</div>
|
||
<div role="note" aria-label="source link">
|
||
<h3>This Page</h3>
|
||
<ul class="this-page-menu">
|
||
<li><a href="_sources/api_burn.rst.txt"
|
||
rel="nofollow">Show Source</a></li>
|
||
</ul>
|
||
</div>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3 id="searchlabel">Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="search.html" method="get">
|
||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||
<input type="submit" value="Go" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script>document.getElementById('searchbox').style.display = "block"</script>
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="genindex.html" title="General Index"
|
||
>index</a></li>
|
||
<li class="right" >
|
||
<a href="py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="api_examples.html" title="Examples"
|
||
>next</a> |</li>
|
||
<li class="right" >
|
||
<a href="api_drawing.html" title="Drawing commands"
|
||
>previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="index.html">boxes.py 0.1 documentation</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="apidoc.html" >Using the Boxes.py API</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">Burn correction</a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2016, Florian Festi.
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 5.3.0.
|
||
</div>
|
||
</body>
|
||
</html> |