Holodisk model from the Fallout and Fallout 2 games.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

98 lines
2.6 KiB

  1. // dependency: https://github.com/revarbat/BOSL
  2. use <BOSL/transforms.scad>
  3. use <holodisk_spec.scad>
  4. include <anim.scad>
  5. // outside config
  6. tape_height=5;
  7. tape_z=4;
  8. module reader(disk_size) {
  9. width=disk_size.x;
  10. depth=disk_size.y;
  11. height=disk_size.z;
  12. laser_cutout_size = get_holodisk_laser_cutout_size();
  13. laser_cutout_pos = get_holodisk_laser_cutout_pos_center();
  14. frame=5;
  15. head_frame=2;
  16. head_size=[14, 10, tape_height+head_frame*2];
  17. head_pos=[laser_cutout_pos.x, -frame+2, tape_z-head_frame];
  18. laser_size=[10, 2, tape_height];
  19. laser_offset=3;
  20. laser_pos=[laser_cutout_pos.x, laser_cutout_pos.y + laser_offset, tape_z];
  21. laser_tower_size=[laser_cutout_size.x - 1, laser_cutout_size.y - 1 - laser_offset, 15];
  22. module laser(corner=0.1) {
  23. up(laser_size.z/2)
  24. up(corner)
  25. color("Red")
  26. fwd(laser_cutout_size.y/3) cube(laser_size, center=true);
  27. }
  28. module laser_tower(corner=1) {
  29. color("DarkSlateBlue")
  30. difference() {
  31. up(laser_size.z/2)
  32. fwd(laser_offset/2) scale(0.99) cube(laser_tower_size, center=true);
  33. fwd(laser_size.y/3) scale(1.1) laser();
  34. }
  35. }
  36. module laser_space() {
  37. translate(get_holodisk_laser_cutout_pos_center()) cube(get_holodisk_laser_cutout_size(), center=true);
  38. }
  39. module head_space() {
  40. /*stube=[head_size.x-head_frame*2, head_size.y+head_frame*3, head_size.z-head_frame*2];
  41. up(head_size.z/4 + head_frame)
  42. cube(stube, center=true);*/
  43. translate(get_holodisk_laserwindow_pos_center()) cube(get_holodisk_laserwindow_size(), center=true);
  44. }
  45. module head(corner=0.5) {
  46. up(corner)
  47. back(head_size.y/2)
  48. color("DarkSlateBlue")
  49. minkowski() {
  50. s=[head_size[0], head_size[1] + frame, head_size[2]-corner*2];
  51. difference() {
  52. translate(head_pos) up(head_size.z/2) cube(s, center=true);
  53. head_space();
  54. }
  55. sphere(corner);
  56. }
  57. }
  58. //head();
  59. retraction=laser_tower_size.z;
  60. down(retraction)
  61. up(anim(2, 3)*retraction)
  62. down(anim(5, 6)*retraction)
  63. translate(laser_pos) {
  64. laser();
  65. laser_tower();
  66. }
  67. color("DarkSlateBlue") {
  68. difference() {
  69. fwd(frame) cube([width, frame, height]);
  70. head_space();
  71. }
  72. down(frame) difference() {
  73. fwd(frame) cube([width, depth + frame, frame]);
  74. scale(1.01) down(0.01) laser_space();
  75. }
  76. }
  77. }
  78. holodisk_size = is_undef(disk_size) ? [50, 100, 20] : disk_size;
  79. reader(holodisk_size);