Advertisement
sarumeister

cherry-chair.scad

Aug 4th, 2024
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 5.11 KB | None | 0 0
  1. $fn=64;
  2.  
  3. _off = 0.05;
  4. cl = 0.1;
  5.  
  6. // Platform dimensions
  7. platform_width = 14.00;
  8. platform_height = 14.00;
  9. platform_thickness = 3.3;
  10.  
  11. // Hole positions and dimensions
  12. hole1_diameter = 4.0;
  13. hole1_position = [0, 0];
  14.  
  15. hole2_diameter = 1.7;
  16. hole2_position = [1.27*4, 0];
  17.  
  18. hole3_diameter = 1.7;
  19. hole3_position = [-1.27*4, 0];
  20.  
  21. hole4_diameter = 1.5;
  22. hole4_position = [1.27*3, -1.27*2];
  23.  
  24. hole5_diameter = 1.5;
  25. hole5_position = [-1.27*2, -1.27*4];
  26.  
  27. bearing_d = 8;
  28. bearing_h = 3;
  29.  
  30. thin_h = 5;
  31. thin_d = 4;
  32. groove_h = 1.5;
  33. platform_h = 18;
  34. piston_h = platform_h - platform_thickness;
  35. straight_h = piston_h - thin_h - groove_h;
  36. platform_y = platform_h + 1 - groove_h;
  37.  
  38.  
  39. // Translate positions relative to platform center
  40. module hole(position, diameter) {
  41.     translate(position)
  42.         cylinder(d = diameter, h = platform_thickness * 2 + _off, center = true);
  43. }
  44.  
  45. module platform() {
  46.     translate([0, 0, -bearing_h/2])
  47.         cylinder(d1 = hub_diameter, d2 = bearing_d, h = bearing_h, center = true);
  48.  
  49.     translate([0, 0, -straight_h/2 - bearing_h])
  50.         cylinder(h = straight_h, d = hub_diameter, center = true);
  51.  
  52.     difference() {
  53.         union() {
  54.             translate([0, 0, - bearing_h -straight_h - thin_h])
  55.                 for (i = [0:0.5: thin_h/2 - 0.5]) {
  56.                     translate([0, 0, i* 2 + 0.25])
  57.                         cylinder(h = 0.5, d2 = thin_d - _off, d1 = thin_d - _off - 0.5, center = true);
  58.                     translate([0, 0, i * 2 + 0.5  + 0.25])
  59.                         cylinder(h = 0.5, d1 = thin_d - _off, d2 = thin_d - _off - 0.5, center = true);
  60.                 }
  61.                            
  62.             translate([0, 0, - bearing_h -straight_h - thin_h - groove_h/2])
  63.                 cylinder(h = groove_h, d1 = thin_d - _off - 0.3, d2 = hub_diameter - _off -0.3, center = true);
  64.         }
  65.  
  66.         translate([0, 0, - bearing_h -straight_h - thin_h - groove_h/2])
  67.             cube([1, 10, 10], center = true);
  68.            
  69.         translate([0, thin_d/2 + 0.3, - bearing_h -straight_h - thin_h - groove_h/2])
  70.             rotate([0, 0, 90])
  71.                 cube([1, 10, 10], center = true);
  72.         translate([0, -thin_d/2 - 0.3, - bearing_h -straight_h - thin_h - groove_h/2])
  73.             rotate([0, 0, 90])
  74.                 cube([1, 10, 10], center = true);
  75.     }
  76.  
  77.  
  78.     difference() {
  79.         // Platform
  80.         translate([-platform_width/2, -platform_height/2, 0])
  81.             cube([platform_width, platform_height, platform_thickness]);
  82.  
  83.         // Holes
  84.         hole(hole1_position, hole1_diameter);
  85.         hole(hole2_position, hole2_diameter);
  86.         hole(hole3_position, hole3_diameter);
  87.         hole(hole4_position, hole4_diameter);
  88.         hole(hole5_position, hole5_diameter);
  89.     }
  90. }
  91.  
  92.  
  93. // Parameters for the base
  94. radius = 20;
  95. arm_length = radius; // Length of each arm, adjusted for the central hub
  96. arm_thickness = 2.5;
  97. arm_height = 5;
  98. hub_diameter = 5;
  99. hub_inner = 4;
  100. hub_height = 15;
  101. wheel_d = 4;
  102. wheel_thickness = 3;
  103.  
  104. cover_d = 5;
  105. cover_height = arm_thickness;
  106.  
  107. module arm()
  108. {
  109.     difference() {
  110.         rotate([0, -80, 0]) {
  111.             translate([arm_height/2, 0, -arm_length/2]) {
  112.                 translate([arm_height/2, 0, ])
  113.                     cylinder(d = arm_thickness, h = arm_length, center = true);
  114.                 cube([arm_height, arm_thickness, arm_length], center = true);
  115.             }
  116.         }
  117.     }
  118. }
  119.  
  120.  
  121. // Function to create a wheel
  122. module wheel(i) {
  123.     translate([radius, 0, - cover_d / 3])
  124.         rotate([90, 0, i])
  125.             cylinder(d = wheel_d, h = wheel_thickness, center = true);
  126.  
  127.     translate([radius, 0, -cover_d/3])
  128.         rotate([90, 0, i])
  129.             cylinder(d = cover_d, h = cover_height, center = true);
  130. }
  131.  
  132. // Create the base
  133. module wheels() {
  134.     // Create and position the wheels
  135.     difference() {
  136.         for (i = [0:72:360])
  137.             rotate([0, 0, i])
  138.                 wheel(-i) // or wheel(-90)
  139.  
  140.         translate([0, 0, -wheel_radius/2])
  141.             cylinder(d = radius*3, h = wheel_radius, center = true);
  142.     }
  143. }
  144.  
  145. module base() {
  146.     difference() {
  147.         union () {            
  148.             // hub
  149.             translate([0, 0, 5.5])
  150.                 cylinder(d1 = bearing_d, d2 = hub_diameter, h = 2, center = true);
  151.             translate([0, 0, 3])
  152.                 cylinder(d = bearing_d, h = 3, center = true);
  153.  
  154.             // Create and position the arms
  155.             difference() {
  156.                 for (i = [0:72:360])
  157.                     rotate([0, 0, i])
  158.                         arm();
  159.             }
  160.  
  161.         }
  162.  
  163.         // central hole
  164.         translate([0, 0, 3])
  165.             cylinder(d = thin_d + cl, h = 10, center = true);
  166.  
  167.         // form the shape of the arms and hub
  168.         translate([0, 0, -5+2])
  169.             cylinder(d1 = 160, d2 = 0, h = 10, center = true);
  170.     }
  171. }
  172.  
  173.  
  174. // main render
  175. difference() {
  176.     union() {
  177.         translate([0, 0, platform_y + 0.3])
  178.             platform();
  179.  
  180.         base();
  181.         wheels();
  182.     }
  183.  
  184.     // section
  185.     // translate([0, 8, 0])
  186.     //    cube([100, 16, 100], center = true);
  187. }
  188.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement