material_holder.scad 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. include <../config/material_holder.scad>
  2. module material_holder_object() {
  3. diameter = material_holder_diameter;
  4. screw_diameter = material_holder_screw_diameter;
  5. screw_cutoff_diameter = material_holder_screw_cutoff_diameter;
  6. thickness = material_holder_thickness;
  7. top_thickness = thickness / 2;
  8. cog_thickness = thickness - top_thickness;
  9. cog_diameter = material_holder_cog_diameter;
  10. cog_count = material_holder_cog_count;
  11. module top_object() {
  12. difference() {
  13. cylinder(
  14. d = diameter,
  15. h = top_thickness,
  16. center = true
  17. );
  18. cylinder(
  19. d1 = screw_diameter,
  20. d2 = screw_cutoff_diameter,
  21. h = top_thickness,
  22. center = true
  23. );
  24. }
  25. }
  26. module cogs_object() {
  27. module cog() {
  28. move_y
  29. = diameter / 3
  30. + screw_diameter / 4;
  31. translate([0, move_y]) {
  32. cylinder(
  33. d2 = cog_diameter,
  34. d1 = 0,
  35. h = cog_thickness,
  36. center = true
  37. );
  38. }
  39. }
  40. for (count = [0 : (360 / cog_count) : 360]) {
  41. rotate(count) {
  42. cog();
  43. }
  44. }
  45. }
  46. module final_object() {
  47. translate([0, 0, top_thickness / 2]) {
  48. top_object();
  49. }
  50. translate([0, 0, -cog_thickness / 2]) {
  51. cogs_object();
  52. }
  53. }
  54. color("#607080") {
  55. render() {
  56. final_object();
  57. }
  58. }
  59. }