ViveControllerMount.scad 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Smooth curves
  2. $fs = 0.4;
  3. // Measurements relative to the bottom center of the handle
  4. bottom_width = 34;
  5. bottom_depth = 22;
  6. bottom_height = 16;
  7. top_width = 39;
  8. top_depth = 28;
  9. top_height = 55;
  10. // Calculated values based on those measurements
  11. handle_rise = top_height - bottom_height;
  12. handle_depth_slope = handle_rise / (top_depth - bottom_depth);
  13. handle_width_slope = handle_rise / (top_width - bottom_width);
  14. handle_depth_angle = atan(handle_depth_slope);
  15. handle_width_angle = atan(handle_width_slope);
  16. // Design parameters. These are mostly free.
  17. side_height = top_height - bottom_height;
  18. side_depth = bottom_depth;
  19. side_width = 5;
  20. front_height = side_height;
  21. front_depth = side_width;
  22. front_width = bottom_width;
  23. // Center
  24. //color([1,0,0]) { cube([10,10,10], center = true); }
  25. // Left & Right
  26. lr_x = (bottom_width / 2 ) + side_width;
  27. lr_y = side_depth / 2;
  28. translate([-lr_x, lr_y, 0]) {
  29. rotate([180, handle_width_angle - 180, 0]) {
  30. cube([side_height, side_depth, side_width]);
  31. }
  32. }
  33. translate([lr_x, -lr_y, 0]) {
  34. rotate([0, -handle_width_angle, 0]) {
  35. cube([side_height, side_depth, side_width]);
  36. }
  37. }
  38. // Front & Back
  39. fb_x = front_width / 2;
  40. fb_y = (bottom_depth / 2) + front_depth;
  41. translate([fb_x, -fb_y, 0]) {
  42. rotate([handle_depth_angle - 180, 180, 0]) {
  43. cube([front_width, front_height, front_depth]);
  44. }
  45. }
  46. translate([-fb_x, fb_y, 0]) {
  47. rotate([handle_depth_angle, 0, 0]) {
  48. cube([front_width, front_height, front_depth]);
  49. }
  50. }