gridfinity-rebuilt-openscad.../bins/index.html

520 lines
18 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="../img/favicon.ico" />
<title>Bins - Gridfinity Rebuilt</title>
<link rel="stylesheet" href="../css/theme.css" />
<link rel="stylesheet" href="../css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
<script>
// Current page data
var mkdocs_page_name = "Bins";
var mkdocs_page_input_path = "bins.md";
var mkdocs_page_url = null;
</script>
<script src="../js/jquery-3.6.0.min.js" defer></script>
<!--[if lt IE 9]>
<script src="../js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> Gridfinity Rebuilt
</a><div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul>
<li class="toctree-l1"><a class="reference internal" href="..">Home</a>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="./">Bins</a>
<ul class="current">
<li class="toctree-l2"><a class="reference internal" href="#script-parameters">Script Parameters</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#modules">Modules</a>
<ul>
<li class="toctree-l3"><a class="reference internal" href="#gridfinityinit">gridfinityInit</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#height">height</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#gridfinitybase">gridfinityBase</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#cutequal">cutEqual</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#cut">cut</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#cut_move">cut_move</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../baseplates/">Baseplates</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../lite/">Lite</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../vase/">Vase</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../constants/">Constants</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">Gridfinity Rebuilt</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href=".." class="icon icon-home" alt="Docs"></a> &raquo;</li>
<li>Bins</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">
<h1 id="gridfinity-rebuilt-bins">gridfinity-rebuilt-bins</h1>
<p>Generates stock bins, with a great number of variations. </p>
<p><img alt="Bin" src="../images/custom_dimension.gif" /></p>
<h2 id="script-parameters">Script Parameters</h2>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Range</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>gridx</td>
<td>{ n&gt;0 | n∈R }</td>
<td>number of bases along the x-axis</td>
</tr>
<tr>
<td>gridy</td>
<td>{ n&gt;0 | n∈R }</td>
<td>number of bases along the y-axis</td>
</tr>
<tr>
<td>gridz</td>
<td>{ n&gt;0 | n∈R }</td>
<td>bin height. See bin height information and "gridz_define" below.</td>
</tr>
<tr>
<td>length</td>
<td>{ n&gt;0 | n∈R }</td>
<td>length of one unit of the base. <br> default: 42 (The Answer to the Ultimate Question of Life, <br>the Universe, and Everything.)</td>
</tr>
<tr>
<td>divx</td>
<td>{ n&gt;0 | n∈Z }</td>
<td>number of compartments along X</td>
</tr>
<tr>
<td>divy</td>
<td>{ n&gt;0 | n∈Z }</td>
<td>number of compartments along Y</td>
</tr>
<tr>
<td>scoop</td>
<td>n&gt;0 | n∈R</td>
<td>controls the fillet on the bottom of the compartment for easy <br> item removal. 0 is disabled, 1 is full, any other real number will <br> scale from full.</td>
</tr>
<tr>
<td>enable_zsnap</td>
<td>boolean</td>
<td>automatically snap the bin size to the nearest 7mm increment. <br> default: true</td>
</tr>
<tr>
<td>style_lip</td>
<td>{0, 1, 2}</td>
<td>if you are not stacking the bin, you can disable the top lip <br> to save space. <br> • (0) Regular lip <br> • (1) Subtract lip to save space <br> • (2) Disable lip while retaining height</td>
</tr>
<tr>
<td>gridz_define</td>
<td>{ n&gt;0 | n∈R }</td>
<td>determine what the variable "gridz" applies to based on <br> your use case. default: 0. <br> • (0) gridz is the height in # of 7mm increments (Zack) <br> • (1) gridz is the internal height in millimeters <br> • (2) gridz is the overall external height of the bin in millimeters</td>
</tr>
<tr>
<td>height_internal</td>
<td>{ n&gt;0 | n∈R }</td>
<td>height of the internal block. <br> Can be lower than bin height to save filament on custom bins. <br> default of 0 means use the calculated height.</td>
</tr>
<tr>
<td>style_tab</td>
<td>{ 0, 1, 2, 3, 4, 5 }</td>
<td>how the tabs for labels are generated. <br> • (0) Full tabs across the entire compartment <br> • (1) automatic tabs <br> - left aligned tabs on the left edge<br> - right aligned tabs on right edge<br> - center tabs otherwise <br> • (2) left aligned tabs <br> • (3) center aligned tabs <br> • (4) right aligned tabs <br> • (5) no tabs</td>
</tr>
<tr>
<td>style_hole</td>
<td>{ 0, 1, 2, 3 }</td>
<td>the style of holes in the bases <br> • (0) No holes <br> • (1) Magnet holes only <br> • (2) Magnet and screw holes - no printable slit <br> • (3) Magnet and screw holes - with printable slit</td>
</tr>
<tr>
<td>div_base_x</td>
<td>{ n&gt;=0 | n∈Z }</td>
<td>number of divisions per 1 unit of base along the X axis. <br>(default 1, only use integers. <br>0 means automatically guess the division)</td>
</tr>
<tr>
<td>div_base_y</td>
<td>{ n&gt;=0 | n∈Z }</td>
<td>number of divisions per 1 unit of base along the Y axis. <br>(default 1, only use integers. <br>0 means automatically guess the division)</td>
</tr>
</tbody>
</table>
<p><br></p>
<h2 id="modules">Modules</h2>
<hr />
<h3 id="gridfinityinit">gridfinityInit</h3>
<p>Initializes the top part of the bin (walls and solid section). All bins have to use this module, and have the compartments cut out from it. </p>
<p><strong> <code>gridfinityInit (gridx, gridy, height, height_internal, length)</code> </strong></p>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Range</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>gridx</td>
<td>{ n&gt;0 | n∈R }</td>
<td>number of bases along the x-axis</td>
</tr>
<tr>
<td>gridy</td>
<td>{ n&gt;0 | n∈R }</td>
<td>number of bases along the y-axis</td>
</tr>
<tr>
<td>height</td>
<td>{ n&gt;0 | n∈R }</td>
<td>height of the bin, in millimeters (but not exactly). <br> See the <code>height()</code> function for more info.</td>
</tr>
<tr>
<td>height_internal</td>
<td>{ n&gt;0 | n∈R }</td>
<td>height of the internal block. <br> Can be lower than bin height to save filament on custom bins. <br> default of 0 means use the calculated height.</td>
</tr>
<tr>
<td>length</td>
<td>{ n&gt;0 | n∈R }</td>
<td>length of one unit of the base. <br> default: 42 (The Answer to the Ultimate Question of Life, <br>the Universe, and Everything.)</td>
</tr>
</tbody>
</table>
<pre><code>// Example: generate a 3x3x6 bin with a 42mm unit size
gridfinityInit(3, 3, height(6), 0, 42) {
cutEqual(n_divx = 3, n_divy = 3, style_tab = 0, scoop_weight = 1);
}
</code></pre>
<hr />
<h3 id="height">height</h3>
<p>Calculates the proper height for bins. </p>
<p><strong> <code>height (gridz, gridz_define, style_lip, enable_zsnap)</code> </strong></p>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Range</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>gridz</td>
<td>{ n&gt;0 | n∈R }</td>
<td>bin height. See bin height information and "gridz_define" below.</td>
</tr>
<tr>
<td>gridz_define</td>
<td>{ n&gt;0 | n∈R }</td>
<td>determine what the variable "gridz" applies to based on <br> your use case. default: 0. <br> • (0) gridz is the height in # of 7mm increments (Zack) <br> • (1) gridz is the internal height in millimeters <br> • (2) gridz is the overall external height of the bin in millimeters</td>
</tr>
<tr>
<td>style_lip</td>
<td>{0, 1, 2}</td>
<td>if you are not stacking the bin, you can disable the top lip <br> to save space. <br> • (0) Regular lip <br> • (1) Subtract lip to save space <br> • (2) Disable lip while retaining height</td>
</tr>
<tr>
<td>enable_zsnap</td>
<td>boolean</td>
<td>automatically snap the bin size to the nearest 7mm increment. <br> default: true</td>
</tr>
</tbody>
</table>
<pre><code>// Example: height for a 6 unit high bin
height(6);
// Example: height for a bin that can fit (at maximum) a 30mm high object inside
height(30, 1, 0, false);
</code></pre>
<hr />
<h3 id="gridfinitybase">gridfinityBase</h3>
<p>Generates the bases for bins. Has various different hole styles, and can be subdivided.</p>
<p><strong> <code>gridfinityBase (gridx, gridy, length, div_base_x, div_base_y, style_hole)</code> </strong></p>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Range</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>gridx</td>
<td>{ n&gt;0 | n∈R }</td>
<td>number of bases along the x-axis</td>
</tr>
<tr>
<td>gridy</td>
<td>{ n&gt;0 | n∈R }</td>
<td>number of bases along the y-axis</td>
</tr>
<tr>
<td>length</td>
<td>{ n&gt;0 | n∈R }</td>
<td>length of one unit of the base. default: 42</td>
</tr>
<tr>
<td>div_base_x</td>
<td>{ n&gt;=0 | n∈Z }</td>
<td>number of divisions per 1 unit of base along the X axis. <br>(default 1, only use integers. 0 means automatically guess the division)</td>
</tr>
<tr>
<td>div_base_y</td>
<td>{ n&gt;=0 | n∈Z }</td>
<td>number of divisions per 1 unit of base along the Y axis. <br>(default 1, only use integers. 0 means automatically guess the division)</td>
</tr>
<tr>
<td>style_hole</td>
<td>{ 0, 1, 2, 3 }</td>
<td>the style of holes in the bases <br> • (0) No holes <br> • (1) Magnet holes only <br> • (2) Magnet and screw holes - no printable slit <br> • (3) Magnet and screw holes - with printable slit</td>
</tr>
</tbody>
</table>
<pre><code>// Example: generate a 3x3 base with a 42mm unit size and clean magnet holes
gridfinityBase(3, 3, 42, 0, 0, 1);
</code></pre>
<hr />
<h3 id="cutequal">cutEqual</h3>
<p>Generates the "traditional" bin cutters. It is a utility function that creates evenly distributed compartments. </p>
<p><strong> <code>cutEqual (n_divx, n_divy, style_tab, scoop_weight)</code> </strong></p>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Range</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>n_divx</td>
<td>{ n&gt;0 | n∈Z }</td>
<td>number of compartments along X</td>
</tr>
<tr>
<td>n_divy</td>
<td>{ n&gt;0 | n∈Z }</td>
<td>number of compartments along Y</td>
</tr>
<tr>
<td>style_tab</td>
<td>{ 0, 1, 2, 3, 4, 5 }</td>
<td>how the tabs for labels are generated. <br> • (0) Full tabs across the entire compartment <br> • (1) automatic tabs <br> - left aligned tabs on the left edge<br> - right aligned tabs on right edge<br> - center tabs otherwise <br> • (2) left aligned tabs <br> • (3) center aligned tabs <br> • (4) right aligned tabs <br> • (5) no tabs</td>
</tr>
<tr>
<td>scoop</td>
<td>n&gt;0 | n∈R</td>
<td>controls the fillet on the bottom of the compartment for easy <br> item removal. 0 is disabled, 1 is full, any other real number will <br> scale from full.</td>
</tr>
</tbody>
</table>
<pre><code>// Example: this generates 9 compartments in a 3x3 grid, and all compartments have a full tab and a scoop
gridfinityInit(3, 3, height(6), 0, 42) {
cutEqual(n_divx = 3, n_divy = 3, style_tab = 0, scoop_weight = 1);
}
</code></pre>
<hr />
<h3 id="cut">cut</h3>
<p>Cuts a single compartment into the bin at the provided location with the provided attributes. The coordinate system for compartments originates (0,0) at the bottom left corner of the bin, where 1 unit is the length of 1 base. Positive X and positive Y are in the same direction as the global coordinate system.</p>
<p><strong> <code>cut (x, y, w, h, t, s)</code> </strong></p>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Range</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>x</td>
<td>{ n&gt;=0 | n∈R }</td>
<td>X coordinate of the compartment <br>(position of left edge of compartment)</td>
</tr>
<tr>
<td>y</td>
<td>{ n&gt;=0 | n∈R }</td>
<td>Y coordinate of the compartment <br>(position of bottom edge of compartment)</td>
</tr>
<tr>
<td>w</td>
<td>{ n&gt;0 | n∈R }</td>
<td>Width of the compartment, in base units <br>(1 unit = 1 <code>length</code>)</td>
</tr>
<tr>
<td>h</td>
<td>{ n&gt;0 | n∈R }</td>
<td>Height of the compartment, in base units <br>(1 unit = 1 <code>length</code>)</td>
</tr>
<tr>
<td>t</td>
<td>{ 0, 1, 2, 3, 4, 5 }</td>
<td>how the tabs for labels are generated for this compartment. <br> • (0) Full tabs across the entire compartment <br> • (1) automatic tabs <br> - left aligned tabs on the left edge<br> - right aligned tabs on right edge<br> - center tabs otherwise <br> • (2) left aligned tabs <br> • (3) center aligned tabs <br> • (4) right aligned tabs <br> • (5) no tabs</td>
</tr>
<tr>
<td>s</td>
<td>n&gt;0 | n∈R</td>
<td>controls the fillet on the bottom of the compartment for easy <br> item removal. 0 is disabled, 1 is full, any other real number will <br> scale from full, only for this specific compartment</td>
</tr>
</tbody>
</table>
<pre><code>// Example:
// this cuts two compartments that are both 1 wide and 2 high.
// One is on the bottom left, and the other is at the top right.
gridfinityInit(3, 3, height(6), 0, 42) {
cut(0, 0, 1, 2, 0, 1);
cut(2, 1, 1, 2, 0, 1);
}
</code></pre>
<hr />
<h3 id="cut_move">cut_move</h3>
<p>Moves all of its children from the global origin to the center of the area that a compartment would normally fill, and uses them to cut from the bin. This allows you to easily make custom cutouts in the bin.</p>
<p><strong> <code>cut_move (x, y, w, h)</code> </strong></p>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Range</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>x</td>
<td>{ n&gt;=0 | n∈R }</td>
<td>X coordinate of the area (position of left edge)</td>
</tr>
<tr>
<td>y</td>
<td>{ n&gt;=0 | n∈R }</td>
<td>Y coordinate of the area (position of bottom edge)</td>
</tr>
<tr>
<td>w</td>
<td>{ n&gt;0 | n∈R }</td>
<td>Width of the area, in base units (1 unit = 1 <code>length</code>)</td>
</tr>
<tr>
<td>h</td>
<td>{ n&gt;0 | n∈R }</td>
<td>Height of the area, in base units (1 unit = 1 <code>length</code>)</td>
</tr>
</tbody>
</table>
<pre><code>// Example:
// cuts a cylindrical hole of radius 5
// hole center is located 1/2 units from the right edge of the bin, and 1 unit from the top
gridfinityInit(3, 3, height(6), 0, 42) {
cut_move(x=2, y=1, w=1, h=2) {
cylinder(r=5, h=100, center=true);
}
}
</code></pre>
</div>
</div><footer>
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
<a href=".." class="btn btn-neutral float-left" title="Home"><span class="icon icon-circle-arrow-left"></span> Previous</a>
<a href="../baseplates/" class="btn btn-neutral float-right" title="Baseplates">Next <span class="icon icon-circle-arrow-right"></span></a>
</div>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
</div>
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" aria-label="Versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span><a href=".." style="color: #fcfcfc">&laquo; Previous</a></span>
<span><a href="../baseplates/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script>var base_url = '..';</script>
<script src="../js/theme_extra.js" defer></script>
<script src="../js/theme.js" defer></script>
<script src="../search/main.js" defer></script>
<script defer>
window.onload = function () {
SphinxRtdTheme.Navigation.enable(true);
};
</script>
</body>
</html>