Advertisement
Guest User

https://www.reddit.com/r/3Drequests/comments/1ln1zeq/help/

a guest
Jun 28th, 2025
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | Source Code | 0 0
  1.  
  2. $fn = 100;
  3.  
  4. // width of top round part
  5. d1 = 12.5 * 25.4;
  6.  
  7. // radius of rounding of top round part
  8. r1 = 20;
  9.  
  10. // diameter of small ring below round top
  11. d2 = 12.0 * 25.4;
  12.  
  13. // diameter or larger wider straight part.
  14. d3 = 11.25 * 25.4;
  15.  
  16. // height of the larger wider straight part.
  17. h3 = 80;
  18.  
  19. // width of smaller round ring
  20. d4 = 11.5 * 25.4;
  21.  
  22. // radius of rounding of smaller ring
  23. r4 = 12;
  24.  
  25. // diameter of pillar
  26. d5 = 10 * 25.4;
  27.  
  28. // total height of the piller,
  29. // inlusive profile part.
  30. h5 = 1000;
  31.  
  32. // length of the indents around the pillar
  33. h6 = 800;
  34.  
  35. // radius of indents
  36. r6 = 16;
  37.  
  38. epsilon = 0.001;
  39.  
  40. difference()
  41. {
  42. rotate_extrude()
  43. PillerProfile2D();
  44.  
  45. for(a=[0:20:360-20])
  46. rotate(a)
  47. translate([d5/2,0,h5-h6])
  48. hull()
  49. for(z=[0,h6])
  50. translate([0,0,z])
  51. sphere(r=r6);
  52. }
  53.  
  54. module PillerProfile2D()
  55. {
  56. // The profile is only one half.
  57. // It is build upside down.
  58.  
  59. // The top round part
  60. x1 = d1/2 - r1;
  61. square([x1,2*r1]);
  62. translate([x1,r1])
  63. circle(r1);
  64.  
  65. // small ring below the top part
  66. y2 = 3;
  67. translate([0,r1])
  68. square([d2/2,r1+y2]);
  69.  
  70. // larger wider straight part
  71. y3 = r1+r1+y2-epsilon;
  72. translate([0,y3])
  73. square([d3/2,h3]);
  74.  
  75. // smaller round ring
  76. x4 = d4/2 - r4;
  77. y4 = y3 + h3 - r4;
  78. translate([0,y4])
  79. {
  80. square([x4,2*r4]);
  81. translate([x4,r4])
  82. circle(r4);
  83. }
  84.  
  85. // The piller is inside everything.
  86. // It can start at the bottom
  87. square([d5/2,h5]);
  88. }
Tags: OpenSCAD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement