diff options
Diffstat (limited to 'blog/kicad-mesh-plugin/index.html')
-rw-r--r-- | blog/kicad-mesh-plugin/index.html | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/blog/kicad-mesh-plugin/index.html b/blog/kicad-mesh-plugin/index.html index 4c0315d..def76ef 100644 --- a/blog/kicad-mesh-plugin/index.html +++ b/blog/kicad-mesh-plugin/index.html @@ -16,6 +16,9 @@ <a href="/projects/" title="Projects">Projects</a> <a href="/about/" title="About">About</a> </div> + <div class="search"> + <div id="search"></div> + </div> <div class="external"> <a href="https://git.jaseg.de/" title="cgit">cgit</a> <a href="https://github.com/jaseg" title="Github">Github</a> @@ -32,12 +35,12 @@ </ul> <strong>2020-08-18</strong> </header> - <main> + <main data-pagefind-body> <div class="document"> -<figure> -<img src="images/anim.webp" style="max-width: 20em"> +<figure data-pagefind-ignore> + <img src="images/anim.webp" style="max-width: 20em"> </figure><div class="section" id="tamper-detection-meshes"> <h2>Tamper Detection Meshes</h2> <p>Cryptography is at the foundation of our modern, networked world. From email to card payment infrastructure in brick and @@ -61,7 +64,7 @@ One of the core cryptographic components in financial applications are smartcard most countries nowadays. These smartcards contain a small, specialized cryptographic microcontroller that is designed to be hard to tamper with. Though one of the design goals of the system is to reduce the amount of sensitive information stored on the card, things such as copying of a card can only be hindered by making the chip hard to read out.</p> -<figure> +<figure data-pagefind-ignore> <img src="images/modern_art.svg" style="max-width: 20em"> </figure><p>With smartcards being the means of choice on one side of the counter in electronic payments, on the other side of the counter a different technology prevails. Attacks on payment terminals are bound to have much more dire consequences than @@ -105,14 +108,14 @@ into grid cells that are fully inside the set boundaries. All cells outside or g this step.</p> <p>I decided to implement this auto-router in a KiCAD plugin. Though KiCADs plugin API is not the best, it was just about usable for this task.</p> -<figure> +<figure data-pagefind-ignore> <img src="images/kicad-mesh-outline.png" alt="KiCAD showing an irregular board shape with rounded corners and indents. In the middle of the board there is a footprint for a 4-pin surface-mount pin header."> <figcaption>The process starts out with the mesh shape being defined inside KiCAD. The mesh's outline is drawn onto one of the graphical "Eco" layers. A footprint is placed to serve as a placeholder for the mesh's connections to the outside world. This footprint is later used as the starting point for the mesh generation algorithm.</figcaption> -</figure><figure> +</figure><figure data-pagefind-ignore> <img src="images/grid-vis-plain.svg" alt="A vizualization of the grid fitting process. Over the mesh's irregular outline a grid is drawn. In this picture, all grid cells that are fully inside the grid are shown. Grid cells that overlap the mesh border are highlighted. Grid cells outside of the mesh border are not drawn."> @@ -128,7 +131,7 @@ algorithm it yields more or less organized-looking results. Below are five examp levels of randomness with the cells colored according to their distance from the tree root. 0% randomness means that the algorithm is going to try cells in forward direction first on every step, and only then try out left and right. 100% means that on every step, the algorithm is choosing a new direction at random.</p> -<div class="subfigure"> +<div class="subfigure" data-pagefind-ignore> <figure> <img src="images/cells-0.svg" alt="a completely organized looking grid with spiral patterns all over."> <figcaption>0%</figcaption> @@ -155,34 +158,34 @@ it. The core observation here is that there is only 16 possible ways a cell can each of which it can either be connected to or not, which results in 2^4 options. If you consider rotations and mirroring, this works out to rotations or mirrored versions of only six base tiles: The empty tile, a tile with all four sides connected, a straight through, a 90 degree bend, and a "T"-junction—see the illustration below.</p> -<figure> +<figure data-pagefind-ignore> <img src="images/maze_tiles_plain.svg" style="max-width: 20em"> <figcaption> There are six possible tile types in our connectivity graph inside its square tiling. This graphic illustrates all sixteen rotations of these with how they would look in a two-conductor mesh. </figcaption> </figure><p>After tiling the grid according to the key above, we get the result below.</p> -<figure> +<figure data-pagefind-ignore> <img src="images/tiles-25-small.svg"> <figcaption> An auto-routed mesh with traces colored according to tile types. </figcaption> -</figure><figure> +</figure><figure data-pagefind-ignore> <img src="images/traces-25-small.svg"> <figcaption> The same mesh, but with traces all black. </figcaption> </figure><p>Putting it all together got me the KiCAD plugin you can see in the screenshot below.</p> -<figure> +<figure data-pagefind-ignore> <img src="images/kicad-mesh-settings2.png"> <figcaption> The plugin settings window open. </figcaption> -</figure><figure> -<img src="images/kicad-mesh-result-large.png"> -<figcaption> - After runing the plugin, the generated mesh looks like this in pcbnew. -</figcaption> +</figure><figure data-pagefind-ignore> + <img src="images/kicad-mesh-result-large.png"> + <figcaption> + After runing the plugin, the generated mesh looks like this in pcbnew. + </figcaption> </figure><p>I am fairly happy with the result, but getting there was a medium pain. Especially KiCAD's plugin API is still very unfinieshed. It is hard to use, most parts are completely undocumented and if you use anything but its most basic parts things tend to break. One particular pain point for me was that after generating the mesh, the traces have been added to @@ -194,7 +197,7 @@ making a copy of the board file first and treating mesh generation as a non-reve .. raw:: html - <figure> + <figure data-pagefind-ignore> <img src="images/grid-vis-plain.svg" alt=""> <figcaption></figcaption> </figure> --> @@ -205,13 +208,18 @@ making a copy of the board file first and treating mesh generation as a non-reve / <a href="/about/">About</a> / <a href="/imprint/">Imprint</a> </footer> -<script> +<script src="/pagefind/pagefind-ui.js"></script> + <script> if(navigator.getEnvironmentIntegrity!==undefined)document.querySelector('body').innerHTML=`<h1>Your browser contains Google DRM</h1>"Web Environment Integrity" is a Google euphemism for a DRM that is designed to prevent ad-blocking, and which Google has forced into their browsers against widespread public opposition. In support of an open web, this website does not function with this DRM. Please install a browser such as <a href="https://www.mozilla.org/en-US/firefox/new/">Firefox</a> that respects your freedom and supports ad blockers.`; + + window.addEventListener('DOMContentLoaded', (event) => { + new PagefindUI({element: "#search", showSubResults: true}); + }); </script> </body> </html> |