j0h

accel.scad

j0h
Oct 6th, 2026
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.71 KB | None | 0 0
  1. // ADXL357 evaluation-board mount. All dimensions in mm.
  2. // Pattern source: ADI EngineerZone EVAL-ADXL357Z hole-size answer.
  3. // Confirm the 15 mm square pattern on your board before printing.
  4.  
  5. base_size = 21;
  6. base_thickness = 3;
  7. hole_spacing = 15;       // Screw centers, X and Y
  8. hole_diameter = 3.2;     // Clearance hole; change for your screws
  9. boss_diameter = 6;       // Reinforcement around each screw
  10. boss_height = 3;         // Board clearance above the base
  11.  
  12. $fn = 64;
  13. eps = 0.02;
  14.  
  15. module screw_boss() {
  16.     // Hollow cylinder, extending into the base for a solid union.
  17.     difference() {
  18.         cylinder(d = boss_diameter, h = base_thickness );
  19.         translate([0, 0, -eps])
  20.             cylinder(d = hole_diameter,
  21.                      h = base_thickness + boss_height + 2*eps);
  22.     }
  23. }
  24.  
  25. module mount() {
  26.     union() {
  27.         difference() {
  28.             translate([-base_size/2, -base_size/2, 0])
  29.                 cube([base_size, base_size, base_thickness]);
  30.             for (x = [-hole_spacing/2, hole_spacing/2])
  31.                 for (y = [-hole_spacing/2, hole_spacing/2])
  32.                     translate([x, y, -eps])
  33.                         cylinder(d = hole_diameter, h = base_thickness + 2*eps);
  34.         }
  35.         for (x = [-hole_spacing/2, hole_spacing/2])
  36.             for (y = [-hole_spacing/2, hole_spacing/2])
  37.                 translate([x, y, 0]) screw_boss();
  38.     }
  39. }
  40.  
  41. module mag(){
  42. difference(){
  43. mount();
  44. cylinder(2,2.5,2.5,true);
  45. }}
  46.  
  47.  
  48. module holder(){
  49. difference(){
  50. difference(){
  51. cube([25,25,3], true);
  52. translate([-10.505,-10.505,0]) cube([21.05,21.05,2]);
  53. }
  54. translate([0,0,-2])
  55. cylinder(1,5,5);
  56. }
  57. }
  58. translate([0,0,1.5])holder();
  59.  
  60. translate([25,0,0]) mag();
  61.  
  62.  
  63.  
  64.  
  65.  
Tags: OpenSCAD
Advertisement
Add Comment
Please, Sign In to add comment