Holodisk model from the Fallout and Fallout 2 games.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

189 行
5.7 KiB

  1. // dependency: https://github.com/revarbat/BOSL
  2. use <BOSL/transforms.scad>
  3. use <BOSL/metric_screws.scad>
  4. use <BOSL/masks.scad>
  5. include <tape.scad>
  6. module frame() {
  7. tr=top_rim;
  8. tc=tr*1.5;
  9. fbd=front_body_depth;
  10. bbr=back_bumpers_radius;
  11. module back_bumpers() {
  12. module bumper() { back_half() circle(r=bbr); }
  13. back(depth) {
  14. right(bbr) bumper();
  15. right(width-bbr) bumper();
  16. }
  17. }
  18. module bolt() { metric_bolt(size=back_bumpers_bolt_size, headtype=bolt_headtype, l=height, pitch=0); }
  19. module nut() { metric_nut(size=back_bumpers_bolt_size, pitch=0); }
  20. module back_bolts() {
  21. back(depth) {
  22. right(bbr) {
  23. up(height) bolt();
  24. nut();
  25. }
  26. right(width-bbr) {
  27. up(height) bolt();
  28. nut();
  29. }
  30. }
  31. }
  32. module front_bolts() {
  33. bolt_offset=front_body_bolt_offset;
  34. back(front_body_depth/2) {
  35. right(bolt_offset) {
  36. up(height) bolt();
  37. nut();
  38. }
  39. right(width-bolt_offset) {
  40. up(height) bolt();
  41. nut();
  42. }
  43. }
  44. }
  45. module top_cover() {
  46. up(height-plate) linear_extrude(height=plate) {
  47. back_bumpers();
  48. polygon(points=[
  49. // frame
  50. [0, 0], [0, depth],
  51. [width, depth], [width, 0],
  52. // window
  53. [tr, tr+fbd], [tr, depth-tr-tc], [tr+tc, depth-tr],
  54. [width-tr-tc, depth-tr], [width-tr, depth-tr-tc], [width-tr, tr+fbd]
  55. ],
  56. paths=[
  57. [0,1,2,3], [4,5,6,7,8,9]
  58. ]);
  59. }
  60. }
  61. module walls() {
  62. walls_height=height-plate*2;
  63. up(plate) linear_extrude(height=walls_height) {
  64. //back_bumpers();
  65. shell2d(thickness=-wall) {
  66. square([width, depth]);
  67. }
  68. }
  69. }
  70. module bottom_cover() {
  71. linear_extrude(height=plate) {
  72. back_bumpers();
  73. square([width, depth]);
  74. }
  75. }
  76. color("SaddleBrown") top_cover();
  77. color("grey") walls();
  78. color("SaddleBrown") bottom_cover();
  79. color("silver") back_bolts();
  80. color("silver") front_bolts();
  81. }
  82. module mechanism() {
  83. module spool(r_in, r_out, in_rim, out_rim) {
  84. module spindle(d, h) {
  85. color("Sienna") cylinder(h=h, d=d);
  86. }
  87. module spool_plate() {
  88. difference() {
  89. cylinder(h=spool_plate_height, r=r_out);
  90. if (!$preview && r_out - r_in > out_rim) {
  91. angle=spool_plate_hole_angle;
  92. difference() {
  93. for (i = [1:spool_plate_holes]) {
  94. zrot(360/spool_plate_holes * i) {
  95. angle_pie_mask(r=r_out - out_rim, l=spool_plate_height, ang=angle, center=false);
  96. }
  97. }
  98. cylinder(h=spool_plate_height, r=r_in + in_rim);
  99. }
  100. }
  101. }
  102. }
  103. spindle_h=height-plate;
  104. difference() {
  105. color("Azure") {
  106. spool_plate();
  107. up(spool_plate_height) cylinder(h=spool_inner_height, r=r_in);
  108. up(spool_plate_height + spool_inner_height) spool_plate();
  109. }
  110. up(spool_plate_height + spool_inner_height/2) cube([r_in*2, spool_slit_depth, spool_inner_height], center=true);
  111. // TODO: spindle height
  112. spindle(d=spindle_diam+spindle_diam_tolerance, h=spindle_h);
  113. }
  114. spindle(d=spindle_diam, h=spindle_h);
  115. }
  116. module main_spool() {
  117. spool(r_in=spool_inner_radius,
  118. r_out=spool_outer_radius,
  119. in_rim=spool_plate_hole_inner_rim,
  120. out_rim=spool_plate_hole_outer_rim);
  121. }
  122. module aux_spool() {
  123. spool(r_in=middle_spool_in_r, r_out=middle_spool_out_r,
  124. in_rim=aux_spool_plate_hole_inner_rim,
  125. out_rim=aux_spool_plate_hole_outer_rim);
  126. }
  127. module spools() {
  128. up(plate) {
  129. right(main_spools_x) {
  130. back(spool1_depth) main_spool();
  131. back(spool2_depth) main_spool();
  132. }
  133. right(aux_spools_right_x) {
  134. back(spool3_depth) aux_spool();
  135. back(spool4_depth) aux_spool();
  136. }
  137. right(aux_spools_left_x) {
  138. back(spool4_depth) aux_spool();
  139. }
  140. }
  141. }
  142. module tapes() {
  143. spool1_tape_r = spool_outer_radius * 0.8;
  144. spool2_tape_r = spool_outer_radius * 0.5;
  145. up(plate + spool_plate_height) {
  146. // main spools
  147. right(main_spools_x) {
  148. back(spool1_depth) tape_spool(r_in=spool_inner_radius, r_out=spool1_tape_r);
  149. back(spool2_depth) tape_spool(r_in=spool_inner_radius, r_out=spool2_tape_r);
  150. }
  151. // TODO: convert to path
  152. // main 1 --> middle
  153. tape([main_spools_x + spool1_tape_r, spool1_depth, 0], [aux_spools_right_x + middle_spool_in_r, spool3_depth, 0]);
  154. // --> right corner
  155. right(aux_spools_right_x + middle_spool_in_r) tape([0, spool3_depth, 0], [0, spool4_depth, 0]);
  156. // --> left corner
  157. tape([aux_spools_left_x, spool4_depth - middle_spool_in_r, 0], [aux_spools_right_x, spool4_depth - middle_spool_in_r, 0]);
  158. // --> main 2
  159. tape([aux_spools_left_x - middle_spool_in_r, spool4_depth, 0], [main_spools_x - spool2_tape_r, spool2_depth, 0]);
  160. }
  161. }
  162. spools();
  163. tapes();
  164. }
  165. module holodisk() {
  166. #frame();
  167. mechanism();
  168. }
  169. holodisk();