mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2025-01-06 14:19:44 +00:00
first pass at generating stacking tabs
This is a bit hacky, but represents a proof of concept for trying to make the sort of stacking tabs discussed in #81
This commit is contained in:
parent
36345f3efb
commit
7e78edc14b
3 changed files with 40 additions and 1 deletions
|
@ -70,6 +70,10 @@ enable_zsnap = false;
|
|||
style_tab = 1; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None]
|
||||
// how should the top lip act
|
||||
style_lip = 0; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height]
|
||||
|
||||
// generate tabs on the lid to help align stacked bins
|
||||
stacking_tabs = false;
|
||||
|
||||
// scoop weight percentage. 0 disables scoop, 1 is regular scoop. Any real number will scale the scoop.
|
||||
scoop = 1; //[0:0.1:1]
|
||||
// only cut magnet/screw holes at the corners of the bin to save uneccesary print time
|
||||
|
|
|
@ -33,7 +33,8 @@ divy = 2;
|
|||
enable_zsnap = false;
|
||||
// how should the top lip act
|
||||
style_lip = 0; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height]
|
||||
|
||||
// generate tabs on the lid to help align stacked bins
|
||||
stacking_tabs = false;
|
||||
/* [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]
|
||||
|
|
|
@ -136,6 +136,8 @@ module gridfinityInit(gx, gy, h, h0 = 0, l = l_grid, sl = 0) {
|
|||
if ($style_lip == 0) profile_wall(h);
|
||||
else profile_wall2(h);
|
||||
}
|
||||
|
||||
if ((style_lip == 0) && stacking_tabs) generate_tabs();
|
||||
}
|
||||
// Function to include in the custom() module to individually slice bins
|
||||
// Will try to clamp values to fit inside the provided base size
|
||||
|
@ -624,3 +626,35 @@ module profile_cutter_tab(h, tab, ang) {
|
|||
polygon([[0,h],[tab,h],[0,h-tab*tan(ang)]]);
|
||||
|
||||
}
|
||||
|
||||
module lip_tab(x, y) {
|
||||
// I can't figure out what the wall thickness is, I'll assume 2.15
|
||||
|
||||
wall_thickness = 2.15;
|
||||
|
||||
// how much of the first outer bevel sits "above" the lip when these mate properly
|
||||
// This is an odd unit of measure.
|
||||
percent_over = .33;
|
||||
distance_offset = (1 - percent_over) * wall_thickness;
|
||||
|
||||
rot = (x == $gxx) ? 180 : ((x == 0) ? 0 : ((y == $gyy) ? 270 : 90));
|
||||
|
||||
translate(
|
||||
[(x * l_grid) - ((l_grid * $gxx / 2)),
|
||||
(y * l_grid) - ((l_grid * $gyy / 2)),
|
||||
$dh + h_lip + distance_offset]) {
|
||||
rotate([0, 0, rot]) {
|
||||
difference() {
|
||||
translate([d_clear, 2 * r_c2, 0])
|
||||
rotate([90, 0, 0])
|
||||
hull() {
|
||||
cube([r_f1, r_f1, 4 * r_c2]);
|
||||
translate([wall_thickness - d_clear - r_f1, 0]) cube([r_f1, r_f1, 4 * r_c2]);
|
||||
translate([wall_thickness - d_clear - r_f1, h_base - distance_offset - r_f1]) cube([r_f1, r_f1, 4 * r_c2]);
|
||||
translate([r_f1, h_base - distance_offset - r_f1]) cylinder(r=r_f1, h=4* r_c2);
|
||||
}
|
||||
gridfinityBase(2, 2, l_grid, 1, 1, 0, 0.5, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue