• API
• FAQ
• Tools
• Archive
SHARE
TWEET # OpenSCAD drone arm holder and mount a guest Mar 26th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. function hypotenuse(a,b) = (a*a + b*b);
2. \$fn=50;
3.
4. //Size of drone
5. drone_size = 500;
6.
7. //Length of cross arms in order to maintain square dimensions
8. cross_l = hypotenuse(drone_size,drone_size);
9.
10. //Diameter of the rod, along with radius
11. rod_d = 15.8+0.2;
12. rod_r = rod_d/2;
13.
14. //Thickness of the fitting the rods insert into
15. fit_th = 5;
16. fit_in_r = rod_r;   //Inner radius, same as rod that will insert
17. fit_in_d = fit_in_r * 2;    //Diameter
18. fit_out_r = rod_r + fit_th; //Outer radius, added thickness
19. fit_out_d = fit_out_r * 2; //Diameter
20.
21. //Length of the fitting outward (aka radius)
22. fit_l = 50;
23. difference(){
24.     union(){
25.         translate([0,0,fit_in_r])
26.             cylinder(r=fit_l,h=fit_th);
27.         rotate([0,90,0])
28.             cross_fitting(fit_l,fit_in_d,fit_out_d,false);
29.     }
30.
31.     translate([0,0,fit_out_r])
32.         union(){
37.         }
38.             translate([0,0,-fit_out_r])
39.             union(){
40.             rotate([0,180,0])
42.             rotate([0,180,0])
44.             }
45.             translate([0,0,fit_out_r])
46.     rotate(45)
48. }
49. module cross_fitting(r,in_d,out_d,through=false){
50.     difference(){
51.     //Create the base cross we'll cut out
52.         for(i=[0:4-1]){
53.                 rotate([360/4*i,0,0])
54.                     cylinder(d=out_d,h=r);
55.             }
56.
57.         for(i=[0:4-1]){
58.             rotate([360/4*i,0,0])
59.             if(through == true){
60.                 cylinder(d=in_d,h=r+1);
61.             }else{
62.                 translate([0,0,out_d/2])
63.                 cylinder(d=in_d,h=r+1);
64.             }
65.
66.         }
67.     }
68. }