Holodisk model from the Fallout and Fallout 2 games.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

77 lines
2.4 KiB

  1. spool_tape_tolerance=1;
  2. spool_inner_radius=4;
  3. spool_outer_radius=18;
  4. spool_plate_height=2;
  5. spool_plate_holes=3;
  6. spool_plate_hole_angle=360/spool_plate_holes * 0.5;
  7. spool_plate_hole_inner_rim=1;
  8. spool_plate_hole_outer_rim=4;
  9. spindle_diam_tolerance=0.2;
  10. // dependency: https://github.com/revarbat/BOSL
  11. use <BOSL/transforms.scad>
  12. module spindle(d, h, traction=false) {
  13. color("Sienna") cylinder(h=h, d=d, $fn=(traction ? 6 : 20));
  14. }
  15. module spool(
  16. r_in, r_out,
  17. in_rim=1, out_rim=4,
  18. in_height=5, plate_height=1,
  19. center=false, slit_depth=0.5,
  20. spindle_diam=3, spindle_diam_tolerance=0.1, spindle_traction=false,
  21. spokes=3
  22. ) {
  23. height = plate_height*2 + in_height;
  24. tape_height=in_height;
  25. module spool_plate() {
  26. $fn = ($preview ? 18 : 100);
  27. if (spokes > 0 && r_out - r_in > out_rim) {
  28. union() {
  29. cylinder(h=plate_height, r=r_in + in_rim);
  30. intersection() {
  31. cylinder(h=plate_height, r=r_out - out_rim);
  32. for (i = [1:spokes]) {
  33. zrot(360/spokes * i) {
  34. right(r_out/2) up(plate_height/2)
  35. cube([r_out, r_in, plate_height], center=true);
  36. }
  37. }
  38. }
  39. difference() {
  40. cylinder(h=plate_height, r=r_out);
  41. scale(1.01) cylinder(h=plate_height, r=r_out - out_rim);
  42. }
  43. }
  44. } else {
  45. cylinder(h=plate_height, r=r_out);
  46. }
  47. }
  48. module spool_inner() {
  49. $fn = ($preview ? 10 : 60);
  50. cylinder(h=in_height, r=r_in);
  51. }
  52. down(center ? height/2 : 0)
  53. difference() {
  54. color("Azure") {
  55. spool_plate();
  56. up(plate_height) spool_inner();
  57. up(plate_height + in_height) spool_plate();
  58. }
  59. if (slit_depth > 0) {
  60. up(plate_height + in_height/2) cube([r_in*2, slit_depth, in_height], center=true);
  61. }
  62. down(height) scale(1 + spindle_diam_tolerance/spindle_diam) spindle(d=spindle_diam+spindle_diam_tolerance, h=height*3, traction=spindle_traction);
  63. }
  64. }
  65. // test
  66. spindle_diam=2;
  67. tape_height=5;
  68. traction=true;
  69. spool(r_in=4, r_out=20, in_height=tape_height, spindle_diam=spindle_diam, spindle_traction=traction);
  70. down(3) spindle(d=spindle_diam, h=tape_height + 8, traction=traction);