mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-11-29 11:33:56 +00:00
Add changes suggested by @Brunius
This adds the suggestions made by @brunius in issue #122.
This commit is contained in:
parent
7e78edc14b
commit
c5456e7d6f
2 changed files with 35 additions and 23 deletions
|
@ -70,10 +70,8 @@ enable_zsnap = false;
|
||||||
style_tab = 1; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None]
|
style_tab = 1; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None]
|
||||||
// how should the top lip act
|
// how should the top lip act
|
||||||
style_lip = 0; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height]
|
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
|
// generate tabs on the lid to help align stacked bins
|
||||||
stacking_tabs = false;
|
stacking_tabs = false;
|
||||||
|
|
||||||
// scoop weight percentage. 0 disables scoop, 1 is regular scoop. Any real number will scale the scoop.
|
// scoop weight percentage. 0 disables scoop, 1 is regular scoop. Any real number will scale the scoop.
|
||||||
scoop = 1; //[0:0.1:1]
|
scoop = 1; //[0:0.1:1]
|
||||||
// only cut magnet/screw holes at the corners of the bin to save uneccesary print time
|
// only cut magnet/screw holes at the corners of the bin to save uneccesary print time
|
||||||
|
|
|
@ -137,7 +137,7 @@ module gridfinityInit(gx, gy, h, h0 = 0, l = l_grid, sl = 0) {
|
||||||
else profile_wall2(h);
|
else profile_wall2(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((style_lip == 0) && stacking_tabs) generate_tabs();
|
if ((style_lip == 0) && stacking_tabs) generate_tabs(h);
|
||||||
}
|
}
|
||||||
// Function to include in the custom() module to individually slice bins
|
// Function to include in the custom() module to individually slice bins
|
||||||
// Will try to clamp values to fit inside the provided base size
|
// Will try to clamp values to fit inside the provided base size
|
||||||
|
@ -627,33 +627,47 @@ module profile_cutter_tab(h, tab, ang) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module lip_tab(x, y) {
|
module generate_tabs(height_mm) {
|
||||||
// I can't figure out what the wall thickness is, I'll assume 2.15
|
if ($gxx > 1) {
|
||||||
|
for (xtab=[1:$gxx-1]) {
|
||||||
|
lip_tab(xtab, 0, height_mm);
|
||||||
|
lip_tab(xtab, $gyy, height_mm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wall_thickness = 2.15;
|
if ($gyy > 1) {
|
||||||
|
for (ytab=[1:$gyy-1]) {
|
||||||
|
lip_tab(0, ytab, height_mm);
|
||||||
|
lip_tab($gxx, ytab, height_mm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// how much of the first outer bevel sits "above" the lip when these mate properly
|
module lip_tab(x, y, height_mm) {
|
||||||
// This is an odd unit of measure.
|
//Calculate rotation of lip based on which edge it is on
|
||||||
percent_over = .33;
|
rot = (x == $gxx) ? 0 : ((x == 0) ? 180 : ((y == $gyy) ? 90 : 270));
|
||||||
distance_offset = (1 - percent_over) * wall_thickness;
|
wall_thickness = r_base-r_c2+d_clear*2-r_c1;
|
||||||
|
|
||||||
rot = (x == $gxx) ? 180 : ((x == 0) ? 0 : ((y == $gyy) ? 270 : 90));
|
|
||||||
|
|
||||||
translate(
|
translate(
|
||||||
[(x * l_grid) - ((l_grid * $gxx / 2)),
|
[(x * l_grid) - ((l_grid * $gxx / 2)),
|
||||||
(y * l_grid) - ((l_grid * $gyy / 2)),
|
(y * l_grid) - ((l_grid * $gyy / 2)),
|
||||||
$dh + h_lip + distance_offset]) {
|
$dh+h_base]) {
|
||||||
rotate([0, 0, rot]) {
|
rotate([0, 0, rot])
|
||||||
difference() {
|
translate([-r_base-d_clear,-r_base,0]) {
|
||||||
translate([d_clear, 2 * r_c2, 0])
|
//Extrude the wall profile in circle; same as you would at a corner of bin
|
||||||
rotate([90, 0, 0])
|
//Intersection - limit it to the section where the lip would not interfere with the base
|
||||||
hull() {
|
intersection() {
|
||||||
cube([r_f1, r_f1, 4 * r_c2]);
|
translate([wall_thickness, -r_base*1.5, 0]) cube([wall_thickness, r_base*5, (h_lip)*5]);
|
||||||
translate([wall_thickness - d_clear - r_f1, 0]) cube([r_f1, r_f1, 4 * r_c2]);
|
translate([0,0,-$dh]) union() {
|
||||||
translate([wall_thickness - d_clear - r_f1, h_base - distance_offset - r_f1]) cube([r_f1, r_f1, 4 * r_c2]);
|
rotate_extrude(angle=90) profile_wall(height_mm);
|
||||||
translate([r_f1, h_base - distance_offset - r_f1]) cylinder(r=r_f1, h=4* r_c2);
|
translate([0, r_base*2, 0]) rotate_extrude(angle=-90) profile_wall(height_mm);
|
||||||
}
|
}
|
||||||
gridfinityBase(2, 2, l_grid, 1, 1, 0, 0.5, false);
|
}
|
||||||
|
//Fill the gap between rotational extrusions (think of it as the gap between bins, if this was multiple bins instead of tabs)
|
||||||
|
difference() {
|
||||||
|
translate([wall_thickness, 0, -h_lip*0.5]) cube([(r_base-wall_thickness)-r_f1, r_base*2, h_lip*1.5]);
|
||||||
|
cylinder(h=h_lip*3, r=r_base-r_f1, center=true);
|
||||||
|
translate([0, r_base*2, 0]) cylinder(h=h_lip*3, r=r_base-r_f1, center=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue