mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-12-22 14:53:25 +00:00
Fix Baseplate
Hole changes were not tested against it. Many oppertunities for improvements here.
This commit is contained in:
parent
8346ce4dd3
commit
95219c6cb9
4 changed files with 49 additions and 43 deletions
|
@ -1,5 +1,6 @@
|
||||||
include <gridfinity-rebuilt-utility.scad>
|
include <gridfinity-rebuilt-utility.scad>
|
||||||
include <standard.scad>
|
include <standard.scad>
|
||||||
|
use <gridfinity-rebuilt-holes.scad>
|
||||||
|
|
||||||
// ===== INFORMATION ===== //
|
// ===== INFORMATION ===== //
|
||||||
/*
|
/*
|
||||||
|
@ -57,7 +58,6 @@ style_hole = 2; // [0:none, 1:countersink, 2:counterbore]
|
||||||
|
|
||||||
|
|
||||||
// ===== IMPLEMENTATION ===== //
|
// ===== IMPLEMENTATION ===== //
|
||||||
screw_together = (style_plate == 3 || style_plate == 4);
|
|
||||||
|
|
||||||
color("tomato")
|
color("tomato")
|
||||||
gridfinityBaseplate(gridx, gridy, l_grid, distancex, distancey, style_plate, enable_magnet, style_hole, fitx, fity);
|
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);
|
dx = max(gx*length-bp_xy_clearance, dix);
|
||||||
dy = max(gy*length-bp_xy_clearance, diy);
|
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;
|
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;
|
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])
|
mirror([0,0,1])
|
||||||
rounded_rectangle(dx, dy, h_base+off, r_base);
|
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])
|
translate([offsetx,offsety,h_base-0.6])
|
||||||
rounded_rectangle(dx*2, dy*2, h_base*2, r_base);
|
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(){
|
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();
|
if (sh == 1) cutter_countersink();
|
||||||
else if (sh == 2) cutter_counterbore();
|
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) =
|
function calculate_offset(style_plate, enable_magnet, style_hole) =
|
||||||
screw_together
|
assert(style_plate >=0 && style_plate <=4)
|
||||||
? 6.75
|
let (screw_together = style_plate == 3 || style_plate == 4)
|
||||||
:sp==0
|
screw_together ? 6.75 :
|
||||||
?0
|
style_plate==0 ? 0 :
|
||||||
: sp==1
|
style_plate==1 ? bp_h_bot :
|
||||||
?bp_h_bot
|
calculate_offset_skeletonized(enable_magnet, style_hole);
|
||||||
:h_skel + (sm
|
|
||||||
?h_hole
|
function calculate_offset_skeletonized(enable_magnet, style_hole) =
|
||||||
: 0)+(sh==0
|
h_skel + (enable_magnet ? MAGNET_HOLE_DEPTH : 0) +
|
||||||
? d_screw
|
(
|
||||||
: sh==1
|
style_hole==0 ? d_screw :
|
||||||
?d_cs
|
style_hole==1 ? BASEPLATE_SCREW_COUNTERSINK_ADDITIONAL_RADIUS : // Only works because countersink is at 45 degree angle!
|
||||||
:h_cb);
|
BASEPLATE_SCREW_COUNTERBORE_HEIGHT
|
||||||
|
);
|
||||||
|
|
||||||
module cutter_weight() {
|
module cutter_weight() {
|
||||||
union() {
|
union() {
|
||||||
|
@ -156,23 +161,19 @@ module hole_pattern(){
|
||||||
}
|
}
|
||||||
|
|
||||||
module cutter_countersink(){
|
module cutter_countersink(){
|
||||||
cylinder(r = r_hole1+d_clear, h = 100*h_base, center = true);
|
screw_hole(SCREW_HOLE_RADIUS + d_clear, 2*h_base,
|
||||||
translate([0,0,d_cs])
|
false, BASEPLATE_SCREW_COUNTERSINK_ADDITIONAL_RADIUS);
|
||||||
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(){
|
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() {
|
difference() {
|
||||||
cylinder(h = 2*(h_cb+0.2), r=r_cb, center=true);
|
cylinder(h = counterbore_height, r=BASEPLATE_SCREW_COUNTERBORE_RADIUS);
|
||||||
copy_mirror([0,1,0])
|
make_hole_printable(screw_radius, BASEPLATE_SCREW_COUNTERBORE_RADIUS, counterbore_height);
|
||||||
translate([-1.5*r_cb,r_hole1+d_clear+0.1,h_cb-h_slit])
|
}
|
||||||
cube([r_cb*3,r_cb*3, 10]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +186,7 @@ module profile_skeleton() {
|
||||||
translate([l_grid/2-d_hole_from_side,l_grid/2-d_hole_from_side,0])
|
translate([l_grid/2-d_hole_from_side,l_grid/2-d_hole_from_side,0])
|
||||||
minkowski() {
|
minkowski() {
|
||||||
square([l,l]);
|
square([l,l]);
|
||||||
circle(r_hole2+r_skel+2);
|
circle(MAGNET_HOLE_RADIUS+r_skel+2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
circle(r_skel);
|
circle(r_skel);
|
||||||
|
|
|
@ -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 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.
|
* @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];
|
[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
|
* @param o Offset
|
||||||
*/
|
*/
|
||||||
module block_base_hole(hole_options, o=0) {
|
module block_base_hole(hole_options, o=0) {
|
||||||
|
assert(is_list(hole_options));
|
||||||
|
|
||||||
// Destructure the options
|
// Destructure the options
|
||||||
refined_hole = hole_options[0];
|
refined_hole = hole_options[0];
|
||||||
magnet_hole = hole_options[1];
|
magnet_hole = hole_options[1];
|
||||||
|
|
|
@ -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];
|
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];
|
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));
|
dbnx = 1/(dx==0 ? len(dbnxt) > 0 ? dbnxt[0] : 1 : round(dx));
|
||||||
|
|
|
@ -21,6 +21,10 @@ l_grid = 42;
|
||||||
// Per spec, matches radius of upper base section.
|
// Per spec, matches radius of upper base section.
|
||||||
r_base = r_fo1;
|
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
|
// 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.
|
// Anything 5 or under produces a hole that is not round.
|
||||||
MAGNET_HOLE_CRUSH_RIB_COUNT = 8;
|
MAGNET_HOLE_CRUSH_RIB_COUNT = 8;
|
||||||
|
|
||||||
|
// Radius to add when chamfering magnet and screw holes.
|
||||||
CHAMFER_ADDITIONAL_RADIUS = 0.8;
|
CHAMFER_ADDITIONAL_RADIUS = 0.8;
|
||||||
CHAMFER_ANGLE = 45;
|
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
|
// top edge fillet radius
|
||||||
|
@ -114,13 +123,7 @@ bp_rcut_length = 4.25;
|
||||||
bp_rcut_depth = 2;
|
bp_rcut_depth = 2;
|
||||||
// Baseplate clearance offset
|
// Baseplate clearance offset
|
||||||
bp_xy_clearance = 0.5;
|
bp_xy_clearance = 0.5;
|
||||||
// countersink diameter for baseplate
|
|
||||||
d_cs = 2.5;
|
|
||||||
// radius of cutout for skeletonized baseplate
|
// radius of cutout for skeletonized baseplate
|
||||||
r_skel = 2;
|
r_skel = 2;
|
||||||
// baseplate counterbore radius
|
|
||||||
r_cb = 2.75;
|
|
||||||
// baseplate counterbore depth
|
|
||||||
h_cb = 3;
|
|
||||||
// minimum baseplate thickness (when skeletonized)
|
// minimum baseplate thickness (when skeletonized)
|
||||||
h_skel = 1;
|
h_skel = 1;
|
||||||
|
|
Loading…
Reference in a new issue