mirror of
https://github.com/kennetek/gridfinity-rebuilt-openscad.git
synced 2024-12-22 06:43:25 +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
|
||||
ptl = refined_offset + LAYER_HEIGHT; // Additional layer just in case
|
||||
poke_through_height = REFINED_HOLE_HEIGHT+ptl; // Poke Through Height
|
||||
poke_hole_radius = 2.5; // Poke Through Radius
|
||||
poke_through_height = REFINED_HOLE_HEIGHT + ptl;
|
||||
poke_hole_radius = 2.5;
|
||||
magic_constant = 5.60;
|
||||
poke_hole_center = [-12.53 + magic_constant, 0, -ptl];
|
||||
|
||||
translate([0, 0, refined_offset])
|
||||
union() {
|
||||
hull() {
|
||||
// Magnet hole - smaller than the magnet to keep it squeezed
|
||||
translate([10, -REFINED_HOLE_RADIUS, 0]) cube([1, REFINED_HOLE_RADIUS*2, REFINED_HOLE_HEIGHT]);
|
||||
cylinder(1.9, r=REFINED_HOLE_RADIUS);
|
||||
}
|
||||
hull() {
|
||||
// Poke hole
|
||||
translate([-9+magic_constant, -poke_hole_radius/2, -ptl]) cube([1, poke_hole_radius, poke_through_height]);
|
||||
translate(poke_hole_center) cylinder(poke_through_height, d=poke_hole_radius);
|
||||
}
|
||||
// Magnet hole
|
||||
translate([0, -REFINED_HOLE_RADIUS, 0])
|
||||
cube([11, REFINED_HOLE_RADIUS*2, REFINED_HOLE_HEIGHT]);
|
||||
cylinder(REFINED_HOLE_HEIGHT, r=REFINED_HOLE_RADIUS);
|
||||
|
||||
// Poke hole
|
||||
translate([poke_hole_center.x, -poke_hole_radius/2, poke_hole_center.z])
|
||||
cube([10 - magic_constant, poke_hole_radius, poke_through_height]);
|
||||
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(){
|
||||
pattern_linear(gx/dbnx, gy/dbny, dbnx*l, dbny*l)
|
||||
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])
|
||||
refined_hole();
|
||||
mirror([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();
|
||||
mirror([0, 1, 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();
|
||||
mirror([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();
|
||||
|
||||
copy_mirror([0, 1, 0]) {
|
||||
copy_mirror([1, 0, 0]) {
|
||||
translate([
|
||||
(gx/2)*l_grid - d_hole_from_side,
|
||||
(gy/2) * l_grid - d_hole_from_side,
|
||||
0
|
||||
])
|
||||
if (style_hole == 4) {
|
||||
refined_hole();
|
||||
}else {
|
||||
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 {
|
||||
|
@ -275,11 +272,10 @@ module block_base(gx, gy, l, dbnx, dbny, style_hole, off) {
|
|||
|
||||
if (style_hole > 0)
|
||||
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)
|
||||
translate([l/2-d_hole_from_side, l/2-d_hole_from_side, LAYER_HEIGHT*REFINED_HOLE_BOTTOM_LAYERS])
|
||||
refined_hole();
|
||||
else
|
||||
translate([l/2-d_hole_from_side, l/2-d_hole_from_side, 0])
|
||||
block_base_hole(style_hole, off);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,10 +35,6 @@ MAGNET_HOLE_DEPTH = MAGNET_HEIGHT + (LAYER_HEIGHT * 2);
|
|||
d_hole = 26;
|
||||
// distance of hole from side of bin
|
||||
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.
|
||||
// Smaller than the magnet to keep it squeezed.
|
||||
|
|
Loading…
Reference in a new issue