Advertisement
j0h

jst BH04B-XASK (LF)(SN)

j0h
Jun 21st, 2025
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.58 KB | None | 0 0
  1. pin_count = 4;
  2. pin_length = 17;        
  3.  
  4.  
  5. module header(pin_count=4, pin_length=17) {
  6. body_width = 2.5;      
  7. pin_pitch = 2.54;      
  8. pin_diameter = 0.64;  
  9.  
  10.     for (i = [0 : pin_count - 1]) {
  11.         translate([body_width / 2, i * pin_pitch, 0])
  12. //        color("silver")
  13.         cylinder(h = pin_length, d = pin_diameter, $fn = 6);
  14.     }
  15. }
  16.  
  17. module con(){
  18. // conector interface
  19. difference(){
  20. // front face connector groove interior
  21. translate([17,0,0])
  22. cube([5.5,1.23,4.8]);
  23. // front face connector groove
  24. translate([17.1,0,0])
  25. cube([5.3,1.1,4.8]);
  26.  
  27. }
  28. }
  29. //con();
  30. color([0.96, 0.96, 0.86]);  // RGB values for beige
  31. width  = 12.5;
  32. depth  = 6.4;
  33. height = 17;
  34. module body(){
  35. difference(){
  36.  
  37. difference(){
  38.  
  39. difference(){
  40. difference(){
  41. difference(){
  42. difference(){
  43. difference(){
  44.  
  45. cube([width, depth, height]);
  46.  
  47. // front slice:
  48. cube([width,1,9]);
  49. }
  50. // inner front slice n rear slice
  51. translate([1.6,1,0])
  52. cube([9,1,9.75]);
  53. }
  54.  
  55. // rear slice
  56. translate([1.6,4.4,0])
  57. cube([9,2,9.75]);
  58. }
  59.  
  60. // hole1: connector cavity
  61. xc=10.75;
  62. yc=5.4;
  63. zc=7.2;
  64. elv=height-zc;
  65. translate([0.8,0.5,elv])
  66. cube([xc,yc,zc]);
  67. }
  68.  
  69. // hole 2  central cut
  70. translate([0,0,14.75])
  71. cube([width,3.1,2.25]);
  72. }
  73.  
  74. // rear grove
  75. xx=7.5;
  76. yy=1.0;
  77. zz=1.6;
  78. translate([2.57,5.5,15.5])
  79. cube([xx,yy,zz]);
  80.  
  81. }
  82.  
  83. // front face connector groove
  84. translate([3.53,0,10])
  85. cube([5.3,1.1,4.8]);
  86. }
  87. translate([-13.5,0,10])
  88.  
  89. con();
  90. }
  91. color([0.96, 0.96, 0.86]) // wont flippin render colors in modules
  92. body();
  93.  
  94. rotate([0,0,-90])
  95. translate([-4.5,2.4,-3.5])
  96. color("silver")
  97. header();
  98.  
  99.  
  100.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement