Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function hypotenuse(a,b) = (a*a + b*b);
- $fn=50;
- //Size of drone
- drone_size = 500;
- //Length of cross arms in order to maintain square dimensions
- cross_l = hypotenuse(drone_size,drone_size);
- //Diameter of the rod, along with radius
- rod_d = 15.8+0.2;
- rod_r = rod_d/2;
- //Thickness of the fitting the rods insert into
- fit_th = 5;
- fit_in_r = rod_r; //Inner radius, same as rod that will insert
- fit_in_d = fit_in_r * 2; //Diameter
- fit_out_r = rod_r + fit_th; //Outer radius, added thickness
- fit_out_d = fit_out_r * 2; //Diameter
- //Length of the fitting outward (aka radius)
- fit_l = 50;
- difference(){
- union(){
- translate([0,0,fit_in_r])
- cylinder(r=fit_l,h=fit_th);
- rotate([0,90,0])
- cross_fitting(fit_l,fit_in_d,fit_out_d,false);
- }
- translate([0,0,fit_out_r])
- union(){
- radial_hole_punch(fit_l/2,4,4.01,fit_out_d);
- radial_hole_punch(fit_l-fit_th*2,4,4.01,fit_out_d);
- radial_hole_punch(fit_l/2,4,8,fit_th/2);
- radial_hole_punch(fit_l-fit_th*2,4,8,fit_th/2);
- }
- translate([0,0,-fit_out_r])
- union(){
- rotate([0,180,0])
- radial_hole_punch(fit_l/2,4,8,fit_th/2);
- rotate([0,180,0])
- radial_hole_punch(fit_l-fit_th*2,4,8,fit_th/2);
- }
- translate([0,0,fit_out_r])
- rotate(45)
- radial_hole_punch(fit_l/2,4,4,fit_th);
- }
- module cross_fitting(r,in_d,out_d,through=false){
- difference(){
- //Create the base cross we'll cut out
- for(i=[0:4-1]){
- rotate([360/4*i,0,0])
- cylinder(d=out_d,h=r);
- }
- for(i=[0:4-1]){
- rotate([360/4*i,0,0])
- if(through == true){
- cylinder(d=in_d,h=r+1);
- }else{
- translate([0,0,out_d/2])
- cylinder(d=in_d,h=r+1);
- }
- }
- }
- }
- module radial_hole_punch(r,holes,hole_d,depth){
- for(i=[0:holes-1]){
- rotate(360/holes*i)
- translate([r,0,0])
- mirror([0,0,1])
- cylinder(d=hole_d,h=depth);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement