My self-made 3D-printable designs, mainly in OpenSCAD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HoseAdapter.scad 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // preview[view:north east, tilt:top diagonal]
  2. // Top cone base diameter. Usually equal or slightly bigger than the top diameter.
  3. cone2_max=12.0;
  4. // Top cone top diameter. Usually equal or slightly smaller than the base radius
  5. cone2_min=12.0;
  6. // Height of the top cone
  7. cone2_height=2;
  8. // Wall thickness of the top cone
  9. cone2_wall=4.0;
  10. // Top cone protuding width of barb-like outer rings to prevent the hose from slipping (zero to disable)
  11. cone2_barb_width=0;
  12. // Bottom cone base diameter (the outside of the lower cone. Usually equal or slightly smaller than the top, unless you want to make a funnel)
  13. cone1_min=6.8;
  14. // Bottom top diameter (usually equal or slightly bigger than the base radius, unless you want to make a funnel)
  15. cone1_max=8.6;
  16. // Height of the bottom cone
  17. cone1_height=18;
  18. // Wall thickness of the bottom cone
  19. cone1_wall=1.5;
  20. // Bottom cone protuding width of barb-like outer rings to prevent the hose from slipping (zero to disable)
  21. cone1_barb_width=0.8;
  22. // Junction height: how tall is the connection between the two cones. Make sure it is thick enough so as to avoid excessively thin walls and/or steep inner overhang. Twice the wall thickness is a good starting value.
  23. join_height=3;
  24. // Barb flatness ratio (advanced). Sets barb height as a factor of barb size. Eg. 1.0 means a 1:1 x/y aspect ratio (aka 45°), and 2.0 makes a flatter barb.
  25. barb_flatness_ratio=2;
  26. // Barb spacing ratio (advanced). Sets barb spacing as a factor of barb height. So 0 means adjacent barbs, and 1 give an identical flat space as the barbs themselves.
  27. barb_spacing_ratio=2;
  28. // Barb symetry ratio (advanced). Avoid overhang by using a strictly positive value (easier print). Symetrical barbs correspond to 0.5. Negative values give concave barbs, and makes sense only for the lower cone. Values higher than 0.5 lead to reversed barbing (probably useless). -0.2 to 1.2 are good values
  29. barb_skew_ratio=0.15;
  30. // This is only useful to double-check the objet shape and walls before printing
  31. check_guts=0; // [0:no,1:yes]
  32. //
  33. // universal_hose_adapter.scad
  34. //
  35. // By Jérémie FRANCOIS / MoonCactus / contact@tecrd.com
  36. //
  37. // Check the webservice on http://www.tecrd.com/page/liens/universal_hose_adapter (temporary URL)
  38. // Remixed for the Thingiverse customizer (less usable imo for now...)
  39. //
  40. // $fa=10; // how fine the curved objets are (max angle between broken parts)
  41. tol=1*0.05; // tolerance (mostly useful for openscad preview)
  42. function xpos(dmin, dmax, height, hpos) = ( dmin+(dmax-dmin)*hpos/height )/2;
  43. module hollow_cone(dmin, dmax, height, wall, barb_width) // TODO: spokes
  44. {
  45. if(dmin>0 && dmax>0 && height>0)
  46. {
  47. // Hollow cone body
  48. difference()
  49. {
  50. cylinder(r1=dmin/2, r2=dmax/2, h=height);
  51. if(wall>0)
  52. translate([0,0,-tol])
  53. cylinder(r1= dmin/2-wall, r2= dmax/2-wall, h=height+2*tol);
  54. }
  55. // Babed-like rings
  56. if(barb_width>0 && barb_flatness_ratio!=0)
  57. {
  58. for(bs=[barb_width*barb_flatness_ratio : 1 : barb_width*barb_flatness_ratio]) // this is just to simulate a "local" variable... :(
  59. {
  60. for(hpos=[
  61. bs/2
  62. : barb_width * barb_flatness_ratio * (1 + barb_spacing_ratio)
  63. : height - bs/2]
  64. )
  65. {
  66. translate([0,0,hpos])
  67. rotate_extrude()
  68. polygon( points=[
  69. [xpos(dmin,dmax,height,hpos)-tol, 0],
  70. [xpos(dmin,dmax,height,hpos + bs*(1-barb_skew_ratio)) + barb_width, bs * (1-barb_skew_ratio)],
  71. [xpos(dmin,dmax,height,hpos + bs)-tol, bs],
  72. ] );
  73. }
  74. }
  75. }
  76. }
  77. }
  78. module tube_adapter() {
  79. difference()
  80. {
  81. union()
  82. {
  83. //color([1,0,0])
  84. hollow_cone(cone1_min, cone1_max, cone1_height, cone1_wall, cone1_barb_width);
  85. //color([0,0,1])
  86. translate([0,0,cone1_height+join_height+cone2_height])
  87. rotate([180,0,0])
  88. hollow_cone(cone2_min, cone2_max, cone2_height, cone2_wall, cone2_barb_width);
  89. // intermediate section
  90. if(join_height>0)
  91. {
  92. //color([0,1,0])
  93. translate([0,0,cone1_height])
  94. rotate_extrude()
  95. polygon( points=[
  96. [ cone1_max/2-cone1_wall, 0],
  97. [ cone1_max/2, 0],
  98. [ max(cone1_max,cone2_max)/2, join_height/2],
  99. [ cone2_max/2, join_height],
  100. [ cone2_max/2-cone2_wall, join_height],
  101. [ min(cone1_max/2-cone1_wall,cone2_max/2-cone2_wall), join_height/2],
  102. ] );
  103. }
  104. }
  105. if(check_guts!=0)
  106. {
  107. // I failed to understand how/if the customizer default view worked, so I split the part twice at opposite places... :p
  108. scale([0.5,1,1]) rotate([0,0,45]) translate([0,0,-tol]) cube([100,100,100]);
  109. //scale([0.5,1,1]) rotate([0,0,180+45]) translate([0,0,-tol]) cube([100,100,100]);
  110. }
  111. }
  112. }