$fn=32; //(1) CylinderWithFilet(H,R,F); //(2) CylinderWithTopFilet(H,R,F); ////Cylinder is centered on the z-axis and y in [0;H], R must be >=2*F // //(3) RoundedRectangleWithHeightAndFilet(dx,dy,dz,R,F); //(4) RoundedRectangleWithHeightAndTopFilet(dx,dy,dz,R,F); ////RoundedRectangle starts on [0,0,0] and ends on [dx,dy,dz], R must be >=2*F // //(5) BoxWithFilet(dx,dy,dz,F); //(6) BoxWithTopFilet(dx,dy,dz,F); ////Box starts on [0,0,0] and ends on [dx,dy,dz] //************************************ //**** **** //**** CylinderWithFilet **** //**** **** //**** CylinderWithTopFilet **** //**** **** //************************************ //H=height //R=radius must be >=2*F //F=Filet //Cylinder is centered on the z-axis and y in [0;H] module CylinderWithFilet(H,R,F) { translate([0,0,F]) cylinder(H-2*F,R,R); cylinder(H,R-F,R-F); color("red") translate([0,0,F]) rotate_extrude(convexity = 10) translate([R-F, 0, 0]) circle(F); color("red") translate([0,0,H-F]) rotate_extrude(convexity = 10) translate([R-F, 0, 0]) circle(F); } module CylinderWithTopFilet(H,R,F) { cylinder(H-F,R,R); cylinder(H,R-F,R-F); color("red") translate([0,0,H-F]) rotate_extrude(convexity = 10) translate([R-F, 0, 0]) circle(1); } //***************************************************** //**** **** //**** RoundedRectangleWithHeightAndFilet **** //**** **** //**** RoundedRectangleWithHeightAndTopFilet **** //**** **** //***************************************************** //R=radius must be >=2*F //F=Filet //RoundedRectangle starts on [0,0,0] and ends on [dx,dy,dz] module RoundedRectangleWithHeightAndFilet(dx,dy,dz,R,F) { translate([R,R,0]) CylinderWithFilet(dz,R,F); translate([dx-R,R,0]) CylinderWithFilet(dz,R,F); translate([R,dy-R,0]) CylinderWithFilet(dz,R,F); translate([dx-R,dy-R,0]) CylinderWithFilet(dz,R,F); //x-axis aligned cylinders color("red") translate([R,F,F]) rotate([0,90,0]) cylinder(dx-2*R,F,F); color("red") translate([R,dy-F,F]) rotate([0,90,0]) cylinder(dx-2*R,F,F); color("red") translate([R,F,dz-F]) rotate([0,90,0]) cylinder(dx-2*R,F,F); color("red") translate([R,dy-F,dz-F]) rotate([0,90,0]) cylinder(dx-2*R,F,F); //y-axis aligned cylinders color("red") translate([F,R,F]) rotate([270,0,0]) cylinder(dy-2*R,F,F); color("red") translate([dx-F,R,F]) rotate([270,0,0]) cylinder(dy-2*R,F,F); color("red") translate([F,R,dz-F]) rotate([270,0,0]) cylinder(dy-2*R,F,F); color("red") translate([dx-F,R,dz-F]) rotate([270,0,0]) cylinder(dy-2*R,F,F); //boxes to fill translate([0,R,F]) cube([dx,dy-2*R,dz-2*F]); translate([R,0,F]) cube([dx-2*R,dy,dz-2*F]); translate([F,R,0]) cube([dx-2*F,dy-2*R,dz]); translate([R,F,0]) cube([dx-2*R,dy-2*F,dz]); } module RoundedRectangleWithHeightAndTopFilet(dx,dy,dz,R,F) { translate([R,R,0]) CylinderWithTopFilet(dz,R,F); translate([dx-R,R,0]) CylinderWithTopFilet(dz,R,F); translate([R,dy-R,0]) CylinderWithTopFilet(dz,R,F); translate([dx-R,dy-R,0]) CylinderWithTopFilet(dz,R,F); //x-axis aligned cylinders color("red") translate([R,F,dz-F]) rotate([0,90,0]) cylinder(dx-2*R,F,F); color("red") translate([R,dy-F,dz-F]) rotate([0,90,0]) cylinder(dx-2*R,F,F); //y-axis aligned cylinders color("red") translate([F,R,dz-F]) rotate([270,0,0]) cylinder(dy-2*R,F,F); color("red") translate([dx-F,R,dz-F]) rotate([270,0,0]) cylinder(dy-2*R,F,F); //boxes to fill translate([0,R,0]) cube([dx,dy-2*R,dz-F]); translate([R,0,0]) cube([dx-2*R,dy,dz-F]); translate([F,R,0]) cube([dx-2*F,dy-2*R,dz]); translate([R,F,0]) cube([dx-2*R,dy-2*F,dz]); } //****************************** //**** **** //**** BoxWithFilet **** //**** **** //**** BoxWithTopFilet **** //**** **** //****************************** //Box starts on [0,0,0] and ends on [dx,dy,dz] module BoxWithFilet(dx,dy,dz,F) { //4 spheres on the bottom, 4 spheres on top color("red") translate([F,F,F]) sphere(F); color("red") translate([dx-F,F,F]) sphere(F); color("red") translate([dx-F,dy-F,F]) sphere(F); color("red") translate([F,dy-F,F]) sphere(F); color("red") translate([F,F,dz-F]) sphere(F); color("red") translate([dx-F,F,dz-F]) sphere(F); color("red") translate([dx-F,dy-F,dz-F]) sphere(F); color("red") translate([F,dy-F,dz-F]) sphere(F); //x axis aligned cylinders color("red") translate([F,F,F]) rotate([0,90,0]) cylinder(dx-2*F,F,F); color("red") translate([F,dy-F,F]) rotate([0,90,0]) cylinder(dx-2*F,F,F); color("red") translate([F,F,dz-F]) rotate([0,90,0]) cylinder(dx-2*F,F,F); color("red") translate([F,dy-F,dz-F]) rotate([0,90,0]) cylinder(dx-2*F,F,F); //y aligned cylinders color("red") translate([F,F,F]) rotate([270,0,0]) cylinder(dy-2*F,F,F); color("red") translate([dx-F,F,F]) rotate([270,0,0]) cylinder(dy-2*F,F,F); color("red") translate([F,F,dz-F]) rotate([270,0,0]) cylinder(dy-2*F,F,F); color("red") translate([dx-F,F,dz-F]) rotate([270,0,0]) cylinder(dy-2*F,F,F); //z aligned cylinders color("red") translate([F,F,F]) cylinder(dz-2*F,F,F); color("red") translate([dx-F,F,F]) cylinder(dz-2*F,F,F); color("red") translate([F,dy-F,F]) cylinder(dz-2*F,F,F); color("red") translate([dx-F,dy-F,F]) cylinder(dz-2*F,F,F); //3 boxes to fill the inside translate([F,F,0]) cube([dx-2*F,dy-2*F,dz]); translate([0,F,F]) cube([dx,dy-2*F,dz-2*F]); translate([F,0,F]) cube([dx-2*F,dy,dz-2*F]); } //The bottom of this box is not rounded module BoxWithTopFilet(dx,dy,dz,F) { //4 spheres on the bottom, 4 spheres on top color("red") translate([F,F,dz-F]) sphere(F); color("red") translate([dx-F,F,dz-F]) sphere(F); color("red") translate([dx-F,dy-F,dz-F]) sphere(F); color("red") translate([F,dy-F,dz-F]) sphere(F); //x axis aligned cylinders color("red") translate([F,F,dz-F]) rotate([0,90,0]) cylinder(dx-2*F,F,F); color("red") translate([F,dy-F,dz-F]) rotate([0,90,0]) cylinder(dx-2*F,F,F); //y aligned cylinders color("red") translate([F,F,dz-F]) rotate([270,0,0]) cylinder(dy-2*F,F,F); color("red") translate([dx-F,F,dz-F]) rotate([270,0,0]) cylinder(dy-2*F,F,F); //z aligned cylinders color("red") translate([F,F,0]) cylinder(dz-F,F,F); color("red") translate([dx-F,F,0]) cylinder(dz-F,F,F); color("red") translate([F,dy-F,0]) cylinder(dz-F,F,F); color("red") translate([dx-F,dy-F,0]) cylinder(dz-F,F,F); //3 boxes to fill the inside translate([F,F,0]) cube([dx-2*F,dy-2*F,dz]); translate([0,F,0]) cube([dx,dy-2*F,dz-F]); translate([F,0,0]) cube([dx-2*F,dy,dz-F]); } R1=6.45; L1=148.8; H1=5.5; F1=1; //Filet CylinderWithFilet(H1,R1,F1); translate([0,2*R1+8,0]) CylinderWithTopFilet(H1,R1,F1); translate([R1+2,0,0]) RoundedRectangleWithHeightAndFilet(20,30,10,5,1); translate([R1+24,0,0]) RoundedRectangleWithHeightAndTopFilet(20,30,10,5,1); translate([R1+46,0,0]) BoxWithFilet(20,30,10,1); translate([R1+68,0,0]) BoxWithTopFilet(20,30,10,1); //RoundedRectangleWithHeightAndFilet(L1,L1,H1,R1,F1);