LensCover.scad 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* [Parameters] */
  2. // Here comes the description
  3. // -> lens diameter = inner diameter of lens cover
  4. lensDia = 40.5;
  5. // -> the height of the part that is parallel to the tubus
  6. height = 10.0;
  7. // -> the height of doom shaped part covering the lens
  8. topRad = 3.0;
  9. // -> wall thickness of lens cover
  10. wall = 2.5;
  11. // -> increase this number for smoother surface
  12. $fn = 120;
  13. //////////////////////////////////////////////////////////////
  14. // main
  15. //////////////////////////////////////////////////////////////
  16. union()
  17. {
  18. makeLensConver();
  19. makeHolder();
  20. }
  21. //////////////////////////////////////////////////////////////
  22. module makeHolder()
  23. {
  24. translate([lensDia/2+wall-0.3, 0, height/2])
  25. scale([1.0,1.5,1.0])
  26. rotate([0,0,-100])
  27. {
  28. rotate_extrude(angle=200, convexity = 10)
  29. translate([2.5, 0, 0])
  30. circle(r = wall/2);
  31. }
  32. }
  33. //////////////////////////////////////////////////////////////
  34. module makeLensConver()
  35. {
  36. translate([0,0,height])
  37. rotate([0,180,0])
  38. difference()
  39. {
  40. lensConver(lensDia+2*wall, height, topRad);
  41. translate([0,0,wall])
  42. lensConver(lensDia, height, topRad);
  43. }
  44. }
  45. //////////////////////////////////////////////////////////////
  46. module lensConver(diameter, height, topRadius)
  47. {
  48. union()
  49. {
  50. scale([diameter, diameter, 2*topRadius]) sphere(d=1);
  51. cylinder(h=height,d=diameter,center=false);
  52. }
  53. }