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.

71 lines
1.6 KiB

  1. include <export.scad>
  2. // dependency: https://github.com/revarbat/BOSL
  3. include <BOSL/constants.scad>
  4. use <BOSL/transforms.scad>
  5. use <BOSL/shapes.scad>
  6. use <BOSL/masks.scad>
  7. use <BOSL/sliders.scad>
  8. use <specs_platform.scad>
  9. use <specs_strap.scad>
  10. use <strap_common.scad>
  11. // DEBUG:
  12. //validation = 1;
  13. //xray = 1;
  14. // PROP >>
  15. module prop_arm() {
  16. $fn=$preview ? 10 : 30;
  17. arm_size=[200, 55, 40];
  18. color("gray")
  19. down(arm_size.z/2) {
  20. cuboid(arm_size, fillet=16, edges=EDGES_X_ALL);
  21. 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);
  22. }
  23. }
  24. module model_prop_arm() {
  25. if (is_not_export()) down(3) prop_arm();
  26. }
  27. // <<<
  28. // Blocks:
  29. module platform(base) {
  30. size=get_platform_size();
  31. top=!base;
  32. up(top?size.z:0)
  33. color(top?"Olive":"YellowGreen")
  34. cube(size, center=true);
  35. module strap_connectors() {
  36. down(size.z/2) {
  37. for (i=[0:3]) {
  38. left((i%2*(-2)+1) * (size.x/2 - get_link_segment_size().y/2))
  39. fwd((round(i/2)%2*(-2)+1) * size.y/2)
  40. down(get_link_segment_size().z/2)
  41. zrot(90 + (round(i/2)%2*180)) link_connector_pin();
  42. }
  43. }
  44. }
  45. if (base) {
  46. strap_connectors();
  47. }
  48. }
  49. // Models:
  50. module model_platform_harness() {
  51. platform(base=false);
  52. }
  53. module model_platform_strap() {
  54. platform(base=true);
  55. }
  56. // Export:
  57. if (is_model(MODEL_PLATFORM_HARNESS)) model_platform_harness();
  58. if (is_model(MODEL_PLATFORM_STRAP)) model_platform_strap();
  59. if (is_model(MODEL_DEMO)) model_prop_arm();