mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-12-22 23:03:28 +00:00
Simplify refined_hole()
This commit is contained in:
parent
67ba594585
commit
a4200a04bd
3 changed files with 27 additions and 34 deletions
|
@ -17,22 +17,23 @@ module refined_hole() {
|
||||||
|
|
||||||
// Poke through - For removing a magnet using a toothpick
|
// Poke through - For removing a magnet using a toothpick
|
||||||
ptl = refined_offset + LAYER_HEIGHT; // Additional layer just in case
|
ptl = refined_offset + LAYER_HEIGHT; // Additional layer just in case
|
||||||
poke_through_height = REFINED_HOLE_HEIGHT+ptl; // Poke Through Height
|
poke_through_height = REFINED_HOLE_HEIGHT + ptl;
|
||||||
poke_hole_radius = 2.5; // Poke Through Radius
|
poke_hole_radius = 2.5;
|
||||||
magic_constant = 5.60;
|
magic_constant = 5.60;
|
||||||
poke_hole_center = [-12.53 + magic_constant, 0, -ptl];
|
poke_hole_center = [-12.53 + magic_constant, 0, -ptl];
|
||||||
|
|
||||||
|
translate([0, 0, refined_offset])
|
||||||
union() {
|
union() {
|
||||||
hull() {
|
// Magnet hole
|
||||||
// Magnet hole - smaller than the magnet to keep it squeezed
|
translate([0, -REFINED_HOLE_RADIUS, 0])
|
||||||
translate([10, -REFINED_HOLE_RADIUS, 0]) cube([1, REFINED_HOLE_RADIUS*2, REFINED_HOLE_HEIGHT]);
|
cube([11, REFINED_HOLE_RADIUS*2, REFINED_HOLE_HEIGHT]);
|
||||||
cylinder(1.9, r=REFINED_HOLE_RADIUS);
|
cylinder(REFINED_HOLE_HEIGHT, r=REFINED_HOLE_RADIUS);
|
||||||
}
|
|
||||||
hull() {
|
// Poke hole
|
||||||
// Poke hole
|
translate([poke_hole_center.x, -poke_hole_radius/2, poke_hole_center.z])
|
||||||
translate([-9+magic_constant, -poke_hole_radius/2, -ptl]) cube([1, poke_hole_radius, poke_through_height]);
|
cube([10 - magic_constant, poke_hole_radius, poke_through_height]);
|
||||||
translate(poke_hole_center) cylinder(poke_through_height, d=poke_hole_radius);
|
translate(poke_hole_center)
|
||||||
}
|
cylinder(poke_through_height, d=poke_hole_radius);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -231,24 +231,21 @@ module gridfinityBase(gx, gy, l, dx, dy, style_hole, off=0, final_cut=true, only
|
||||||
difference(){
|
difference(){
|
||||||
pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l)
|
pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l)
|
||||||
block_base(gx, gy, l, dbnx, dbny, 0, off);
|
block_base(gx, gy, l, dbnx, dbny, 0, off);
|
||||||
if (style_hole == 4) {
|
|
||||||
translate([(gx/2)*l_grid - d_hole_from_side, (gy/2) * l_grid - d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS])
|
copy_mirror([0, 1, 0]) {
|
||||||
refined_hole();
|
copy_mirror([1, 0, 0]) {
|
||||||
mirror([1, 0, 0])
|
translate([
|
||||||
translate([(gx/2)*l_grid - d_hole_from_side, (gy/2) * l_grid - d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS])
|
(gx/2)*l_grid - d_hole_from_side,
|
||||||
refined_hole();
|
(gy/2) * l_grid - d_hole_from_side,
|
||||||
mirror([0, 1, 0]) {
|
0
|
||||||
translate([(gx/2)*l_grid - d_hole_from_side, (gy/2) * l_grid - d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS])
|
])
|
||||||
refined_hole();
|
if (style_hole == 4) {
|
||||||
mirror([1, 0, 0])
|
refined_hole();
|
||||||
translate([(gx/2)*l_grid - d_hole_from_side, (gy/2) * l_grid - d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS])
|
}else {
|
||||||
refined_hole();
|
block_base_hole(style_hole, off);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
pattern_linear(2, 2, (gx-1)*l_grid+d_hole, (gy-1)*l_grid+d_hole)
|
|
||||||
block_base_hole(style_hole, off);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -275,11 +272,10 @@ module block_base(gx, gy, l, dbnx, dbny, style_hole, 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)
|
if (style_hole == 4)
|
||||||
translate([l/2-d_hole_from_side, l/2-d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS])
|
|
||||||
refined_hole();
|
refined_hole();
|
||||||
else
|
else
|
||||||
translate([l/2-d_hole_from_side, l/2-d_hole_from_side, 0])
|
|
||||||
block_base_hole(style_hole, off);
|
block_base_hole(style_hole, off);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,6 @@ MAGNET_HOLE_DEPTH = MAGNET_HEIGHT + (LAYER_HEIGHT * 2);
|
||||||
d_hole = 26;
|
d_hole = 26;
|
||||||
// distance of hole from side of bin
|
// distance of hole from side of bin
|
||||||
d_hole_from_side=8;
|
d_hole_from_side=8;
|
||||||
// magnet hole depth
|
|
||||||
h_hole = 2.4;
|
|
||||||
// slit depth (printer layer height)
|
|
||||||
h_slit = 0.2;
|
|
||||||
|
|
||||||
// Meassured diameter in Fusion360.
|
// Meassured diameter in Fusion360.
|
||||||
// Smaller than the magnet to keep it squeezed.
|
// Smaller than the magnet to keep it squeezed.
|
||||||
|
|
Loading…
Reference in a new issue