Below is the code which you should get to by the end of the video if you were following along.
OpenScad
include <libraries/MCAD/boxes.scad> hw=40; d=20; t=6; hr=3; cr=2.5; difference() { union() { translate([(hw/2)-(t/2),0,0]) { //cube([hw,d,t], center=true); roundedBox([hw,d,t],cr,true); } translate([0,0,(hw/2)-(t/2)]) { rotate([0,90,0]) { //cube([hw,d,t], center=true); roundedBox([hw,d,t],cr,true); } } translate([((hw/2)*sqrt(2))/2,0,((hw/2)*sqrt(2))/2]) { rotate([0,45,0]) { cube([hw,d,t], center=true); } } cube([t,d,t],center=true); } translate([(hw/4),0,0]) { cylinder(h=(t*2), r=hr, $fn=100, center=true); } translate([(hw/4)*3,0,0]) { cylinder(h=(t*2), r=hr, $fn=100, center=true); } rotate([0,-90,0]) { translate([(hw/4),0,0]) { cylinder(h=(t*2), r=hr, $fn=100, center=true); } translate([(hw/4)*3,0,0]) { cylinder(h=(t*2), r=hr, $fn=100, center=true); } } translate([(hw/4),0,(hw/2)+(t/2)+0.1]) { cylinder(h=(hw), r=(hr*2), $fn=100, center=true); } translate([(hw/2)+(t/2)+0.1,0,(hw/4)]) { rotate([0,90,0]) { cylinder(h=(hw), r=(hr*2), $fn=100, center=true); } } } |
No comments:
Post a Comment