FirehoseAdapter.scad 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. use <threads.scad>
  2. // Resolution of 3D model
  3. $fn=90;
  4. // Thickness of the walls [mm]
  5. wall=10;
  6. /*[ Internal threaded section ]*/
  7. // Length of the G 1-1/2" threaded part [mm]
  8. threadLen=50;
  9. // Outer diameter of the thread [mm]
  10. threadDia=47.803;
  11. // Pitch of the thread (=turns/mm)
  12. threadPitch=2.309;
  13. /*[ Hose connector section ]*/
  14. // Hose connector length
  15. hoseCnLen=70;
  16. // Outer diameter of hose connector [mm]
  17. hoseCnOuterDia=75;
  18. // Inner diameter of hose connector [mm]
  19. hoseCnInnerDia=67;
  20. // Size of the lands on hose connector [mm]
  21. hoseCnLandSize=7;
  22. /*[ Hidden ]*/
  23. grooveLen=(hoseCnLen-3*hoseCnLandSize)/2;
  24. // Distance between threaded part and hose connector part
  25. //a^2 + b^2 = c^2
  26. //c=r=hoseCnOuterDia/2
  27. //a=(threadDia+2*wall)/2
  28. //b=?
  29. //b^2 = c^2 - a^2
  30. // _____________________________________________
  31. //b= V ((hoseCnOuterDia/2)^2-((threadDia+2*wall)/2)^2)
  32. b = sqrt((hoseCnOuterDia/2)^2-(threadDia/2+wall)^2);
  33. transitionDistance= b+threadLen;
  34. echo("DIST = ", b);
  35. echo("transitionDistance = ", transitionDistance);
  36. ///////////////////////////////////////////////////////////////////////////////////
  37. // main
  38. ///////////////////////////////////////////////////////////////////////////////////
  39. difference()
  40. {
  41. makeOuterForm();
  42. !makeInnerForm();
  43. }
  44. ///////////////////////////////////////////////////////////////////////////////////
  45. // make the outer hull of the hose adapter
  46. ///////////////////////////////////////////////////////////////////////////////////
  47. module makeOuterForm()
  48. {
  49. makeLands()
  50. {
  51. union()
  52. {
  53. // make threaded section
  54. cylinder(h=threadLen, d=threadDia+2*wall);
  55. // make transition between threaded section and hose connector
  56. translate([0, 0, transitionDistance]) sphere(d=hoseCnOuterDia);
  57. // make hose connector part
  58. translate([0, 0, transitionDistance]) cylinder(h=hoseCnLen, d=hoseCnOuterDia);
  59. }
  60. }
  61. }
  62. ///////////////////////////////////////////////////////////////////////////////////
  63. // make the inner form that is going to be cut out of the outer form
  64. ///////////////////////////////////////////////////////////////////////////////////
  65. module makeInnerForm()
  66. {
  67. union()
  68. {
  69. // make threaded section
  70. translate([0, 0, -0.1])
  71. metric_thread (diameter=threadDia, pitch=threadPitch, length=threadLen+0.2,
  72. internal=true, n_starts=1, thread_size=-1, groove=false, square=false,
  73. rectangle=0, angle=27.5, taper=0, leadin=0, leadfac=1.0, test=false);
  74. // make transition between threaded section and hose connector
  75. translate([0, 0, transitionDistance-2]) sphere(d=hoseCnOuterDia-2*wall);
  76. // make hose connector part
  77. translate([0, 0, transitionDistance-2]) cylinder(h=hoseCnLen+3, d=hoseCnOuterDia-2*wall);
  78. }
  79. }
  80. ///////////////////////////////////////////////////////////////////////////////////
  81. // make the lands on the outer hull of the hose adapter
  82. ///////////////////////////////////////////////////////////////////////////////////
  83. module makeLands()
  84. {
  85. difference()
  86. {
  87. children(0);
  88. translate([0, 0, transitionDistance+hoseCnLandSize]) makeLandRing();
  89. translate([0, 0, transitionDistance+grooveLen+hoseCnLandSize*2]) makeLandRing();
  90. }
  91. }
  92. ///////////////////////////////////////////////////////////////////////////////////
  93. // make a ring that is substracted from the hose connector forming a "land"
  94. ///////////////////////////////////////////////////////////////////////////////////
  95. module makeLandRing()
  96. {
  97. difference()
  98. {
  99. cylinder(h=grooveLen, d=hoseCnOuterDia+0.1);
  100. cylinder(h=grooveLen, d=hoseCnInnerDia);
  101. }
  102. }