Skip to content

Commit

Permalink
Add whitespace fixes generated by pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
smkent committed Sep 22, 2023
1 parent fc6ead1 commit 046ed30
Show file tree
Hide file tree
Showing 15 changed files with 276 additions and 277 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ gridfinity-rebuilt-bins.json
stl/
batch/
site/
*.json
*.json
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MIT License

Copyright (c) 2023 Zachary Freedman and Voidstar Lab LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Gridfinity Rebuilt in OpenSCAD
# Gridfinity Rebuilt in OpenSCAD

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A ground-up port (with a few extra features) of the stock [gridfinity](https://www.youtube.com/watch?v=ra_9zU-mnl8) bins in OpenSCAD. Open to feedback, because I could not feasibly test all combinations of bins. I tried my best to exactly match the original gridfinity dimensions, but some of the geometry is slightly incorrect (mainly fillets). However, I think they are negligible differences, and will not appear in the printed model.
A ground-up port (with a few extra features) of the stock [gridfinity](https://www.youtube.com/watch?v=ra_9zU-mnl8) bins in OpenSCAD. Open to feedback, because I could not feasibly test all combinations of bins. I tried my best to exactly match the original gridfinity dimensions, but some of the geometry is slightly incorrect (mainly fillets). However, I think they are negligible differences, and will not appear in the printed model.

Full documentation can be found at the project's [website](https://kennetek.github.io/gridfinity-rebuilt-openscad/).

Expand Down Expand Up @@ -35,15 +35,15 @@ The printable holes allow your slicer to bridge the gap inside the countersunk m
[<img src="./images/slicer_holes_top.png" height="200">]()

## 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.
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.

## Enjoy!

[<img src="./images/spin.gif" width="160">]()

[Gridfinity](https://www.youtube.com/watch?v=ra_9zU-mnl8) by [Zack Freedman](https://www.youtube.com/c/ZackFreedman/about)

This work is licensed under the same license as Gridfinity, being a
This work is licensed under the same license as Gridfinity, being a
[MIT License](https://opensource.org/licenses/MIT).

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8 changes: 4 additions & 4 deletions docs/baseplates.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ distancex | { n>0 \| n∈R } | minimum length of baseplate along x <br>alternati
distancey | { n>0 \| n∈R } | minimum length of baseplate along y <br>alternatively, how large is the drawer along y <br>(leave zero to ignore)
fitx | { -1<=n<=1 \| n∈R } | alignment factor for extra space along x axis
fity | { -1<=n<=1 \| n∈R } | alignment factor for extra space along y axis
style_plate | { 0, 1, 2 } | the style of baseplate <br> • (0) thin (minimum material, only outline) <br> • (1) weighted (thick with space for tire iron) <br> • (2) skeletonized (thick, center hollowed)
style_plate | { 0, 1, 2 } | the style of baseplate <br> • (0) thin (minimum material, only outline) <br> • (1) weighted (thick with space for tire iron) <br> • (2) skeletonized (thick, center hollowed)
enable_magnet | boolean | toggle hole for magnet on top
style_hole | { 0, 1, 2 } | the style of holes underneath the baseplate, if applicable <br> • (0) none <br> • (1) countersink <br> • (2) counterbore

## Modules

### gridfinityBaseplate

Generates a baseplate to use with gridfinity bins.
Generates a baseplate to use with gridfinity bins.

** `gridfinityBaseplate(gridx, gridy, length, distancex, distancey, style_plate, enable_magnet, style_hole)` **

Expand All @@ -36,6 +36,6 @@ distancex | { n>0 \| n∈R } | minimum length of baseplate along x <br>alternati
distancey | { n>0 \| n∈R } | minimum length of baseplate along y <br>alternatively, how large is the drawer along y <br>(leave zero to ignore)
fitx | { -1<=n<=1 \| n∈R } | alignment factor for extra space along x axis
fity | { -1<=n<=1 \| n∈R } | alignment factor for extra space along y axis
style_plate | { 0, 1, 2 } | the style of baseplate <br> • (0) thin (minimum material, only outline) <br> • (1) weighted (thick with space for tire iron) <br> • (2) skeletonized (thick, center hollowed)
style_plate | { 0, 1, 2 } | the style of baseplate <br> • (0) thin (minimum material, only outline) <br> • (1) weighted (thick with space for tire iron) <br> • (2) skeletonized (thick, center hollowed)
enable_magnet | boolean | toggle hole for magnet on top
style_hole | { 0, 1, 2 } | the style of holes underneath the baseplate, if applicable <br> • (0) none <br> • (1) countersink <br> • (2) counterbore
style_hole | { 0, 1, 2 } | the style of holes underneath the baseplate, if applicable <br> • (0) none <br> • (1) countersink <br> • (2) counterbore
38 changes: 19 additions & 19 deletions docs/bins.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# gridfinity-rebuilt-bins

Generates stock bins, with a great number of variations.
Generates stock bins, with a great number of variations.

![Bin](images/custom_dimension.gif)

## Script Parameters

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
gridz | { n>0 \| n∈R } | bin height. See bin height information and "gridz_define" below.
gridx | { n>0 \| n∈R } | number of bases along the x-axis
gridy | { n>0 \| n∈R } | number of bases along the y-axis
gridz | { n>0 \| n∈R } | bin height. See bin height information and "gridz_define" below.
length | { n>0 \| n∈R } | length of one unit of the base. <br> default: 42 (The Answer to the Ultimate Question of Life, <br>the Universe, and Everything.)
divx | { n>0 \| n∈Z } | number of compartments along X
divy | { n>0 \| n∈Z } | number of compartments along Y
scoop | n>0 \| n∈R | 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.
scoop | n>0 \| n∈R | 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.
enable_zsnap | boolean | automatically snap the bin size to the nearest 7mm increment. <br> default: true
style_lip | {0, 1, 2} | 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
gridz_define | { n>0 \| n∈R } | 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
Expand All @@ -32,14 +32,14 @@ div_base_y | { n>=0 \| n∈Z } | number of divisions per 1 unit of base along th

### gridfinityInit

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.
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.

** `gridfinityInit (gridx, gridy, height, height_internal, length)` **

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
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). <br> See the `height()` function for more info.
height_internal | { n>0 \| n∈R } | 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.
length | { n>0 \| n∈R } | length of one unit of the base. <br> default: 42 (The Answer to the Ultimate Question of Life, <br>the Universe, and Everything.)
Expand All @@ -55,13 +55,13 @@ gridfinityInit(3, 3, height(6), 0, 42) {

### height

Calculates the proper height for bins.
Calculates the proper height for bins.

** `height (gridz, gridz_define, style_lip, enable_zsnap)` **

Parameter | Range | Description
--- | ----- | ---
gridz | { n>0 \| n∈R } | bin height. See bin height information and "gridz_define" below.
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 <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
style_lip | {0, 1, 2} | 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
enable_zsnap | boolean | automatically snap the bin size to the nearest 7mm increment. <br> default: true
Expand All @@ -71,21 +71,21 @@ enable_zsnap | boolean | automatically snap the bin size to the nearest 7mm incr
height(6);
// Example: height for a bin that can fit (at maximum) a 30mm high object inside
height(30, 1, 0, false);
height(30, 1, 0, false);
```

---

### gridfinityBase
### gridfinityBase

Generates the bases for bins. Has various different hole styles, and can be subdivided.

** `gridfinityBase (gridx, gridy, length, div_base_x, div_base_y, style_hole)` **

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
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. <br>(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. <br>(default 1, only use integers. 0 means automatically guess the division)
Expand All @@ -100,7 +100,7 @@ gridfinityBase(3, 3, 42, 0, 0, 1);

### cutEqual

Generates the "traditional" bin cutters. It is a utility function that creates evenly distributed compartments.
Generates the "traditional" bin cutters. It is a utility function that creates evenly distributed compartments.

** `cutEqual (n_divx, n_divy, style_tab, scoop_weight)` **

Expand Down Expand Up @@ -137,8 +137,8 @@ s | n>0 \| n∈R | controls the fillet on the bottom of the compartment for easy

```
// 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.
// 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);
Expand Down Expand Up @@ -169,4 +169,4 @@ gridfinityInit(3, 3, height(6), 0, 42) {
cylinder(r=5, h=100, center=true);
}
}
```
```
14 changes: 7 additions & 7 deletions docs/constants.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gridfinity-rebuilt-constants

This file contains dimensions that are critical to the constructiuon of the other models, but are not values that often need to be changed. Thus, they were outsourced to this file such that the rest of the files would retain parity. All values here have the same range, this is positive real numbers. Some can be zero, but that may result in strange or invalid geometry,
This file contains dimensions that are critical to the constructiuon of the other models, but are not values that often need to be changed. Thus, they were outsourced to this file such that the rest of the files would retain parity. All values here have the same range, this is positive real numbers. Some can be zero, but that may result in strange or invalid geometry,

Parameter | Description
--- | ------
Expand All @@ -19,12 +19,12 @@ h_hole| magnet hole depth
h_slit| slit depth (printer layer height)
r_f1| top edge fillet radius
r_f2 | internal fillet radius
d_div | width of divider between compartments
d_div | width of divider between compartments
d_wall| minimum wall thickness
d_clear| tolerance fit factor
d_tabh| height of tab (yaxis, measured from inner wall)
d_tabw| maximum width of tab
a_tab| angle of tab
d_clear| tolerance fit factor
d_tabh| height of tab (yaxis, measured from inner wall)
d_tabw| maximum width of tab
a_tab| angle of tab
bp_h_bot| Baseplate bottom part height (part added with weigthed=true)
bp_cut_size| Baseplate bottom cutout rectangle size
bp_cut_depth| Baseplate bottom cutout rectangle depth
Expand All @@ -35,4 +35,4 @@ d_cs | countersink diameter for baseplate
r_skel| radius of cutout for skeletonized baseplate
r_cb| baseplate counterbore radius
h_cb| baseplate counterbore depth
h_skel | minimum baseplate thickness (when skeletonized)
h_skel | minimum baseplate thickness (when skeletonized)
12 changes: 6 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## Introduction
Gridfinity rebuilt aims to remake the brilliant Gridfinity project from [Zack Freedman](https://www.youtube.com/c/ZackFreedman/about) 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.
Gridfinity rebuilt aims to remake the brilliant Gridfinity project from [Zack Freedman](https://www.youtube.com/c/ZackFreedman/about) 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.
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.
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](https://openscad.org/downloads.html). 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.
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. 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.
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)
Expand All @@ -17,6 +17,6 @@ Most files will come ready-to-run, so parameters can be changed using OpenSCAD's
* 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.
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.**
Loading

0 comments on commit 046ed30

Please sign in to comment.