Skip to content

Instantly share code, notes, and snippets.

@hrobeers
Created October 28, 2015 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hrobeers/c55616a7b3d497845c07 to your computer and use it in GitHub Desktop.
Save hrobeers/c55616a7b3d497845c07 to your computer and use it in GitHub Desktop.
//hexcut(5, 3, 10, 10);
module hexcut (radius, depth, height, width) {
for (i = [0:ceil(height/(radius*2))]) {
for (j = [0:ceil(width/(radius*2))]) {
x = i*radius*2;
y = j*radius*1.75;
translate([x+(j%2*radius),y,0])
rotate([0,0,30])
cylinder(r=radius,h=depth,$fn=6);
}}
}
include<hexcut.scad>
height = 85; // height to center of cylinder
width = 70; // = diameter of cylinder
depth = 13; // thickness
wallthick = 1.5;
hole_r = 15;
cut_depth = 8;
$fn = 100;
difference()
{
union() {
difference() {
shape(0);
hex_cut();
}
ring();
}
round_cut();
}
module shape (substract)
{
H=height-substract;
W=width-2*substract;
D=depth;
difference() {
union() {
cylinder(h=D, d=W, center=false);
translate([0,-W/2,0])
cube([H, W, D], center=false);
}
cylinder(h=D*3, r=hole_r+substract, center=true);
}
}
module hex_cut ()
{
intersection ()
{
translate([0,0,-wallthick])
shape(wallthick);
radius = wallthick*2.5;
translate([-height/2,-width/2+radius/2,-wallthick])
hexcut(radius, depth, height*2, width);
}
}
module ring ()
{
difference() {
cylinder(h=depth, d=width, center=false);
translate([0,0,wallthick])
cylinder(h=depth, d=width-2*wallthick, center=false);
}
}
module round_cut ()
{
cylinder(h=cut_depth*2,
d=width-2*wallthick,
center=true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment