404
+ +Page not found
+ + +commit 5240f2e87b9565740f0053636bf0af546308f8b9 Author: Kenneth <40445044+kennetek@users.noreply.github.com> Date: Thu Nov 17 12:51:43 2022 -0700 Deployed d02bcd1 with MkDocs version: 1.4.2 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100755 index 0000000..17f4b15 --- /dev/null +++ b/404.html @@ -0,0 +1,129 @@ + + +
+ + + + +Page not found
+ + +testing
+gridfinityInit (gridx, gridy, height, height_internal, length)
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.
+Parameter | +Range | +Description | +
---|---|---|
gridx | +{ n>0 | n∈R } | +number of bases along the x-axis | +
gridy | +{ n>0 | n∈R } | +number of bases along the y-axis | +
height | +{ n>0 | n∈R } | +height of the bin, in millimeters (but not exactly). See the height() function for more info. |
+
height_internal | +{ n>0 | n∈R } | +height of the internal block. Can be lower than bin height to save filament on custom bins. default of 0 means use the calculated height. |
+
length | +{ n>0 | n∈R } | +length of one unit of the base. default: 42 (The Answer to the Ultimate Question of Life, the Universe, and Everything.) |
+
// 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, enable_scoop = true);
+}
+
+height (gridz, gridz_define, enable_lip, enable_zsnap)
Calculates the proper height for bins.
+Parameter | +Range | +Description | +
---|---|---|
gridz | +{ n>0 | n∈R } | +bin height. See bin height information and "gridz_define" below. | +
gridz_define | +{ n>0 | n∈R } | +determine what the variable "gridz" applies to based on your use case. default: 0. • (0) gridz is the height of bins in units of 7mm increments - Zack's method • (1) gridz is the internal height in millimeters • (2) gridz is the overall external height of the bin in millimeters |
+
enable_lip | +boolean | +if you are not stacking the bin, you can disable the top lip to save space. default: true |
+
enable_zsnap | +boolean | +automatically snap the bin size to the nearest 7mm increment. default: true |
+
// 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, true, false);
+
+gridfinityBase (gridx, gridy, length, div_base_x, div_base_y, style_hole)
Generates the bases for bins. Has various different hole styles, and can be subdivided.
+Parameter | +Range | +Description | +
---|---|---|
gridx | +{ n>0 | n∈R } | +number of bases along the x-axis | +
gridy | +{ n>0 | n∈R } | +number of bases along the y-axis | +
length | +{ n>0 | n∈R } | +length of one unit of the base. default: 42 | +
div_base_x | +{ n>=0 | n∈Z } | +number of divisions per 1 unit of base along the X axis. (default 1, only use integers. 0 means automatically guess the division) |
+
div_base_y | +{ n>=0 | n∈Z } | +number of divisions per 1 unit of base along the Y axis. (default 1, only use integers. 0 means automatically guess the division) |
+
style_hole | +{ 0, 1, 2, 3 } | +the style of holes in the bases • (0) No holes • (1) Magnet holes only • (2) Magnet and screw holes - no printable slit • (3) Magnet and screw holes - with printable slit |
+
// Example: generate a 3x3 base with a 42mm unit size and clean magnet holes
+gridfinityBase(3, 3, 42, 0, 0, 1);
+
+cutEqual (n_divx, n_divy, style_tab, enable_scoop)
Generates the "traditional" bin cutters. It is a utility function that creates evenly distributed compartments.
+Parameter | +Range | +Description | +
---|---|---|
n_divx | +{ n>0 | n∈Z } | +number of compartments along X | +
n_divy | +{ n>0 | n∈Z } | +number of compartments along Y | +
style_tab | +{ 0, 1, 2, 3, 4, 5 } | +how the tabs for labels are generated. • (0) Full tabs across the entire compartment • (1) automatic tabs, meaning left aligned tabs on the left edge, right aligned tabs on right edge, center tabs otherwise • (2) left aligned tabs • (3) center aligned tabs • (4) right aligned tabs • (5) no tabs |
+
enable_scoop | +boolean | +toggles the fillet on bottom edge for easy removal of items | +
// 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, enable_scoop = true);
+}
+
+cut (x, y, w, h, t, s)
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.
+Parameter | +Range | +Description | +
---|---|---|
x | +{ n>=0 | n∈R } | +X coordinate of the compartment (position of left edge of compartment) |
+
y | +{ n>=0 | n∈R } | +Y coordinate of the compartment (position of bottom edge of compartment) |
+
w | +{ n>0 | n∈R } | +Width of the compartment, in base units (1 unit = 1 length ) |
+
h | +{ n>0 | n∈R } | +Height of the compartment, in base units (1 unit = 1 length ) |
+
t | +{ 0, 1, 2, 3, 4, 5 } | +how the tabs for labels are generated for this specfic compartment. • (0) Full tabs across the entire compartment • (1) automatic tabs, meaning left aligned tabs on the left edge, right aligned tabs on right edge, center tabs otherwise • (2) left aligned tabs • (3) center aligned tabs • (4) right aligned tabs • (5) no tabs |
+
s | +boolean | +toggles the fillet on bottom edge for easy removal of items, only for this specific compartment |
+
// 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, true);
+ cut(2, 1, 1, 2, 0, true);
+}
+
+cut_move (x, y, w, h)
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.
+Parameter | +Range | +Description | +
---|---|---|
x | +{ n>=0 | n∈R } | +X coordinate of the area (position of left edge) | +
y | +{ n>=0 | n∈R } | +Y coordinate of the area (position of bottom edge) | +
w | +{ n>0 | n∈R } | +Width of the area, in base units (1 unit = 1 length ) |
+
h | +{ n>0 | n∈R } | +Height of the area, in base units (1 unit = 1 length ) |
+
// 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);
+ }
+}
+
+
+ Gridfinity rebuilt aims to remake the brilliant Gridfinity project from Zack Freedman in a more robust and open-source way than the original Fusion 360 files. Many major CAD suites struggle with making parametric models constructed from linear patterns, due to changing fillet edges and seams. Thus, a pure mathematical approach using OpenSCAD can allow a single solution for all possible bin variants.
+The project has expanded into more eccentric models that use modules from the original generator. This wiki aims to document these modules in great detail.
+Models are generated subtractively. First, the solid bin and bases are constructed, and then the compartments and holes are removed. This allows for internal fillets that nearly match the originals. However, they are not exactly perfect. There are some fillets that are too small and too difficult to be worth implementing, as most printers do not have a high enough resolution for it to matter.
+For best results, use a version of OpenSCAD with the fast-csg feature. As of writing, this feature is only implemented in the development snapshots. To enable the feature, go to Edit > Preferences > Features > fast-csg. This can speed up rendering from 10 minutes down to a couple of seconds, even for comically large bins. It is not a requirement to use development versions of OpenSCAD.
+Most files will come ready-to-run, so parameters can be changed using OpenSCAD's built-in customizer window, and the bins will automatically generate. However, all modules are packed up nicely, so any module can be imported into other files or have more custom modifications beyond tweaking the parameters.
+The two files which do not follow these conventions are gridfinity-rebuilt-utility
and gridfinity-rebuilt-constants
. These files are not meant to be exposed to the user, except for special requirements that the normal parameters cannot handle. Their respective wiki pages go into more depth.
NOTE: This documentation is a work in progress, just like the rest of the repository, so parts may still be under construction.
+ +' + escapeHtml(summary) +'
' + noResultsText + '
'); + } +} + +function doSearch () { + var query = document.getElementById('mkdocs-search-query').value; + if (query.length > min_search_length) { + if (!window.Worker) { + displayResults(search(query)); + } else { + searchWorker.postMessage({query: query}); + } + } else { + // Clear results for short queries + displayResults([]); + } +} + +function initSearch () { + var search_input = document.getElementById('mkdocs-search-query'); + if (search_input) { + search_input.addEventListener("keyup", doSearch); + } + var term = getSearchTermFromLocation(); + if (term) { + search_input.value = term; + doSearch(); + } +} + +function onWorkerMessage (e) { + if (e.data.allowSearch) { + initSearch(); + } else if (e.data.results) { + var results = e.data.results; + displayResults(results); + } else if (e.data.config) { + min_search_length = e.data.config.min_search_length-1; + } +} + +if (!window.Worker) { + console.log('Web Worker API not supported'); + // load index in main thread + $.getScript(joinUrl(base_url, "search/worker.js")).done(function () { + console.log('Loaded worker'); + init(); + window.postMessage = function (msg) { + onWorkerMessage({data: msg}); + }; + }).fail(function (jqxhr, settings, exception) { + console.error('Could not load worker.js'); + }); +} else { + // Wrap search in a web worker + var searchWorker = new Worker(joinUrl(base_url, "search/worker.js")); + searchWorker.postMessage({init: true}); + searchWorker.onmessage = onWorkerMessage; +} diff --git a/search/search_index.json b/search/search_index.json new file mode 100755 index 0000000..e99b539 --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Introduction Gridfinity rebuilt aims to remake the brilliant Gridfinity project from Zack Freedman in a more robust and open-source way than the original Fusion 360 files. Many major CAD suites struggle with making parametric models constructed from linear patterns, due to changing fillet edges and seams. Thus, a pure mathematical approach using OpenSCAD can allow a single solution for all possible bin variants. The project has expanded into more eccentric models that use modules from the original generator. This wiki aims to document these modules in great detail. Models are generated subtractively. First, the solid bin and bases are constructed, and then the compartments and holes are removed. This allows for internal fillets that nearly match the originals. However, they are not exactly perfect. There are some fillets that are too small and too difficult to be worth implementing, as most printers do not have a high enough resolution for it to matter. Getting Started For best results, use a version of OpenSCAD with the fast-csg feature. As of writing, this feature is only implemented in the development snapshots . To enable the feature, go to Edit > Preferences > Features > fast-csg. This can speed up rendering from 10 minutes down to a couple of seconds, even for comically large bins. It is not a requirement to use development versions of OpenSCAD. Most files will come ready-to-run, so parameters can be changed using OpenSCAD's built-in customizer window, and the bins will automatically generate. However, all modules are packed up nicely, so any module can be imported into other files or have more custom modifications beyond tweaking the parameters. Script Structure Information (Imports / Script Details) Parameters (Shown in Customizer) Implementation (Executing the Parameters) Construction (Script-Specific Modules and Constants) Examples The two files which do not follow these conventions are gridfinity-rebuilt-utility and gridfinity-rebuilt-constants . These files are not meant to be exposed to the user, except for special requirements that the normal parameters cannot handle. Their respective wiki pages go into more depth. NOTE: This documentation is a work in progress, just like the rest of the repository, so parts may still be under construction.","title":"Home"},{"location":"#introduction","text":"Gridfinity rebuilt aims to remake the brilliant Gridfinity project from Zack Freedman in a more robust and open-source way than the original Fusion 360 files. Many major CAD suites struggle with making parametric models constructed from linear patterns, due to changing fillet edges and seams. Thus, a pure mathematical approach using OpenSCAD can allow a single solution for all possible bin variants. The project has expanded into more eccentric models that use modules from the original generator. This wiki aims to document these modules in great detail. Models are generated subtractively. First, the solid bin and bases are constructed, and then the compartments and holes are removed. This allows for internal fillets that nearly match the originals. However, they are not exactly perfect. There are some fillets that are too small and too difficult to be worth implementing, as most printers do not have a high enough resolution for it to matter.","title":"Introduction"},{"location":"#getting-started","text":"For best results, use a version of OpenSCAD with the fast-csg feature. As of writing, this feature is only implemented in the development snapshots . To enable the feature, go to Edit > Preferences > Features > fast-csg. This can speed up rendering from 10 minutes down to a couple of seconds, even for comically large bins. It is not a requirement to use development versions of OpenSCAD. Most files will come ready-to-run, so parameters can be changed using OpenSCAD's built-in customizer window, and the bins will automatically generate. However, all modules are packed up nicely, so any module can be imported into other files or have more custom modifications beyond tweaking the parameters.","title":"Getting Started"},{"location":"#script-structure","text":"Information (Imports / Script Details) Parameters (Shown in Customizer) Implementation (Executing the Parameters) Construction (Script-Specific Modules and Constants) Examples The two files which do not follow these conventions are gridfinity-rebuilt-utility and gridfinity-rebuilt-constants . These files are not meant to be exposed to the user, except for special requirements that the normal parameters cannot handle. Their respective wiki pages go into more depth. NOTE: This documentation is a work in progress, just like the rest of the repository, so parts may still be under construction.","title":"Script Structure"},{"location":"baseplates/","text":"","title":"Baseplates"},{"location":"bins/","text":"gridfinity-rebuilt-bins testing gridfinityInit (gridx, gridy, height, height_internal, length) 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. Parameter Range Description gridx { n>0 | n\u2208R } number of bases along the x-axis gridy { n>0 | n\u2208R } number of bases along the y-axis height { n>0 | n\u2208R } height of the bin, in millimeters (but not exactly). See the height() function for more info. height_internal { n>0 | n\u2208R } height of the internal block. Can be lower than bin height to save filament on custom bins. default of 0 means use the calculated height. length { n>0 | n\u2208R } length of one unit of the base. default: 42 (The Answer to the Ultimate Question of Life, the Universe, and Everything.) // 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, enable_scoop = true); } height (gridz, gridz_define, enable_lip, enable_zsnap) Calculates the proper height for bins. Parameter Range Description gridz { n>0 | n\u2208R } bin height. See bin height information and \"gridz_define\" below. gridz_define { n>0 | n\u2208R } determine what the variable \"gridz\" applies to based on your use case. default: 0. \u2022 (0) gridz is the height of bins in units of 7mm increments - Zack's method \u2022 (1) gridz is the internal height in millimeters \u2022 (2) gridz is the overall external height of the bin in millimeters enable_lip boolean if you are not stacking the bin, you can disable the top lip to save space. default: true enable_zsnap boolean automatically snap the bin size to the nearest 7mm increment. default: true // 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, true, false); gridfinityBase (gridx, gridy, length, div_base_x, div_base_y, style_hole) Generates the bases for bins. Has various different hole styles, and can be subdivided. Parameter Range Description gridx { n>0 | n\u2208R } number of bases along the x-axis gridy { n>0 | n\u2208R } number of bases along the y-axis length { n>0 | n\u2208R } length of one unit of the base. default: 42 div_base_x { n>=0 | n\u2208Z } number of divisions per 1 unit of base along the X axis. (default 1, only use integers. 0 means automatically guess the division) div_base_y { n>=0 | n\u2208Z } number of divisions per 1 unit of base along the Y axis. (default 1, only use integers. 0 means automatically guess the division) style_hole { 0, 1, 2, 3 } the style of holes in the bases \u2022 (0) No holes \u2022 (1) Magnet holes only \u2022 (2) Magnet and screw holes - no printable slit \u2022 (3) Magnet and screw holes - with printable slit // Example: generate a 3x3 base with a 42mm unit size and clean magnet holes gridfinityBase(3, 3, 42, 0, 0, 1); cutEqual (n_divx, n_divy, style_tab, enable_scoop) Generates the \"traditional\" bin cutters. It is a utility function that creates evenly distributed compartments. Parameter Range Description n_divx { n>0 | n\u2208Z } number of compartments along X n_divy { n>0 | n\u2208Z } number of compartments along Y style_tab { 0, 1, 2, 3, 4, 5 } how the tabs for labels are generated. \u2022 (0) Full tabs across the entire compartment \u2022 (1) automatic tabs, meaning left aligned tabs on the left edge, right aligned tabs on right edge, center tabs otherwise \u2022 (2) left aligned tabs \u2022 (3) center aligned tabs \u2022 (4) right aligned tabs \u2022 (5) no tabs enable_scoop boolean toggles the fillet on bottom edge for easy removal of items // 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, enable_scoop = true); } cut (x, y, w, h, t, s) 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. Parameter Range Description x { n>=0 | n\u2208R } X coordinate of the compartment (position of left edge of compartment) y { n>=0 | n\u2208R } Y coordinate of the compartment (position of bottom edge of compartment) w { n>0 | n\u2208R } Width of the compartment, in base units (1 unit = 1 length ) h { n>0 | n\u2208R } Height of the compartment, in base units (1 unit = 1 length ) t { 0, 1, 2, 3, 4, 5 } how the tabs for labels are generated for this specfic compartment. \u2022 (0) Full tabs across the entire compartment \u2022 (1) automatic tabs, meaning left aligned tabs on the left edge, right aligned tabs on right edge, center tabs otherwise \u2022 (2) left aligned tabs \u2022 (3) center aligned tabs \u2022 (4) right aligned tabs \u2022 (5) no tabs s boolean toggles the fillet on bottom edge for easy removal of items, only for this specific compartment // 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, true); cut(2, 1, 1, 2, 0, true); } cut_move (x, y, w, h) 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. Parameter Range Description x { n>=0 | n\u2208R } X coordinate of the area (position of left edge) y { n>=0 | n\u2208R } Y coordinate of the area (position of bottom edge) w { n>0 | n\u2208R } Width of the area, in base units (1 unit = 1 length ) h { n>0 | n\u2208R } Height of the area, in base units (1 unit = 1 length ) // 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); } }","title":"Bins"},{"location":"bins/#gridfinity-rebuilt-bins","text":"testing","title":"gridfinity-rebuilt-bins"},{"location":"bins/#gridfinityinit-gridx-gridy-height-height_internal-length","text":"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. Parameter Range Description gridx { n>0 | n\u2208R } number of bases along the x-axis gridy { n>0 | n\u2208R } number of bases along the y-axis height { n>0 | n\u2208R } height of the bin, in millimeters (but not exactly). See the height() function for more info. height_internal { n>0 | n\u2208R } height of the internal block. Can be lower than bin height to save filament on custom bins. default of 0 means use the calculated height. length { n>0 | n\u2208R } length of one unit of the base. default: 42 (The Answer to the Ultimate Question of Life, the Universe, and Everything.) // 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, enable_scoop = true); }","title":"gridfinityInit (gridx, gridy, height, height_internal, length)"},{"location":"bins/#height-gridz-gridz_define-enable_lip-enable_zsnap","text":"Calculates the proper height for bins. Parameter Range Description gridz { n>0 | n\u2208R } bin height. See bin height information and \"gridz_define\" below. gridz_define { n>0 | n\u2208R } determine what the variable \"gridz\" applies to based on your use case. default: 0. \u2022 (0) gridz is the height of bins in units of 7mm increments - Zack's method \u2022 (1) gridz is the internal height in millimeters \u2022 (2) gridz is the overall external height of the bin in millimeters enable_lip boolean if you are not stacking the bin, you can disable the top lip to save space. default: true enable_zsnap boolean automatically snap the bin size to the nearest 7mm increment. default: true // 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, true, false);","title":"height (gridz, gridz_define, enable_lip, enable_zsnap)"},{"location":"bins/#gridfinitybase-gridx-gridy-length-div_base_x-div_base_y-style_hole","text":"Generates the bases for bins. Has various different hole styles, and can be subdivided. Parameter Range Description gridx { n>0 | n\u2208R } number of bases along the x-axis gridy { n>0 | n\u2208R } number of bases along the y-axis length { n>0 | n\u2208R } length of one unit of the base. default: 42 div_base_x { n>=0 | n\u2208Z } number of divisions per 1 unit of base along the X axis. (default 1, only use integers. 0 means automatically guess the division) div_base_y { n>=0 | n\u2208Z } number of divisions per 1 unit of base along the Y axis. (default 1, only use integers. 0 means automatically guess the division) style_hole { 0, 1, 2, 3 } the style of holes in the bases \u2022 (0) No holes \u2022 (1) Magnet holes only \u2022 (2) Magnet and screw holes - no printable slit \u2022 (3) Magnet and screw holes - with printable slit // Example: generate a 3x3 base with a 42mm unit size and clean magnet holes gridfinityBase(3, 3, 42, 0, 0, 1);","title":"gridfinityBase (gridx, gridy, length, div_base_x, div_base_y, style_hole)"},{"location":"bins/#cutequal-n_divx-n_divy-style_tab-enable_scoop","text":"Generates the \"traditional\" bin cutters. It is a utility function that creates evenly distributed compartments. Parameter Range Description n_divx { n>0 | n\u2208Z } number of compartments along X n_divy { n>0 | n\u2208Z } number of compartments along Y style_tab { 0, 1, 2, 3, 4, 5 } how the tabs for labels are generated. \u2022 (0) Full tabs across the entire compartment \u2022 (1) automatic tabs, meaning left aligned tabs on the left edge, right aligned tabs on right edge, center tabs otherwise \u2022 (2) left aligned tabs \u2022 (3) center aligned tabs \u2022 (4) right aligned tabs \u2022 (5) no tabs enable_scoop boolean toggles the fillet on bottom edge for easy removal of items // 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, enable_scoop = true); }","title":"cutEqual (n_divx, n_divy, style_tab, enable_scoop)"},{"location":"bins/#cut-x-y-w-h-t-s","text":"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. Parameter Range Description x { n>=0 | n\u2208R } X coordinate of the compartment (position of left edge of compartment) y { n>=0 | n\u2208R } Y coordinate of the compartment (position of bottom edge of compartment) w { n>0 | n\u2208R } Width of the compartment, in base units (1 unit = 1 length ) h { n>0 | n\u2208R } Height of the compartment, in base units (1 unit = 1 length ) t { 0, 1, 2, 3, 4, 5 } how the tabs for labels are generated for this specfic compartment. \u2022 (0) Full tabs across the entire compartment \u2022 (1) automatic tabs, meaning left aligned tabs on the left edge, right aligned tabs on right edge, center tabs otherwise \u2022 (2) left aligned tabs \u2022 (3) center aligned tabs \u2022 (4) right aligned tabs \u2022 (5) no tabs s boolean toggles the fillet on bottom edge for easy removal of items, only for this specific compartment // 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, true); cut(2, 1, 1, 2, 0, true); }","title":"cut (x, y, w, h, t, s)"},{"location":"bins/#cut_move-x-y-w-h","text":"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. Parameter Range Description x { n>=0 | n\u2208R } X coordinate of the area (position of left edge) y { n>=0 | n\u2208R } Y coordinate of the area (position of bottom edge) w { n>0 | n\u2208R } Width of the area, in base units (1 unit = 1 length ) h { n>0 | n\u2208R } Height of the area, in base units (1 unit = 1 length ) // 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); } }","title":"cut_move (x, y, w, h)"},{"location":"constants/","text":"","title":"Constants"},{"location":"lite/","text":"","title":"Lite"},{"location":"utility/","text":"","title":"Utility"},{"location":"vase/","text":"","title":"Vase"}]} \ No newline at end of file diff --git a/search/worker.js b/search/worker.js new file mode 100755 index 0000000..8628dbc --- /dev/null +++ b/search/worker.js @@ -0,0 +1,133 @@ +var base_path = 'function' === typeof importScripts ? '.' : '/search/'; +var allowSearch = false; +var index; +var documents = {}; +var lang = ['en']; +var data; + +function getScript(script, callback) { + console.log('Loading script: ' + script); + $.getScript(base_path + script).done(function () { + callback(); + }).fail(function (jqxhr, settings, exception) { + console.log('Error: ' + exception); + }); +} + +function getScriptsInOrder(scripts, callback) { + if (scripts.length === 0) { + callback(); + return; + } + getScript(scripts[0], function() { + getScriptsInOrder(scripts.slice(1), callback); + }); +} + +function loadScripts(urls, callback) { + if( 'function' === typeof importScripts ) { + importScripts.apply(null, urls); + callback(); + } else { + getScriptsInOrder(urls, callback); + } +} + +function onJSONLoaded () { + data = JSON.parse(this.responseText); + var scriptsToLoad = ['lunr.js']; + if (data.config && data.config.lang && data.config.lang.length) { + lang = data.config.lang; + } + if (lang.length > 1 || lang[0] !== "en") { + scriptsToLoad.push('lunr.stemmer.support.js'); + if (lang.length > 1) { + scriptsToLoad.push('lunr.multi.js'); + } + if (lang.includes("ja") || lang.includes("jp")) { + scriptsToLoad.push('tinyseg.js'); + } + for (var i=0; i < lang.length; i++) { + if (lang[i] != 'en') { + scriptsToLoad.push(['lunr', lang[i], 'js'].join('.')); + } + } + } + loadScripts(scriptsToLoad, onScriptsLoaded); +} + +function onScriptsLoaded () { + console.log('All search scripts loaded, building Lunr index...'); + if (data.config && data.config.separator && data.config.separator.length) { + lunr.tokenizer.separator = new RegExp(data.config.separator); + } + + if (data.index) { + index = lunr.Index.load(data.index); + data.docs.forEach(function (doc) { + documents[doc.location] = doc; + }); + console.log('Lunr pre-built index loaded, search ready'); + } else { + index = lunr(function () { + if (lang.length === 1 && lang[0] !== "en" && lunr[lang[0]]) { + this.use(lunr[lang[0]]); + } else if (lang.length > 1) { + this.use(lunr.multiLanguage.apply(null, lang)); // spread operator not supported in all browsers: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator#Browser_compatibility + } + this.field('title'); + this.field('text'); + this.ref('location'); + + for (var i=0; i < data.docs.length; i++) { + var doc = data.docs[i]; + this.add(doc); + documents[doc.location] = doc; + } + }); + console.log('Lunr index built, search ready'); + } + allowSearch = true; + postMessage({config: data.config}); + postMessage({allowSearch: allowSearch}); +} + +function init () { + var oReq = new XMLHttpRequest(); + oReq.addEventListener("load", onJSONLoaded); + var index_path = base_path + '/search_index.json'; + if( 'function' === typeof importScripts ){ + index_path = 'search_index.json'; + } + oReq.open("GET", index_path); + oReq.send(); +} + +function search (query) { + if (!allowSearch) { + console.error('Assets for search still loading'); + return; + } + + var resultDocuments = []; + var results = index.search(query); + for (var i=0; i < results.length; i++){ + var result = results[i]; + doc = documents[result.ref]; + doc.summary = doc.text.substring(0, 200); + resultDocuments.push(doc); + } + return resultDocuments; +} + +if( 'function' === typeof importScripts ) { + onmessage = function (e) { + if (e.data.init) { + init(); + } else if (e.data.query) { + postMessage({ results: search(e.data.query) }); + } else { + console.error("Worker - Unrecognized message: " + e); + } + }; +} diff --git a/sitemap.xml b/sitemap.xml new file mode 100755 index 0000000..d0168ff --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,38 @@ + +