From b2104fbb973f7959cf67d9d002952359d7a4eaf5 Mon Sep 17 00:00:00 2001 From: Ruud Swinkels Date: Sat, 18 Feb 2023 14:09:31 +0100 Subject: [PATCH 1/3] Fix magnet holes, bottom height when using screw together --- gridfinity-rebuilt-baseplate.scad | 52 ++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/gridfinity-rebuilt-baseplate.scad b/gridfinity-rebuilt-baseplate.scad index 4cbb665..c3ee0f0 100644 --- a/gridfinity-rebuilt-baseplate.scad +++ b/gridfinity-rebuilt-baseplate.scad @@ -16,9 +16,9 @@ $fs = 0.25; /* [General Settings] */ // number of bases along x-axis -gridx = 4; +gridx = 2; // number of bases along y-axis -gridy = 4; +gridy = 2; // base unit length = 42; @@ -54,7 +54,7 @@ style_plate = 0; // [0: thin, 1:weighted, 2:skeletonized, 3: screw together, 4: enable_magnet = true; // hole styles -style_hole = 2; // [0:none, 1:contersink, 2:counterbore] +style_hole = 1; // [0:none, 1:contersink, 2:counterbore] // ===== IMPLEMENTATION ===== // @@ -75,7 +75,7 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit dx = max(gx*length-0.5, dix); dy = max(gy*length-0.5, diy); - off = (sp==0?0:sp==1?bp_h_bot:h_skel+(sm?h_hole:0)+(sh==0?(sp!=3&&sp!=4)?0:d_screw:sh==1?d_cs:h_cb)); + off = (sp==0?0:sp==1?bp_h_bot:h_skel+(sm||sp==3||sp==4?h_hole:0)+(sh==0?(sp!=3&&sp!=4)?0:d_screw:sh==1?d_cs:h_cb)); offsetx = dix < dx ? 0 : (gx*length-0.5-dix)/2*fitx*-1; offsety = diy < dy ? 0 : (gy*length-0.5-diy)/2*fity*-1; @@ -91,8 +91,6 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit rounded_rectangle(dx*2, dy*2, h_base*2, r_base); pattern_linear(gx, gy, length) { - if (sm) block_base_hole(1); - if (sp == 1) translate([0,0,-off]) cutter_weight(); @@ -103,7 +101,11 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit translate([0,0,-5*(h_base+off)]) rounded_square(length-2*r_c2-2*r_c1, 10*(h_base+off), r_fo3); - translate([0,0,-off]) { + + hole_pattern(){ + if (sm) block_base_hole(1); + + translate([0,0,-off]) if (sh == 1) cutter_countersink(); else if (sh == 2) cutter_counterbore(); } @@ -127,9 +129,37 @@ module cutter_weight() { } } } +module hole_pattern(){ + pattern_circular(4) + translate([d_hole/2, d_hole/2, 0]) { + render(); + children(); + } +} -module cutter_countersink() { - pattern_circular(4) +module cutter_countersink(){ + cylinder(r = r_hole1+d_clear, h = 100*h_base, center = true); + translate([0,0,d_cs]) + mirror([0,0,1]) + hull() { + cylinder(h = d_cs+10, r=r_hole1+d_clear); + translate([0,0,d_cs]) + cylinder(h=d_cs+10, r=r_hole1+d_clear+d_cs); + } +} + +module cutter_counterbore(){ + cylinder(h=100*h_base, r=r_hole1+d_clear, center=true); + difference() { + cylinder(h = 2*(h_cb+0.2), r=r_cb, center=true); + copy_mirror([0,1,0]) + translate([-1.5*r_cb,r_hole1+d_clear+0.1,h_cb-h_slit]) + cube([r_cb*3,r_cb*3, 10]); + } +} + +module cutter_countersink2() { + pattern_circular(4) translate([d_hole/2, d_hole/2, 0]) { cylinder(r = r_hole1+d_clear, h = 100*h_base, center = true); @@ -143,9 +173,9 @@ module cutter_countersink() { } } -module cutter_counterbore() { +module cutter_counterbore2() { pattern_circular(4) - translate([d_hole/2,d_hole/2,0]) { + translate([d_hole/2, d_hole/2, 0]) { cylinder(h=100*h_base, r=r_hole1+d_clear, center=true); difference() { cylinder(h = 2*(h_cb+0.2), r=r_cb, center=true); From ea426c4d406aa2ec781cc8c02f28f0719363c2b1 Mon Sep 17 00:00:00 2001 From: Ruud Swinkels Date: Wed, 22 Feb 2023 21:33:01 +0100 Subject: [PATCH 2/3] make all screw-togethers compatible in height --- gridfinity-rebuilt-baseplate.scad | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gridfinity-rebuilt-baseplate.scad b/gridfinity-rebuilt-baseplate.scad index c3ee0f0..8750e53 100644 --- a/gridfinity-rebuilt-baseplate.scad +++ b/gridfinity-rebuilt-baseplate.scad @@ -58,6 +58,7 @@ style_hole = 1; // [0:none, 1:contersink, 2:counterbore] // ===== IMPLEMENTATION ===== // +screw_together = (style_plate == 3 || style_plate == 4); color("tomato") gridfinityBaseplate(gridx, gridy, length, distancex, distancey, style_plate, enable_magnet, style_hole, fitx, fity); @@ -75,7 +76,7 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit dx = max(gx*length-0.5, dix); dy = max(gy*length-0.5, diy); - off = (sp==0?0:sp==1?bp_h_bot:h_skel+(sm||sp==3||sp==4?h_hole:0)+(sh==0?(sp!=3&&sp!=4)?0:d_screw:sh==1?d_cs:h_cb)); + off = calculate_off(sp, sm, sh); offsetx = dix < dx ? 0 : (gx*length-0.5-dix)/2*fitx*-1; offsety = diy < dy ? 0 : (gy*length-0.5-diy)/2*fity*-1; @@ -115,6 +116,21 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit } +function calculate_off(sp, sm, sh) = + screw_together + ? 6.75 + :sp==0 + ?0 + : sp==1 + ?bp_h_bot + :h_skel + (sm + ?h_hole + : 0)+(sh==0 + ? d_screw + : sh==1 + ?d_cs + :h_cb); + module cutter_weight() { union() { linear_extrude(bp_cut_depth*2,center=true) From cd6f68093f79e0032036d82330a880002b9224eb Mon Sep 17 00:00:00 2001 From: Ruud Swinkels Date: Wed, 22 Feb 2023 21:41:51 +0100 Subject: [PATCH 3/3] cleanup leftover code --- gridfinity-rebuilt-baseplate.scad | 34 +++---------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/gridfinity-rebuilt-baseplate.scad b/gridfinity-rebuilt-baseplate.scad index 8750e53..04cf771 100644 --- a/gridfinity-rebuilt-baseplate.scad +++ b/gridfinity-rebuilt-baseplate.scad @@ -16,9 +16,9 @@ $fs = 0.25; /* [General Settings] */ // number of bases along x-axis -gridx = 2; +gridx = 4; // number of bases along y-axis -gridy = 2; +gridy = 4; // base unit length = 42; @@ -54,7 +54,7 @@ style_plate = 0; // [0: thin, 1:weighted, 2:skeletonized, 3: screw together, 4: enable_magnet = true; // hole styles -style_hole = 1; // [0:none, 1:contersink, 2:counterbore] +style_hole = 2; // [0:none, 1:contersink, 2:counterbore] // ===== IMPLEMENTATION ===== // @@ -174,34 +174,6 @@ module cutter_counterbore(){ } } -module cutter_countersink2() { - pattern_circular(4) - translate([d_hole/2, d_hole/2, 0]) { - cylinder(r = r_hole1+d_clear, h = 100*h_base, center = true); - - translate([0,0,d_cs]) - mirror([0,0,1]) - hull() { - cylinder(h = d_cs+10, r=r_hole1+d_clear); - translate([0,0,d_cs]) - cylinder(h=d_cs+10, r=r_hole1+d_clear+d_cs); - } - } -} - -module cutter_counterbore2() { - pattern_circular(4) - translate([d_hole/2, d_hole/2, 0]) { - cylinder(h=100*h_base, r=r_hole1+d_clear, center=true); - difference() { - cylinder(h = 2*(h_cb+0.2), r=r_cb, center=true); - copy_mirror([0,1,0]) - translate([-1.5*r_cb,r_hole1+d_clear+0.1,h_cb-h_slit]) - cube([r_cb*3,r_cb*3, 10]); - } - } -} - module profile_skeleton() { l = length-2*r_c2-2*r_c1; minkowski() {