Pip-Boy inspired phone holder built around the PINE64 PinePhone
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.

123 line
3.8 KiB

  1. // dependency: https://github.com/revarbat/BOSL
  2. include <BOSL/constants.scad>
  3. use <BOSL/transforms.scad>
  4. use <BOSL/shapes.scad>
  5. use <BOSL/masks.scad>
  6. use <BOSL/sliders.scad>
  7. // DEBUG:
  8. //validation = 1;
  9. //xray = 1;
  10. function get_phone_size() = [160, 76.7, 10];
  11. module arm() {
  12. $fn=$preview ? 10 : 30;
  13. arm_size=[200, 55, 40];
  14. color("gray")
  15. down(arm_size.z/2) {
  16. cuboid(arm_size, fillet=16, edges=EDGES_X_ALL);
  17. left(arm_size.x*0.6) scale([1, 1, 0.8]) yrot(90) cylinder(d1=arm_size.y*1.4, d2=arm_size.y*0.95, h=arm_size.x/2);
  18. }
  19. }
  20. module strap_platform() {
  21. base_size=[40, 70, 2];
  22. rib_thickness=5;
  23. rib_height=20;
  24. rib_pos=[base_size.x/2 - rib_thickness, 0, -1.3];
  25. brace_size=[base_size.x, 3.6, 4.8];
  26. brace_pos=[0, base_size.y/2 - 4, -1.3];
  27. module platform_base() {
  28. cutout_size=[(base_size.x-rib_thickness*2 - 2*(base_size.x/2-rib_pos.x)), (base_size.y - 5), 2*base_size.z];
  29. difference() {
  30. down(base_size.z/2) cuboid(base_size, fillet=2, edges=EDGES_Z_ALL);
  31. down(base_size.z/2) cuboid(cutout_size, fillet=2, edges=EDGES_Z_ALL);
  32. model_rib_left(socket=true);
  33. model_rib_right(socket=true);
  34. }
  35. }
  36. module platform_rib(socket=false) {
  37. rib_size=[rib_thickness, base_size.y - 2, rib_height];
  38. difference() {
  39. union() {
  40. difference() {
  41. down(rib_size.z/2) scale(socket ? 1.01 : 1) sparse_strut(h=rib_size.z, l=rib_size.y, thick=rib_size.x, strut=1.2, maxang=40, max_bridge=4);
  42. arm();
  43. }
  44. difference() {
  45. intersection() {
  46. down(rib_size.z/2) cube(rib_size, center=true);
  47. scale(1.07) arm();
  48. }
  49. down(2) scale(1.0) arm();
  50. }
  51. }
  52. fwd(brace_pos.y) platform_rib_brace(socket=true);
  53. back(brace_pos.y) platform_rib_brace(socket=true);
  54. }
  55. }
  56. module platform_rib_brace(socket=false) {
  57. down(rib_height - 1.2 - brace_size.z/2) scale(socket ? 1.02 : 1) cuboid(brace_size, fillet=1, edges=EDGES_X_ALL);
  58. }
  59. module model_rib_left(socket=false) {
  60. left(rib_pos.x) up(rib_pos.z) platform_rib(socket=socket);
  61. }
  62. module model_rib_right(socket=false) {
  63. right(rib_pos.x) up(rib_pos.z) platform_rib(socket=socket);
  64. }
  65. module model_brace_front() {
  66. fwd(brace_pos.y) up(brace_pos.z) platform_rib_brace();
  67. }
  68. module model_brace_back() {
  69. back(brace_pos.y) up(brace_pos.z) platform_rib_brace();
  70. }
  71. if (is_model(MODEL_STRAP_PLATFORM_BASE)) platform_base();
  72. if (is_model(MODEL_STRAP_PLATFORM_RIB)) model_rib_left();
  73. if (is_model(MODEL_STRAP_PLATFORM_RIB_BRACE)) model_brace_front();
  74. if (is_not_export()) {
  75. model_rib_right();
  76. model_brace_back();
  77. }
  78. }
  79. module strap_secondary() {
  80. size=[40, 15, 10];
  81. size_base=[size.x, size.y];
  82. size_top=[size.x * 0.9, size.y * 0.4];
  83. cutout_size=[size.x - 10, size.y*10, size.z - 4];
  84. module anchor() {
  85. difference() {
  86. xrot(180) rounded_prismoid(size1=size_base, size2=size_top, h=size.z, r=5);
  87. down(size.z/2) cube(cutout_size, center=true);
  88. }
  89. }
  90. anchor_pos=[60, 30, 0];
  91. module anchor_front() {
  92. left(anchor_pos.x) fwd(anchor_pos.y) anchor();
  93. }
  94. module anchor_back() {
  95. left(anchor_pos.x) back(anchor_pos.y) anchor();
  96. }
  97. if (is_model(MODEL_STRAP_SECONDARY)) anchor_front();
  98. if (is_not_export()) anchor_back();
  99. }
  100. module model_strap_platform() {
  101. strap_platform();
  102. }
  103. module model_strap_secondary() {
  104. strap_secondary();
  105. }
  106. module model_arm() {
  107. if (is_not_export()) down(3) arm();
  108. }
  109. model_strap_platform();
  110. model_strap_secondary();
  111. model_arm();