UltimateCodeWarrior

Lens not rotating about Z Axis

Sep 16th, 2024
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | Source Code | 0 0
  1. use <threads-scad/threads.scad>;
  2. $fa=1;
  3. $fs= 0.4;
  4.  
  5. $fn = $preview ? 64:360;
  6.  
  7.  
  8. // For BambuLabs Printer
  9. // H=249,W-238,D=256
  10. // Safe bet is a 225 mm cube
  11. // This drawing is 200 mm, or 7.87 inches
  12. //Cntrl-Shift-V Show all, Max Zoom
  13. // Cad "Front View = Elevation" Top View = "Plan" The X-Y View?
  14. //https://openscad.org/cheatsheet/
  15. //https://openscad.org/cheatsheet/snapshot.html
  16. //https://en.wikibooks.org/wiki/OpenSCAD_Tutorial
  17. //PasteBin
  18.  
  19. $vpr=[90,0,0]; // Front
  20. //$vpr=[0,0,0]; // Top
  21.  
  22. c_h = 100; // height
  23. c_r = 100; // radius
  24. c_t = 5; //thickness
  25. c_2t = 2*c_t;
  26.  
  27. pi_l= 85+3; // +3 is the overhang of usb/ether
  28. pi_w= 56;
  29. pi_h= 20;
  30. pi_hole_r= 2.7;
  31. pi_edge_off = 3.5;
  32. pi_hole_wid_dist = 49;
  33. pi_hole_len_dist = 58;
  34.  
  35. module main_hull(){
  36.  
  37. // If I don't spesicfy r= for radius, it becomes a cone?
  38. difference() {
  39. cylinder(h=c_h,r=c_r,false);
  40. translate([0,0,-10])
  41. cylinder(h=1.2*c_h,r=c_r-c_2t,true);
  42.  
  43. // Lens Cutout
  44. rotate([0,0,45])
  45. %cylinder(h=3,r= 25.5,false);
  46.  
  47. }
  48. }
  49.  
  50.  
  51. module pi_footprint() {
  52.  
  53.  
  54. color("crimson",1.0)
  55.  
  56. translate([c_h - ((c_h-pi_l)/2),40,0])
  57. rotate([0,-45,90])
  58.  
  59. cube([pi_w, pi_l,pi_h],center=false);
  60.  
  61. }
  62.  
  63. rotate([0,90,0])
  64. main_hull();
  65.  
  66. pi_footprint();
  67.  
  68.  
  69.  
Advertisement
Add Comment
Please, Sign In to add comment