From ac707401637ecfd61cdfa143577eb94330457fa0 Mon Sep 17 00:00:00 2001 From: Kenneth <40445044+kennetek@users.noreply.github.com> Date: Thu, 17 Nov 2022 12:58:46 -0700 Subject: [PATCH] documentation update --- .gitignore | 3 + .../README.md => README-VASE.md | 0 README.md | 118 +----------------- gridfinity-rebuilt-baseplate.scad | 10 +- gridfinity-rebuilt-bins.scad | 8 +- gridfinity-rebuilt-lite.scad | 14 ++- ...l-vase.scad => gridfinity-spiral-vase.scad | 40 +++--- 7 files changed, 47 insertions(+), 146 deletions(-) rename gridfinity-spiral-vase/README.md => README-VASE.md (100%) rename gridfinity-spiral-vase/gridfinity-spiral-vase.scad => gridfinity-spiral-vase.scad (96%) diff --git a/.gitignore b/.gitignore index c44f259..218b99f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ ignore/ gridfinity-rebuilt.json stl/ batch/ +docs/ +site/ +mkdocs.yml diff --git a/gridfinity-spiral-vase/README.md b/README-VASE.md similarity index 100% rename from gridfinity-spiral-vase/README.md rename to README-VASE.md diff --git a/README.md b/README.md index 3459631..6a8ddff 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ A ground-up port (with a few extra features) of the stock [gridfinity](https://w []() []() +Full documentation can be found at the project's [website](https://kennetek.github.io/gridfinity-rebuilt-openscad/). + ## Features - any size of bin (width/length/height) - height by units, internal depth, or overall size @@ -33,122 +35,6 @@ The printable holes allow your slicer to bridge the gap inside the countersunk m ## Recommendations 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](https://openscad.org/downloads.html). To enable the feature, go to Edit > Preferences > Features > fast-csg. On my computer, this sped up rendering from 10 minutes down to a couple of seconds, even for comically large bins. -## Modules -Run these functions inside the *Commands* section of *gridfinity-rebuilt-bins.scad*. - -### `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 scoopy bit on the bottom edge that allows 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 scoopy bit on the bottom edge that allows easy removal of items, 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); - } -} -``` - -More complex examples of all modules can be found in the scripts. - ## Enjoy! []() diff --git a/gridfinity-rebuilt-baseplate.scad b/gridfinity-rebuilt-baseplate.scad index 3423f3f..8eff620 100644 --- a/gridfinity-rebuilt-baseplate.scad +++ b/gridfinity-rebuilt-baseplate.scad @@ -1,6 +1,6 @@ include -// ===== Info ===== // +// ===== INFORMATION ===== // /* IMPORTANT: rendering will be better for analyzing the model if fast-csg is enabled. As of writing, this feature is only available in the development builds and not the official release of OpenSCAD, but it makes rendering only take a couple seconds, even for comically large bins. Enable it in Edit > Preferences > Features > fast-csg @@ -8,6 +8,8 @@ https://github.com/kennetek/gridfinity-rebuilt-openscad */ +// ===== PARAMETERS ===== // + /* [Setup Parameters] */ $fa = 8; $fs = 0.25; @@ -38,14 +40,14 @@ enable_magnet = true; style_hole = 2; // [0:none, 1:contersink, 2:counterbore] -// ===== Commands ===== // +// ===== IMPLEMENTATION ===== // color("tomato") gridfinityBaseplate(gridx, gridy, length, distancex, distancey, style_plate, enable_magnet, style_hole); -// ===== Construction ===== // +// ===== CONSTRUCTION ===== // module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh) { @@ -85,7 +87,7 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh) { } } -module cutter_weight(){ +module cutter_weight() { union() { linear_extrude(bp_cut_depth*2,center=true) square(bp_cut_size, center=true); diff --git a/gridfinity-rebuilt-bins.scad b/gridfinity-rebuilt-bins.scad index 179fcf1..fcde484 100644 --- a/gridfinity-rebuilt-bins.scad +++ b/gridfinity-rebuilt-bins.scad @@ -1,6 +1,6 @@ include -// ===== Info ===== // +// ===== INFORMATION ===== // /* IMPORTANT: rendering will be better for analyzing the model if fast-csg is enabled. As of writing, this feature is only available in the development builds and not the official release of OpenSCAD, but it makes rendering only take a couple seconds, even for comically large bins. Enable it in Edit > Preferences > Features > fast-csg the magnet holes can have an extra cut in them to make it easier to print without supports @@ -21,6 +21,8 @@ https://github.com/kennetek/gridfinity-rebuilt-openscad */ +// ===== PARAMETERS ===== // + /* [Setup Parameters] */ $fa = 8; $fs = 0.25; @@ -67,7 +69,7 @@ div_base_y = 0; -// ===== Commands ===== // +// ===== IMPLEMENTATION ===== // color("tomato") { gridfinityInit(gridx, gridy, height(gridz, gridz_define, enable_lip, enable_zsnap), height_internal, length) { @@ -79,7 +81,7 @@ gridfinityBase(gridx, gridy, length, div_base_x, div_base_y, style_hole); } -// ===== Examples ===== +// ===== EXAMPLES ===== // // 3x3 even spaced grid /* diff --git a/gridfinity-rebuilt-lite.scad b/gridfinity-rebuilt-lite.scad index 965442e..e85abb6 100644 --- a/gridfinity-rebuilt-lite.scad +++ b/gridfinity-rebuilt-lite.scad @@ -1,5 +1,15 @@ include +// ===== INFORMATION ===== // +/* + IMPORTANT: rendering will be better for analyzing the model if fast-csg is enabled. As of writing, this feature is only available in the development builds and not the official release of OpenSCAD, but it makes rendering only take a couple seconds, even for comically large bins. Enable it in Edit > Preferences > Features > fast-csg + +https://github.com/kennetek/gridfinity-rebuilt-openscad + +*/ + +// ===== PARAMETERS ===== // + /* [Setup Parameters] */ $fa = 8; $fs = 0.25; @@ -40,13 +50,15 @@ div_base_x = 0; div_base_y = 0; +// ===== IMPLEMENTATION ===== // // Input all the cutter types in here module cutterInput() { cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, enable_scoop = false); } -// Does the necessary operations to get the base geometry +// ===== CONSTRUCTION ===== // + color("tomato") difference() { union() { diff --git a/gridfinity-spiral-vase/gridfinity-spiral-vase.scad b/gridfinity-spiral-vase.scad similarity index 96% rename from gridfinity-spiral-vase/gridfinity-spiral-vase.scad rename to gridfinity-spiral-vase.scad index 5b37654..dc130e3 100644 --- a/gridfinity-spiral-vase/gridfinity-spiral-vase.scad +++ b/gridfinity-spiral-vase.scad @@ -1,4 +1,14 @@ -include <../gridfinity-rebuilt-utility.scad> +include + +// ===== INFORMATION ===== // +/* + IMPORTANT: rendering will be better for analyzing the model if fast-csg is enabled. As of writing, this feature is only available in the development builds and not the official release of OpenSCAD, but it makes rendering only take a couple seconds, even for comically large bins. Enable it in Edit > Preferences > Features > fast-csg + +https://github.com/kennetek/gridfinity-rebuilt-openscad + +*/ + +// ===== PARAMETERS ===== // /* [Special Variables] */ $fa = 8; @@ -7,18 +17,7 @@ $fs = 0.25; /* [Bin or Base] */ type = 0; // [0:bin, 1:base] -// ===== COMMANDS ===== // - -color("tomato") - -if (type != 0) gridfinityBaseVase(); // Generate a single base -else gridfinityVase(); // Generate the bin - -// ==================== // - - /* [Printer Settings] */ - // printer nozzle size nozzle = 0.6; // slicer layer size @@ -27,7 +26,6 @@ layer = 0.35; bottom_layer = 3; /* [General Settings] */ - // number of bases along x-axis gridx = 2; // number of bases along y-axis @@ -55,26 +53,26 @@ enable_inset = true; // "pinches" the top lip of the bin, for added strength enable_pinch = true; - /* [Styles] */ - // determine what the variable "gridz" applies to based on your use case gridz_define = 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] - // how tabs are implemented style_tab = 0; // [0:continuous, 1:broken, 2:auto, 3:right, 4:center, 5:left, 6:none] - // where to put X cutouts for attaching bases style_base = 0; // [0:all, 1:corners, 2:edges, 3:auto, 4:none] // tab angle -a_tab = 40; +a_tab = 40; -// ===== Include ===== // +// ===== IMPLEMENTATION ===== // + +color("tomato") +if (type != 0) gridfinityBaseVase(); // Generate a single base +else gridfinityVase(); // Generate the bin -// ===== Constants ===== // +// ===== CONSTRUCTION ===== // d_bottom = layer*bottom_layer; x_l = length/2; @@ -94,7 +92,6 @@ spacing = (gridx*length-0.5)/(n_divx); shift = n_st==3?-1:n_st==5?1:0; shiftauto = function (a,b) n_st!=2?0:a==1?-1:a==b?1:0; - xAll = function (a,b) true; xCorner = function(a,b) (a==1||a==gridx)&&(b==1||b==gridy); xEdge = function(a,b) (a==1)||(a==gridx)||(b==1)||(b==gridy); @@ -102,7 +99,6 @@ xAuto = function(a,b) xCorner(a,b) || (a%2==1 && b%2 == 1); xNone = function(a,b) false; xFunc = [xAll, xCorner, xEdge, xAuto, xNone]; -// ===== Modules ===== // module gridfinityVase() { $dh = d_height;