BarbedHoseAdapter.scad 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /////////////////////////////////////////////////////////////////////////////////////
  2. // Parameters
  3. // Higher values = higher resolution
  4. $fn=60;
  5. /*[ Hose adapter part ]*/
  6. // Maximum exterior diameter of barbed hose adapter [millimeters]. This is the max. diameter the hose is supposed to fit over
  7. hoseAdExtDia = 10;
  8. // Length of the barbed hose adapter [millimeters]
  9. hoseAdLen = 20;
  10. // Wall thickness of the barbed hose adapter [millimeters]
  11. hoseAdWall = 2;
  12. // Number of barbs
  13. barbeCount = 4;
  14. // Diameter decrease of barbes [millimeters]
  15. barbeDiaDecr = 1;
  16. /*[ Pipe adapter part ]*/
  17. // Diameter of the pipe the adapter should fit over [millimeters]
  18. pipeDia = 18;
  19. // Length of adapter part that goes over the pipe [millimeters]
  20. pipeAdLen=20;
  21. // Wall thickness of the pipe adapter part [millimeters]
  22. pipeAdWall = 4;
  23. /*[ Transition between pipe and hose adapter parts ]*/
  24. // Length of the transition part [millimeters]
  25. transitionLen=15;
  26. /////////////////////////////////////////////////////////////////////////////////////
  27. // Main
  28. color("cyan")
  29. union()
  30. {
  31. translate([0,0,transitionLen+pipeAdLen])
  32. makeHoseAdapter();
  33. translate([0,0,pipeAdLen])
  34. makeTransition();
  35. makePipeAdapter();
  36. }
  37. printStats();
  38. /////////////////////////////////////////////////////////////////////////////////////
  39. //
  40. module makeTransition()
  41. {
  42. difference()
  43. {
  44. cylinder(d1=pipeDia+2*pipeAdWall, d2=hoseAdExtDia, h=transitionLen+0.01);
  45. translate([0,0,-0.01])
  46. cylinder(d1=pipeDia-1, d2=hoseAdExtDia-2*hoseAdWall, h=transitionLen+0.03);
  47. }
  48. }
  49. /////////////////////////////////////////////////////////////////////////////////////
  50. //
  51. module makePipeAdapter()
  52. {
  53. difference()
  54. {
  55. cylinder(d=pipeDia+2*pipeAdWall, h=pipeAdLen+0.01);
  56. translate([0,0,-0.01])
  57. cylinder(d1=pipeDia+1, d2=pipeDia-1, h=pipeAdLen+0.03);
  58. }
  59. }
  60. /////////////////////////////////////////////////////////////////////////////////////
  61. //
  62. module makeHoseAdapter()
  63. {
  64. stepZ = hoseAdLen/barbeCount;
  65. difference()
  66. {
  67. for (step = [0 : barbeCount-1])
  68. {
  69. translate([0, 0, step * stepZ])
  70. cylinder(d1=hoseAdExtDia, d2=hoseAdExtDia-barbeDiaDecr, h=stepZ);
  71. }
  72. translate([0, 0, -1])
  73. cylinder(d = hoseAdExtDia-2*hoseAdWall, h=hoseAdLen+2);
  74. }
  75. }
  76. //////////////////////////////////////////////////////////////////////
  77. //
  78. module printStats()
  79. {
  80. strStats=str("\n############################ STATISTICS ############################\n",
  81. "Measurements in millimeter [mm]\n\n",
  82. "\Barbed hose adapter:\n",
  83. "\t Max. outer diameter:\t", hoseAdExtDia, "\n",
  84. "\t Min. outer diameter:\t", hoseAdExtDia-barbeDiaDecr, "\n",
  85. "\t Inner diameter:\t", hoseAdExtDia-2*hoseAdWall, "\n",
  86. "\n############################ STATISTICS ############################\n"
  87. );
  88. echo(strStats );
  89. }