2022-11-17 19:58:46 +00:00
// ===== INFORMATION ===== //
/*
2024-10-15 19:48:03 +00:00
IMPORTANT : rendering will be better in development builds and not the official release of OpenSCAD , but it makes rendering only take a couple seconds , even for comically large bins .
2022-11-17 19:58:46 +00:00
https : //github.com/kennetek/gridfinity-rebuilt-openscad
* /
2024-10-17 07:01:38 +00:00
include < src/core/standard.scad >
use < src/core/gridfinity-rebuilt-utility.scad >
use < src/core/gridfinity-rebuilt-holes.scad >
use < src/helpers/generic-helpers.scad >
2022-11-17 19:58:46 +00:00
// ===== PARAMETERS ===== //
2022-11-06 06:19:56 +00:00
/* [Setup Parameters] */
$fa = 8 ;
$fs = 0.25 ;
/* [General Settings] */
// number of bases along x-axis
2024-10-08 04:53:40 +00:00
gridx = 3 ; //.5
2023-09-22 06:11:23 +00:00
// number of bases along y-axis
2024-10-08 04:53:40 +00:00
gridy = 3 ; //.5
2023-09-22 06:11:23 +00:00
// bin height. See bin height information and "gridz_define" below.
2023-05-31 15:46:30 +00:00
gridz = 6 ;
2022-11-06 06:19:56 +00:00
/* [Compartments] */
// number of X Divisions
divx = 2 ;
// number of y Divisions
divy = 2 ;
/* [Toggles] */
// snap gridz height to nearest 7mm increment
enable_zsnap = false ;
2023-02-14 22:17:06 +00:00
// how should the top lip act
style_lip = 0 ; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height]
2022-11-06 06:19:56 +00:00
/* [Other] */
// 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]
// the type of tabs
style_tab = 1 ; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None]
/* [Base] */
2023-02-15 16:04:27 +00:00
// thickness of bottom layer
bottom_layer = 1 ;
2022-11-06 06:19:56 +00:00
2024-05-01 03:35:43 +00:00
/* [Base Hole Options] */
// only cut magnet/screw holes at the corners of the bin to save uneccesary print time
only_corners = false ;
//Use gridfinity refined hole style. Not compatible with magnet_holes!
refined_holes = false ;
// Base will have holes for 6mm Diameter x 2mm high magnets.
magnet_holes = true ;
// Base will have holes for M3 screws.
screw_holes = true ;
// Magnet holes will have crush ribs to hold the magnet.
crush_ribs = true ;
// Magnet/Screw holes will have a chamfer to ease insertion.
chamfer_holes = true ;
// Magnet/Screw holes will be printed so supports are not needed.
printable_hole_top = true ;
hole_options = bundle_hole_options ( refined_holes , magnet_holes , screw_holes , crush_ribs , chamfer_holes , printable_hole_top ) ;
2022-11-06 06:19:56 +00:00
2022-11-17 19:58:46 +00:00
// ===== IMPLEMENTATION ===== //
2022-11-06 06:19:56 +00:00
// Input all the cutter types in here
2022-11-18 01:26:43 +00:00
color ( "tomato" )
2024-10-08 04:53:40 +00:00
gridfinityLite ( gridx , gridy , gridz , gridz_define , style_lip , enable_zsnap , l_grid , hole_options , only_corners ) {
2023-02-14 22:17:06 +00:00
cutEqual ( n_divx = divx , n_divy = divy , style_tab = style_tab , scoop_weight = 0 ) ;
2022-11-06 06:19:56 +00:00
}
2022-11-17 19:58:46 +00:00
// ===== CONSTRUCTION ===== //
2024-10-08 04:53:40 +00:00
module gridfinityLite ( gridx , gridy , gridz , gridz_define , style_lip , enable_zsnap , length , style_hole , only_corners ) {
2024-05-01 03:35:43 +00:00
height_mm = height ( gridz , gridz_define , style_lip , enable_zsnap ) ;
2023-10-18 13:59:29 +00:00
union ( ) {
2022-11-18 01:26:43 +00:00
difference ( ) {
union ( ) {
2024-05-01 03:35:43 +00:00
gridfinityInit ( gridx , gridy , height_mm , 0 , length , sl = style_lip )
2023-10-18 13:59:29 +00:00
children ( ) ;
2024-10-08 04:53:40 +00:00
gridfinityBase ( [ gridx , gridy ] , [ length , length ] , hole_options = style_hole , only_corners = only_corners ) ;
2023-10-18 13:59:29 +00:00
}
difference ( ) {
union ( ) {
intersection ( ) {
difference ( ) {
2024-10-08 04:53:40 +00:00
gridfinityBase ( [ gridx , gridy ] , [ length , length ] , hole_options = style_hole , - d_wall * 2 , false , only_corners = only_corners ) ;
2023-10-18 13:59:29 +00:00
translate ( [ - gridx * length / 2 , - gridy * length / 2 , 2 * h_base ] )
cube ( [ gridx * length , gridy * length , 1000 ] ) ;
}
translate ( [ 0 , 0 , - 1 ] )
rounded_rectangle ( gridx * length - 0.5005 - d_wall * 2 , gridy * length - 0.5005 - d_wall * 2 , 1000 , r_f2 ) ;
translate ( [ 0 , 0 , bottom_layer ] )
rounded_rectangle ( gridx * 1000 , gridy * 1000 , 1000 , r_f2 ) ;
2022-11-18 01:26:43 +00:00
}
2023-10-18 13:59:29 +00:00
translate ( [ 0 , 0 , h_base + d_clear ] )
rounded_rectangle ( gridx * length - 0.5005 - d_wall * 2 , gridy * length - 0.5005 - d_wall * 2 , h_base , r_f2 ) ;
2022-11-06 06:19:56 +00:00
}
2023-10-18 13:59:29 +00:00
translate ( [ 0 , 0 , - 4 * h_base ] )
2024-01-30 09:35:29 +00:00
gridfinityInit ( gridx , gridy , height ( 20 , 0 ) , 0 , length , sl = style_lip )
2023-10-18 13:59:29 +00:00
children ( ) ;
2022-11-06 06:19:56 +00:00
}
2022-11-18 01:26:43 +00:00
2022-11-06 06:19:56 +00:00
}
2023-10-18 13:59:29 +00:00
difference ( ) {
translate ( [ 0 , 0 , - 1.6 ] )
difference ( ) {
difference ( ) {
union ( ) {
2022-11-06 06:19:56 +00:00
2024-05-01 03:35:43 +00:00
gridfinityInit ( gridx , gridy , height_mm , 0 , length , sl = style_lip )
2023-10-18 13:59:29 +00:00
children ( ) ;
}
difference ( ) {
intersection ( ) {
difference ( ) {
2024-10-08 04:53:40 +00:00
gridfinityBase ( [ gridx , gridy ] , [ length , length ] , hole_options = style_hole , - d_wall * 2 , false , only_corners = only_corners ) ;
2023-10-18 13:59:29 +00:00
translate ( [ - gridx * length / 2 , - gridy * length / 2 , 2 * h_base ] )
cube ( [ gridx * length , gridy * length , 1000 ] ) ;
}
translate ( [ 0 , 0 , - 1 ] )
rounded_rectangle ( gridx * length - 0.5005 - d_wall * 2 , gridy * length - 0.5005 - d_wall * 2 , 1000 , r_f2 ) ;
translate ( [ 0 , 0 , bottom_layer ] )
rounded_rectangle ( gridx * 1000 , gridy * 1000 , 1000 , r_f2 ) ;
}
translate ( [ 0 , 0 , - 4 * h_base ] )
2024-01-30 09:35:29 +00:00
gridfinityInit ( gridx , gridy , height ( 20 , 0 ) , 0 , length , sl = style_lip )
2023-10-18 13:59:29 +00:00
children ( ) ;
}
}
translate ( [ 0 , 0 , 9 ] )
rounded_rectangle ( gridx * 1000 , gridy * 1000 , gridz * 1000 , gridz ) ;
}
translate ( [ 0 , 0 , 0 ] )
rounded_rectangle ( gridx * 1000 , gridy * 1000 , 5 , r_f2 ) ;
}
2024-01-06 16:37:37 +00:00
2022-11-06 06:19:56 +00:00
}
2023-09-22 06:11:23 +00:00
}