BuckBoost-XYS3580_Case.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. import openscad as o
  2. o.fragments=150
  3. ###################################################################################################
  4. # original housing
  5. origWall = 1
  6. origDepth = 23
  7. # housing inner dimensions
  8. Height = 39.6
  9. Length = 71.9
  10. Depth = 42
  11. Wall = 2
  12. # opening for fan
  13. fanDia = 30
  14. # opening for connections
  15. conLength = 20
  16. conDepth = 5
  17. conHeigth = conLength
  18. # diameter of screw for connections
  19. conScrewDia = 4
  20. conScrewGap = 1.5 # gap between screws
  21. ###################################################################################################
  22. # outer shell
  23. o.box( Length+2*Wall, Depth+2*Wall, Height+2*Wall )
  24. o.color("green", 0.1)
  25. outerShell = o.result()
  26. # inner shell
  27. o.box( Length, Depth+2*Wall, Height )
  28. o.color("red", 1)
  29. o.translate( Wall, -Wall, Wall )
  30. innerShell = o.result()
  31. # hollow out outer shell
  32. o.difference([outerShell, innerShell])
  33. Shell=o.result()
  34. # cylinder for cutting out fan opening
  35. o.cylinder(fanDia, fanDia);
  36. fanOpening = o.result()
  37. # cut out cross from cylinder
  38. o.box(fanDia+2*Wall, Wall, fanDia+2*Wall)
  39. o.translate(-(fanDia+2*Wall)/2, -0.5*Wall, -Wall)
  40. Cross01=o.result()
  41. #
  42. o.box(Wall, fanDia+2*Wall, fanDia+2*Wall)
  43. o.translate(-0.5*Wall, -(fanDia+2*Wall)/2, -Wall)
  44. Cross02=o.result()
  45. #
  46. o.union([Cross01, Cross02])
  47. Cross = o.result()
  48. # cut out fanopening from shell
  49. o.difference([fanOpening, Cross])
  50. o.rotate(90,45,0)
  51. o.translate((Length+2*Wall)/2, Depth+fanDia/2, Height-fanDia/2+Wall-origWall)
  52. o.difference([Shell, o.result()])
  53. Shell=o.result()
  54. # cut out opening for connection ports
  55. o.box(conLength, conDepth, conHeigth)
  56. o.translate((Length+2*Wall)/2-conLength/2, origDepth-conDepth, -conHeigth/2)
  57. o.difference([Shell, o.result()])
  58. Shell=o.result()
  59. # cut out holes for 4 connection screws on backside
  60. for i in range (4):
  61. o.cylinder(conScrewDia, 4*Wall)
  62. o.rotate(90,0,0)
  63. o.translate( (Length+2*Wall)/2-1.5*conScrewGap-1.5*conScrewDia + i*(conScrewGap+conScrewDia), Depth+4*Wall, conScrewDia/2+Wall+origWall)
  64. o.difference([Shell, o.result()])
  65. Shell=o.result()
  66. # create horizontal air venting slits
  67. for i in range (5):
  68. o.box(Length+4*Wall, Wall, Height-0.5*Wall)
  69. o.translate(-Wall, origDepth + i*(2*Wall), (Height+2*Wall)/2-(Height-0.5*Wall)/2 )
  70. o.difference([Shell, o.result()])
  71. Shell=o.result()
  72. # create labels
  73. labels=["Vout+","Vout-","Vin-","Vin+"]
  74. index=0
  75. for label in labels:
  76. o.text(label, size=2, height=2, valign="center")
  77. o.color("red",1)
  78. o.rotate(0,180,90)
  79. o.translate((Length+2*Wall)/2+conLength/2-conScrewGap-index*(conScrewGap+conScrewDia), origDepth-conDepth-origWall, 1)
  80. o.difference([Shell, o.result()])
  81. Shell=o.result()
  82. index=index+1
  83. # ~ o.rotate(0,180,90)
  84. # ~ o.translate((Length+2*Wall)/2+conLength/2-conScrewGap, origDepth-conDepth-origWall, 1)
  85. # ~ o.union([Shell, o.result()])
  86. # ~ Shell=o.result()
  87. # ~ o.text("OUT-", size=2, height=2)
  88. # ~ o.rotate(0,180,90)
  89. # ~ o.translate((Length+2*Wall)/2+conLength/2-conScrewGap-, origDepth-conDepth-origWall, 1)
  90. # ~ o.union([Shell, o.result()])
  91. # ~ Shell=o.result()
  92. # ~ o.output([o.result(), Shell])
  93. # ~ o.output(o.result())
  94. o.output(Shell)