@@ -9,12 +9,8 @@ https://github.com/kennetek/gridfinity-rebuilt-openscad
99include < src/core/standard.scad>
1010use < src/core/gridfinity- rebuilt- utility.scad>
1111use < src/core/gridfinity- rebuilt- holes.scad>
12- use < src/core/base.scad>
13- use < src/core/wall.scad>
12+ use < src/core/bin.scad>
1413use < src/core/cutouts.scad>
15- use < src/helpers/generic- helpers.scad>
16- use < src/helpers/shapes.scad>
17- use < src/helpers/grid.scad>
1814
1915// ===== PARAMETERS ===== //
2016
@@ -43,8 +39,6 @@ divy = 2;
4339enable_zsnap = false ;
4440// how should the top lip act
4541style_lip = 0 ; // [0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height]
46- // scoop weight percentage. 0 disables scoop, 1 is regular scoop. Any real number will scale the scoop.
47- scoop = 0 ; // [0:0.1:1]
4842
4943/* [Other] */
5044// determine what the variable "gridz" applies to based on your use case
@@ -75,69 +69,24 @@ chamfer_holes = true;
7569printable_hole_top = true ;
7670
7771hole_options = bundle_hole_options(refined_holes, magnet_holes, screw_holes, crush_ribs, chamfer_holes, printable_hole_top);
78- grid_dimensions = GRID_DIMENSIONS_MM / (half_grid ? 2 : 1 );
79- height_mm = height(gridz, gridz_define, style_lip, enable_zsnap);
80-
81-
82- fill_height_real = height_mm + BASE_HEIGHT - STACKING_LIP_SUPPORT_HEIGHT;
8372
8473// ===== IMPLEMENTATION ===== //
8574
86- // Input all the cutter types in here
87- // color("tomato")
88- // render()
89- gridfinityLite(gridx, gridy, height_mm, style_lip, grid_dimensions, hole_options, only_corners || half_grid) {
90- $ gxx= gridx;
91- $ gyy= gridy;
92- $ dh= fill_height_real;
93- translate ([0 , 0 , - fill_height_real- BASE_HEIGHT+ TOLLERANCE])
94- cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = 0 );
95- }
96- // ===== CONSTRUCTION ===== //
97-
98- module gridfinityLite(gridx, gridy, height_mm, style_lip, grid_dimensions, style_hole, only_corners) {
99-
100- // Lower the bin start point by this amount.
101- // Made up for in bin height.
102- // Ensures divider walls smoothly transition to the bottom
103- lite_base_height = BASE_PROFILE_HEIGHT + bottom_layer;
104-
105- grid_size_mm = [
106- gridx * grid_dimensions.x,
107- gridy * grid_dimensions.y
108- ] - BASE_GAP_MM;
109- fill_height_real = height_mm + BASE_HEIGHT - STACKING_LIP_SUPPORT_HEIGHT;
110-
111- translate ([0 , 0 , BASE_PROFILE_HEIGHT])
112- render_wall([
113- grid_size_mm.x,
114- grid_size_mm.y,
115- height_mm + h_bot
116- ]);
117-
118- // color("tomato")
119- difference () {
120-
121- // Infill
122- linear_extrude(fill_height_real)
123- rounded_square(grid_size_mm- [TOLLERANCE, TOLLERANCE], BASE_TOP_RADIUS, center= true );
124-
125- // Negative of the base.
126- // Keep infill from going into the gaps.
127- difference () {
128- translate ([0 , 0 , BASE_PROFILE_HEIGHT/2 ])
129- cube ([
130- grid_size_mm.x,
131- grid_size_mm.y,
132- BASE_PROFILE_HEIGHT+ 2 * TOLLERANCE
133- ], center= true );
134- render () // Required!
135- gridfinityBase([gridx, gridy], grid_dimensions, hole_options= style_hole, only_corners= only_corners);
136- }
137-
138- translate ([0 , 0 , fill_height_real])
139- children();
75+ binL = new_bin(
76+ grid_size = [gridx, gridy],
77+ height_mm = height(gridz, gridz_define, style_lip, enable_zsnap),
78+ include_lip = style_lip == 0 ,
79+ hole_options = hole_options,
80+ only_corners = only_corners || half_grid,
81+ grid_dimensions = GRID_DIMENSIONS_MM / (half_grid ? 2 : 1 )
82+ );
83+ compartment_height = bin_get_infill_size_mm(binL, true ).z;
84+ bin_render_lite(binL, bottom_layer){
85+ bin_subdivide(binL, [divx, divy]) {
86+ cut_compartment_auto(
87+ cgs(height= compartment_height+ 2 * TOLLERANCE),
88+ style_tab,
89+ place_tab != 0
90+ );
14091 }
141-
142- gridfinity_base_lite([gridx, gridy], grid_dimensions, d_wall, bottom_layer, hole_options= style_hole, only_corners= only_corners);
14392}
0 commit comments