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

49 行
1.1KB

  1. $fn=64;
  2. baseplate_hole_distance = 56;
  3. battery_x = 105;
  4. battery_y = 35;
  5. battery_z = 25;
  6. frame_x = 10;
  7. frame_y = 62;
  8. frame_z = 3;
  9. bec_x = 35;
  10. bec_y = 40;
  11. bec_z = 4;
  12. cage_x = bec_x;
  13. cage_y = bec_y;
  14. cage_z = battery_z + bec_z + 3;
  15. module cube_centered(x,y,z) {
  16. translate([-x/2, -y/2, 0]) cube([x, y, z]);
  17. }
  18. module cube_round_corners(x,y,z) {
  19. hull() {
  20. translate([-x/2, -y/2, 0]) cylinder(d=3, h=z);
  21. translate([ x/2, -y/2, 0]) cylinder(d=3, h=z);
  22. translate([-x/2, y/2, 0]) cylinder(d=3, h=z);
  23. translate([ x/2, y/2, 0]) cylinder(d=3, h=z);
  24. }
  25. }
  26. difference() {
  27. union() {
  28. cube_round_corners(frame_x, frame_y, frame_z);
  29. cube_round_corners(cage_x, cage_y, cage_z);
  30. translate([0, 0, cage_z]) cube_round_corners(bec_x, bec_y, bec_z);
  31. }
  32. cube_centered(battery_x, battery_y, battery_z);
  33. translate([0, -baseplate_hole_distance/2, 0]) cylinder(d=3, h=3);
  34. translate([0, baseplate_hole_distance/2, 0]) cylinder(d=3, h=3);
  35. translate([0, 0, battery_z+3]) cube_centered(bec_x, bec_y, 100);
  36. translate([0, 0, battery_z]) cube_centered(bec_x-9, bec_y-12, 100);
  37. }