Advertisement
Guest User

OpenSCAD drone arm holder and mount

a guest
Mar 26th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  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(){
  33. radial_hole_punch(fit_l/2,4,4.01,fit_out_d);
  34. radial_hole_punch(fit_l-fit_th*2,4,4.01,fit_out_d);
  35. radial_hole_punch(fit_l/2,4,8,fit_th/2);
  36. radial_hole_punch(fit_l-fit_th*2,4,8,fit_th/2);
  37. }
  38. translate([0,0,-fit_out_r])
  39. union(){
  40. rotate([0,180,0])
  41. radial_hole_punch(fit_l/2,4,8,fit_th/2);
  42. rotate([0,180,0])
  43. radial_hole_punch(fit_l-fit_th*2,4,8,fit_th/2);
  44. }
  45. translate([0,0,fit_out_r])
  46. rotate(45)
  47. radial_hole_punch(fit_l/2,4,4,fit_th);
  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. }
  69. module radial_hole_punch(r,holes,hole_d,depth){
  70. for(i=[0:holes-1]){
  71. rotate(360/holes*i)
  72. translate([r,0,0])
  73. mirror([0,0,1])
  74. cylinder(d=hole_d,h=depth);
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement