Skip to content

Commit

Permalink
Add changes suggested by @Brunius
Browse files Browse the repository at this point in the history
This adds the suggestions made by @Brunius in issue kennetek#122.
  • Loading branch information
rpedde committed Aug 27, 2023
1 parent fc8dc87 commit ee5dded
Showing 1 changed file with 51 additions and 20 deletions.
71 changes: 51 additions & 20 deletions gridfinity-rebuilt-utility.scad
Original file line number Diff line number Diff line change
Expand Up @@ -477,33 +477,64 @@ module generate_tabs() {


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));
//Calculate rotation of lip based on which edge it is on
rot = (x == $gxx) ? 0 : ((x == 0) ? 180 : ((y == $gyy) ? 90 : 270));
wall_thickness = r_base-r_c2+d_clear*2;

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);
$dh+h_base]) {
rotate([0, 0, rot])
translate([-r_base-d_clear,-r_base,0]) {
//Extrude the wall profile in circle; same as you would at a corner of bin
//Intersection - limit it to the section where the lip would not interfere with the base
intersection() {
translate([wall_thickness, -r_base*1.5, 0]) cube([wall_thickness, r_base*5, (h_lip)*5]);
translate([0,0,-$dh]) union() {
rotate_extrude(angle=90) profile_wall();
translate([0, r_base*2, 0]) rotate_extrude(angle=-90) profile_wall();
}
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);
}
}
}
}

// 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);
// }
// }
// }
// }

0 comments on commit ee5dded

Please sign in to comment.