<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by fzerorubigd on Medium]]></title>
        <description><![CDATA[Stories by fzerorubigd on Medium]]></description>
        <link>https://medium.com/@fzerorubigd?source=rss-bd58d6042066------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*PAnnH3uPXaTYwQlx.jpeg</url>
            <title>Stories by fzerorubigd on Medium</title>
            <link>https://medium.com/@fzerorubigd?source=rss-bd58d6042066------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:32:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fzerorubigd/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A CI/CD for creating Board game Insert]]></title>
            <link>https://medium.com/@fzerorubigd/a-ci-cd-for-creating-board-game-insert-1c685aaa1a4f?source=rss-bd58d6042066------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c685aaa1a4f</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[board-games]]></category>
            <category><![CDATA[openscad]]></category>
            <dc:creator><![CDATA[fzerorubigd]]></dc:creator>
            <pubDate>Tue, 09 Aug 2022 13:25:39 GMT</pubDate>
            <atom:updated>2022-08-09T14:25:31.158Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Github Action for creating Board game Insert STL Files</h3><figure><img alt="A Photo of Founders of Teotihuacan Insert in Progress and a Calipers" src="https://cdn-images-1.medium.com/max/1024/1*W6M5PClmg12M9-zv9TT02Q.jpeg" /></figure><p>I love board games, and I have a dedicated 3d printer for my board games. The problem is, the insert I like doesn’t always exist.</p><p>So many times I have to either give up and wait for someone to create a good insert for the game, or hell, build it myself.</p><p>But there is one big problem, I don’t know a thing about not even the 2d tools, let alone the 3d ones. The other problem is I am limited to my OS, I don’t have access to mac or windows, and I don’t want to pay for the software that I am going to rarely use, and yes, I know there are free plans too, but again I am limited to Linux.</p><p>So I found the <a href="https://openscad.org/">openscad</a>, and hooray! This is a tool built for me, as long as I can code something, I am happy. It is open source, free and cross platform.</p><p>Then I start and build <a href="https://github.com/fzerorubigd/bg-insert">my first insert</a>. It was cumbersome, with many repetitive snippets. I wanted to build a library for myself, and then I found the amazing <a href="https://github.com/dppdppd/The-Boardgame-Insert-Toolkit">Board game Insert Toolkit</a>, and ok, why reinvent the wheel?</p><p>The library lets you define an array of configuration, and then it builds a bunch of boxes with (customizable) lids for you.</p><p>It supports lids, stackable boxes, text rendering, and many other cool features out of the box.</p><p>I am not going to explain the library here, the <a href="https://github.com/dppdppd/The-Boardgame-Insert-Toolkit/blob/master/README.md">README</a> in the github repository is good enough for you to get your hands dirty, but as a developer, I don’t like to do the process manually. So this is my workflow suggestion for this library.</p><p>Note: I created a template here : <a href="https://github.com/fzerorubigd/bit-template">https://github.com/fzerorubigd/bit-template</a> you can use it, by forking it, copying or anything that you like. It has no license, (consider it <a href="https://en.wikipedia.org/wiki/WTFPL">WTFPL</a>) but add yours when you fork it.</p><h3>Using git</h3><p>Yes, I will use git. Not sure if I need to explain, but nope, no code without a proper version control.</p><p>I try to be as verbose as I can, but still you need to know git basics, so here it is :</p><pre>mkdir gamename &amp;&amp; cd gamename &amp;&amp; git init<br>echo &quot;*.stl\n*.zip&quot; &gt; .gitignore<br>git submodule add https://github.com/dppdppd/The-Boardgame-Insert-Toolkit.git bit<br>git add . &amp;&amp; git commit -m&quot;initial commit&quot;</pre><p>This will create a git repository and add the latest version of the board game insert toolkit (for short bit) as a submodule to it.</p><p>I added *.stl and *.zip to ignore list. Github can render and show .stl files, but it is slow and I am not sure if I want that, but if you like it, remove the *.stl\n in the above script and commit your stl file.</p><p>The next step is to create a file, something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b1c86f625a1b876013a13480893b006/href">https://medium.com/media/8b1c86f625a1b876013a13480893b006/href</a></iframe><p>So far, so good. But then for building it, you need to launch openscad, open the file, hit render and then save the stl, and later split it with something like <a href="https://slic3r.org/">Slic3r</a> as suggested by the bit maintainer.</p><p>But I don’t like it. I prefer to build one part, and sometimes customize it without changing the code.</p><p>So, lets go to the second part:</p><h3>How to customize it from command line</h3><p>There are a few global variables to control the library. There are 3 that I found usable:</p><p><strong><em>g_b_print_lid</em></strong> : a boolean variable that indicates if you want to have the lid in the stl output or not</p><p><strong><em>g_b_print_box</em></strong> : the same for boxes, do you want to show the box itself or not.</p><p><strong><em>g_isolated_print_box</em></strong> : the last one is a string, each box has a name, and this name can be set here so the library ignores the other boxes and only shows the box that you select here to show.</p><p>The combination of these 3 works perfectly. So if you want to only print the lid for the box name players for example, you can simply set the print lid to true, print box to false and isolated print box to players.</p><p>This is good if you want to do one and not render all (also it is good during the development(?) since you can show the box that you are working on it now.</p><p>But still not good enough for me, I need to build them on the command line, and then extend it to build them on Github Action and automatically release them on github for example.</p><p>The help for openscad shows that you can render a file from the command line, something like this</p><pre>openscad -o file.stl file.scad</pre><p>Also there are more parameters available that I am only interested in -D.</p><p>By this parameter you can pass a variable to the openscad, and it will be the initial value of that value, and ignores the first definition. Something like this :</p><pre>openscad -D &quot;g_b_print_box=\&quot;players\&quot; -o out.stl in.scad</pre><p>Set the <strong><em>g_b_print_box</em></strong> to players (also mind the escaping and \ , since the double quote is required and I want to make sure that the shell is not eating it up)</p><p>Cool! We found the solution. We need to run them one by one to get the result and Makefile to the rescue!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/421442d31a1446a88b02a56d50070b5f/href">https://medium.com/media/421442d31a1446a88b02a56d50070b5f/href</a></iframe><p>This is my basic Makefile, ignore the parts that I defined the macros, but if you like to know what they are going to do, the COMPONENT is going to be the second part after the -in make file target. (again, no need, just ignore it if you don’t know make)</p><p>The first part that you need to customize is line 3 that you need to put the scad file name, and then line 4, to maybe change it to something more meaningful.</p><p>Then go to your scad file, and check the component name. for the sake of this Makefile, make sure that your component name doesn’t contain space or -(dash character, which is used for spiting the parts in SPLIT function above) .</p><p>Then you need to add a target (like the one that I added called minimal) something like this (see line 12 in above Makefile):</p><pre>my_awesome_name: box-my_awesome_name lid-my_awesome_name</pre><p>So the name first, a : and then a space, box- and your name again, no space, one space, the lid- and box name after it without any space between.</p><p>If the box doesn’t have a lid, then it should be like this:</p><pre>box_only_no_lid: box-box_only_no_lid</pre><p>Makefile is very sensitive to spaces and tabs, so if you have an editor that can show the tabs and spaces, it can help, or if you are using some sort of IDE, then you probably know your way already.</p><p>the last part is to add this name in front of all in line 6. if you have multiple boxes, then add them all. make sure that each box has its own line with the box- and lid- .</p><p>run make or make all (if you have openscad installed and available in the PATH) will build the stls for all the components one by one, in the dist folder.</p><p>If you have the zip command installed, then it is possible to build a zip file contains the stl files by calling the make zip it will do the make all first then zip the result.</p><p>In this step, I will encourage you to choose a license and add a README file to your project. Personally I don’t care if someone build and sell this stuff. so I go with MIT, but please be careful with the licensing, and probably a Creative Common share alike is a good option. BUT this is your derision.</p><h3>Release them in Github</h3><p>I know, Github is not the best place to release a board game insert, but believe me, not releasing them at all is better than thingiverse.</p><p>First create a repository, (Or you can<a href="https://github.com/fzerorubigd/bit-template"> fork mine</a>, that contains all the above)</p><p>The last step is to create a github action for your repository. add a folder called .github/workflows in the root of the repository and add this file to it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e13ab61a012e2144844b6839d25cda51/href">https://medium.com/media/e13ab61a012e2144844b6839d25cda51/href</a></iframe><p>This will build and release your work in a github release when you push a tag to your repository. make sure to edit the line 26 according to line 4 in your Makefile.</p><p>for doing this, when you finalize your work and ready to publish it, commit your job, and tag it like this :</p><pre>git tag v0.0.1</pre><p>Use anything for tag, not just a version. (we developers have a thing with versions, but go for anything that you like) also if you know how, maybe its a good idea to sign your hash, but its not important if you don’t know git.</p><p>then its time to push your tag, make sure to pus the code as well, may be something like</p><pre>git push origin master<br>git push --tags origin master</pre><p>The process is going to take a while. Not sure if this is a good use of github-actions, but for my <a href="https://github.com/fzerorubigd/fot-insert">Founders of Teotihuacan Insert</a> it takes more than an hour. so keep that in mind.</p><p>So that’s almost it. except that you can do more with parameters and -D , for example I introduce a boolean variable to make solid lids alongside the mesh lids, since I feel anxiety when I see those meshed lids. (Now you and the whole world knows that I had a very mild Trypophobia) but I leave that for you to discover. (How’s that Rodney Smith?)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c685aaa1a4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>