Fix Baseplate

Hole changes were not tested against it.
Many oppertunities for improvements here.
This commit is contained in:
Arthur Moore 2024-04-30 01:46:37 -04:00
parent 8346ce4dd3
commit 95219c6cb9
4 changed files with 49 additions and 43 deletions

View file

@ -1,5 +1,6 @@
include <gridfinity-rebuilt-utility.scad>
include <standard.scad>
use <gridfinity-rebuilt-holes.scad>
// ===== INFORMATION ===== //
/*
@ -57,7 +58,6 @@ style_hole = 2; // [0:none, 1:countersink, 2:counterbore]
// ===== IMPLEMENTATION ===== //
screw_together = (style_plate == 3 || style_plate == 4);
color("tomato")
gridfinityBaseplate(gridx, gridy, l_grid, distancex, distancey, style_plate, enable_magnet, style_hole, fitx, fity);
@ -75,7 +75,7 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit
dx = max(gx*length-bp_xy_clearance, dix);
dy = max(gy*length-bp_xy_clearance, diy);
off = calculate_off(sp, sm, sh);
off = calculate_offset(sp, sm, sh);
offsetx = dix < dx ? 0 : (gx*length-bp_xy_clearance-dix)/2*fitx*-1;
offsety = diy < dy ? 0 : (gy*length-bp_xy_clearance-diy)/2*fity*-1;
@ -85,7 +85,7 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit
mirror([0,0,1])
rounded_rectangle(dx, dy, h_base+off, r_base);
gridfinityBase(gx, gy, length, 1, 1, 0, 0.5, false);
gridfinityBase(gx, gy, length, 1, 1, bundle_hole_options(), 0.5, false);
translate([offsetx,offsety,h_base-0.6])
rounded_rectangle(dx*2, dy*2, h_base*2, r_base);
@ -105,33 +105,38 @@ module gridfinityBaseplate(gridx, gridy, length, dix, diy, sp, sm, sh, fitx, fit
hole_pattern(){
if (sm) block_base_hole(1);
if (sm) {
mirror([0, 0, 1])
block_base_hole(bundle_hole_options(magnet_hole=true));
}
translate([0,0,-off])
translate([0,0,-off-TOLLERANCE])
if (sh == 1) cutter_countersink();
else if (sh == 2) cutter_counterbore();
}
}
}
if (sp == 3 || sp ==4) cutter_screw_together(gx, gy, off);
screw_together = sp == 3 || sp == 4;
if (screw_together) cutter_screw_together(gx, gy, off);
}
}
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);
function calculate_offset(style_plate, enable_magnet, style_hole) =
assert(style_plate >=0 && style_plate <=4)
let (screw_together = style_plate == 3 || style_plate == 4)
screw_together ? 6.75 :
style_plate==0 ? 0 :
style_plate==1 ? bp_h_bot :
calculate_offset_skeletonized(enable_magnet, style_hole);
function calculate_offset_skeletonized(enable_magnet, style_hole) =
h_skel + (enable_magnet ? MAGNET_HOLE_DEPTH : 0) +
(
style_hole==0 ? d_screw :
style_hole==1 ? BASEPLATE_SCREW_COUNTERSINK_ADDITIONAL_RADIUS : // Only works because countersink is at 45 degree angle!
BASEPLATE_SCREW_COUNTERBORE_HEIGHT
);
module cutter_weight() {
union() {
@ -156,23 +161,19 @@ module hole_pattern(){
}
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);
}
screw_hole(SCREW_HOLE_RADIUS + d_clear, 2*h_base,
false, BASEPLATE_SCREW_COUNTERSINK_ADDITIONAL_RADIUS);
}
module cutter_counterbore(){
cylinder(h=100*h_base, r=r_hole1+d_clear, center=true);
screw_radius = SCREW_HOLE_RADIUS + d_clear;
counterbore_height = BASEPLATE_SCREW_COUNTERBORE_HEIGHT + 2*LAYER_HEIGHT;
union(){
cylinder(h=2*h_base, r=screw_radius);
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]);
cylinder(h = counterbore_height, r=BASEPLATE_SCREW_COUNTERBORE_RADIUS);
make_hole_printable(screw_radius, BASEPLATE_SCREW_COUNTERBORE_RADIUS, counterbore_height);
}
}
}
@ -185,7 +186,7 @@ module profile_skeleton() {
translate([l_grid/2-d_hole_from_side,l_grid/2-d_hole_from_side,0])
minkowski() {
square([l,l]);
circle(r_hole2+r_skel+2);
circle(MAGNET_HOLE_RADIUS+r_skel+2);
}
}
circle(r_skel);

View file

@ -220,7 +220,7 @@ module screw_hole(radius, height, supportless=false, chamfer_radius=0, chamfer_a
* @param chamfer Add a chamfer to the magnet hole.
* @param supportless If the magnet hole should be printed in such a way that the screw hole does not require supports.
*/
function bundle_hole_options(refined_hole=true, magnet_hole=false, screw_hole=false, crush_ribs=false, chamfer=false, supportless=false) =
function bundle_hole_options(refined_hole=false, magnet_hole=false, screw_hole=false, crush_ribs=false, chamfer=false, supportless=false) =
[refined_hole, magnet_hole, screw_hole, crush_ribs, chamfer, supportless];
/**
@ -230,6 +230,8 @@ function bundle_hole_options(refined_hole=true, magnet_hole=false, screw_hole=fa
* @param o Offset
*/
module block_base_hole(hole_options, o=0) {
assert(is_list(hole_options));
// Destructure the options
refined_hole = hole_options[0];
magnet_hole = hole_options[1];

View file

@ -210,7 +210,7 @@ module profile_base() {
]);
}
module gridfinityBase(gx, gy, l, dx, dy, hole_options, off=0, final_cut=true, only_corners=false) {
module gridfinityBase(gx, gy, l, dx, dy, hole_options=bundle_hole_options(), off=0, final_cut=true, only_corners=false) {
dbnxt = [for (i=[1:5]) if (abs(gx*i)%1 < 0.001 || abs(gx*i)%1 > 0.999) i];
dbnyt = [for (i=[1:5]) if (abs(gy*i)%1 < 0.001 || abs(gy*i)%1 > 0.999) i];
dbnx = 1/(dx==0 ? len(dbnxt) > 0 ? dbnxt[0] : 1 : round(dx));

View file

@ -21,6 +21,10 @@ l_grid = 42;
// Per spec, matches radius of upper base section.
r_base = r_fo1;
// Tollerance to make sure cuts don't leave a sliver behind,
// and that items are properly connected to each other.
TOLLERANCE = 0.01;
// ****************************************
// Magnet / Screw Hole Constants
// ****************************************
@ -50,9 +54,14 @@ MAGNET_HOLE_CRUSH_RIB_INNER_RADIUS = 5.9 / 2;
// Anything 5 or under produces a hole that is not round.
MAGNET_HOLE_CRUSH_RIB_COUNT = 8;
// Radius to add when chamfering magnet and screw holes.
CHAMFER_ADDITIONAL_RADIUS = 0.8;
CHAMFER_ANGLE = 45;
// When countersinking the baseplate, how much to add to the screw radius.
BASEPLATE_SCREW_COUNTERSINK_ADDITIONAL_RADIUS = 5/2;
BASEPLATE_SCREW_COUNTERBORE_RADIUS = 5.5/2;
BASEPLATE_SCREW_COUNTERBORE_HEIGHT = 3;
// ****************************************
// top edge fillet radius
@ -114,13 +123,7 @@ bp_rcut_length = 4.25;
bp_rcut_depth = 2;
// Baseplate clearance offset
bp_xy_clearance = 0.5;
// countersink diameter for baseplate
d_cs = 2.5;
// radius of cutout for skeletonized baseplate
r_skel = 2;
// baseplate counterbore radius
r_cb = 2.75;
// baseplate counterbore depth
h_cb = 3;
// minimum baseplate thickness (when skeletonized)
h_skel = 1;