mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-12-22 14:53:25 +00:00
Added refined_hole function into block_base allowing to select option 4 - Refined holes
This commit is contained in:
parent
a5f5f5b3b7
commit
b50c07a0fb
2 changed files with 41 additions and 4 deletions
|
@ -60,7 +60,7 @@ scoop = 1; //[0:0.1:1]
|
||||||
only_corners = false;
|
only_corners = false;
|
||||||
|
|
||||||
/* [Base] */
|
/* [Base] */
|
||||||
style_hole = 3; // [0:no holes, 1:magnet holes only, 2: magnet and screw holes - no printable slit, 3: magnet and screw holes - printable slit]
|
style_hole = 4; // [0:no holes, 1:magnet holes only, 2: magnet and screw holes - no printable slit, 3: magnet and screw holes - printable slit, 4: Gridfinity Refined hole - no glue needed]
|
||||||
// number of divisions per 1 unit of base along the X axis. (default 1, only use integers. 0 means automatically guess the right division)
|
// number of divisions per 1 unit of base along the X axis. (default 1, only use integers. 0 means automatically guess the right division)
|
||||||
div_base_x = 0;
|
div_base_x = 0;
|
||||||
// number of divisions per 1 unit of base along the Y axis. (default 1, only use integers. 0 means automatically guess the right division)
|
// number of divisions per 1 unit of base along the Y axis. (default 1, only use integers. 0 means automatically guess the right division)
|
||||||
|
|
|
@ -118,9 +118,13 @@ module block_base(gx, gy, l, dbnx, dbny, style_hole, off) {
|
||||||
block_base_solid(dbnx, dbny, l, off);
|
block_base_solid(dbnx, dbny, l, off);
|
||||||
|
|
||||||
if (style_hole > 0)
|
if (style_hole > 0)
|
||||||
pattern_circular(abs(l-d_hole_from_side/2)<0.001?1:4)
|
pattern_circular(abs(l-d_hole_from_side/2)<0.001?1:4)
|
||||||
translate([l/2-d_hole_from_side, l/2-d_hole_from_side, 0])
|
if (style_hole == 4)
|
||||||
block_base_hole(style_hole, off);
|
translate([l/2-d_hole_from_side, l/2-d_hole_from_side, h_slit*2])
|
||||||
|
refined_hole();
|
||||||
|
else
|
||||||
|
translate([l/2-d_hole_from_side, l/2-d_hole_from_side, 0])
|
||||||
|
block_base_hole(style_hole, off);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,6 +165,39 @@ module block_base_hole(style_hole, o=0) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module refined_hole() {
|
||||||
|
/**
|
||||||
|
* Refined hole based on Printables @grizzie17's Gridfinity Refined
|
||||||
|
* https://www.printables.com/model/413761-gridfinity-refined
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Meassured magnet hole diameter to be 5.86mm (meassured in fusion360
|
||||||
|
r = r_hole2-0.32;
|
||||||
|
|
||||||
|
// Magnet height
|
||||||
|
m = 2;
|
||||||
|
mh = m-0.1;
|
||||||
|
|
||||||
|
// Poke through - For removing a magnet using a toothpick
|
||||||
|
ptl = h_slit*3; // Poke Through Layers
|
||||||
|
pth = mh+ptl; // Poke Through Height
|
||||||
|
ptr = 2.5; // Poke Through Radius
|
||||||
|
|
||||||
|
union() {
|
||||||
|
hull() {
|
||||||
|
// Magnet hole - smaller than the magnet to keep it squeezed
|
||||||
|
translate([10, -r, 0]) cube([1, r*2, mh]);
|
||||||
|
cylinder(1.9, r=r);
|
||||||
|
}
|
||||||
|
hull() {
|
||||||
|
// Poke hole
|
||||||
|
translate([-9+5.60, -ptr/2, -ptl]) cube([1, ptr, pth]);
|
||||||
|
translate([-12.53+5.60, 0, -ptl]) cylinder(pth, d=ptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
module profile_wall_sub_sub() {
|
module profile_wall_sub_sub() {
|
||||||
polygon([
|
polygon([
|
||||||
[0,0],
|
[0,0],
|
||||||
|
|
Loading…
Reference in a new issue