First commit

This commit is contained in:
Brandon Dyck 2024-07-21 17:37:52 -06:00
commit 030c017544
3 changed files with 108 additions and 0 deletions

7
LICENSE.txt Normal file
View File

@ -0,0 +1,7 @@
Copyright © 2022 Brandon Dyck
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 copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

9
README.txt Normal file
View File

@ -0,0 +1,9 @@
Place value blocks
-------------------
Requires OpenSCAD. You can set the following with the Customizer tool in OpenSCAD and Thingiverse:
- Unit cube width (default 10mm, which seems standard)
- Groove depth
- Cube count: preset unit, ten, hundred, or thousand block, or use custom counts in all three dimensions
See LICENSE.txt for copyright information.

92
place value block.scad Normal file
View File

@ -0,0 +1,92 @@
// For custom, you must also set the dimensions parameter.
shape = "flat"; // [unit,rod,flat,cube,custom]
groove_depth = 0.8; // [0:0.1:3]
unit_size = 10; // [0:0.1:40]
/* [Custom dimensions] */
dimensions = [2,3,4];
module __Customizer_Limit__ () {}
actual_dimensions = shape == "cube" ? [10,10,10] :
shape == "flat" ? [10,10,1] :
shape == "rod" ? [10,1,1] :
shape == "unit" ? [1,1,1] : dimensions;
module cube_block(x_count, y_count, z_count, cube_width=10, groove_depth=0.8) {
module corner_chamfer() {
linear_extrude(2*groove_depth*sqrt(2))
polygon([
[-groove_depth*sqrt(2),-groove_depth],
[0,0],
[groove_depth*sqrt(2),-groove_depth]]);
}
module grooves(length, count) {
for (x = [0:cube_width:count*cube_width]) {
translate([x,0,0]) {
// Make sure the edges overlap with the cube.
extra_depth = groove_depth*0.01;
extra_length = length*0.01;
translate([0,0,-extra_length/2])
linear_extrude(length+extra_length)
polygon([
[-groove_depth-extra_depth,-extra_depth],
[0,groove_depth],
[groove_depth+extra_depth,-extra_depth]]);
translate([0,2*groove_depth,0])
rotate([45,0,0])
corner_chamfer();
translate([0,2*groove_depth,length])
mirror([0,0,1])
rotate([45,0,0])
corner_chamfer();
}
}
}
x_width = x_count * cube_width;
y_width = y_count * cube_width;
z_width = z_count * cube_width;
difference() {
cube([x_width,y_width,z_width]);
grooves(z_width, x_count);
translate([0,y_width,0])
mirror([0,1,0]) grooves(z_width, x_count);
mirror([0,-1,1]) {
grooves(y_width, x_count);
translate([0,z_width,0])
mirror([0,1,0]) grooves(y_width, x_count);
}
mirror([1,-1,0]) {
grooves(z_width, y_count);
translate([0,x_width,0])
mirror([0,1,0]) grooves(z_width, y_count);
}
mirror([-1,0,1]) mirror([1,-1,0]) {
grooves(x_width, y_count);
translate([0,z_width,0])
mirror([0,1,0]) grooves(x_width, y_count);
}
mirror([-1,0,1]) {
grooves(x_width, z_count);
translate([0,y_width,0])
mirror([0,1,0]) grooves(x_width, z_count);
}
mirror([1,-1,0]) mirror([-1,0,1]) {
grooves(y_width, z_count);
translate([0,x_width,0])
mirror([0,1,0]) grooves(y_width, z_count);
}
}
};
cube_block(actual_dimensions.x, actual_dimensions.y, actual_dimensions.z, cube_width=unit_size, groove_depth=groove_depth);