UltimateCodeWarrior

Untitled

Sep 18th, 2024
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.07 KB | None | 0 0
  1. use <threads-scad/threads.scad>;
  2. //use <bolts/bolts.scad>;
  3. use <catchnhole/catchnhole.scad>;
  4. use <knurled-openscad/knurled.scad>;
  5.  
  6. $fa=1;
  7. $fs= 0.4;
  8.  
  9. $fn = $preview ? 64:360;
  10.  
  11. //Threads that go on clockwise = Green
  12. // Reverse Threads = Red
  13.  
  14.  
  15. // For BambuLabs Printer
  16. // H=249,W-238,D=256
  17. // Safe bet is a 225 mm cube
  18. // This drawing is 200 mm, or 7.87 inches
  19. //Cntrl-Shift-V Show all, Max Zoom
  20. // Cad "Front View = Elevation" Top View = "Plan" The X-Y View?
  21. //https://openscad.org/cheatsheet/
  22. //https://openscad.org/cheatsheet/snapshot.html
  23. //https://en.wikibooks.org/wiki/OpenSCAD_Tutorial
  24. //PasteBin
  25.  
  26. //TODO: Alan Wrench in Frnkenstein bolts, maybe knurled
  27. // grips, or weight like grips
  28. //
  29.  
  30.  
  31.  
  32. $vpr=[90,0,45]; // Right Side
  33. //$vpr=[90,0,0]; // Front
  34. //$vpr=[0,-90,90];
  35. //$vpr=[0,0,0]; // Top
  36.  
  37. c_h = 140; // height
  38. c_r = 100; // radius
  39. c_t = 5; //thickness
  40. c_2t = 2*c_t;
  41.  
  42. pi_l= 85+3; // +3 is the overhang of usb/ether
  43. pi_w= 56;
  44. pi_h= 20;
  45. pi_hole_r= 2.7;
  46. pi_edge_off = 3.5;
  47. pi_hole_wid_dist = 49;
  48. pi_hole_len_dist = 58;
  49.  
  50. lens_r = 25.5;
  51. lens_d = lens_r*2;
  52. lens_thick = 6;
  53.  
  54. lens_cutout_r = 17.0;
  55. lens_cutout_d = lens_cutout_r*2;
  56. lens_cutout_thick = 20;
  57.  
  58. module main_hull(){
  59.  
  60. // If I don't specify r= for radius, it becomes a cone?
  61. difference() {
  62. //cylinder(h=c_h,r=c_r,true);
  63.  
  64.  
  65. bare_threaded_cylinder(c_r*2,c_h,5);
  66. translate([0,0,-5])
  67. cylinder(h=c_h*1.2,r=c_r-c_2t,false);
  68.  
  69.  
  70.  
  71. // bare_threaded_hole(190,10,5) ;
  72.  
  73.  
  74. // Lens Seat Cutuout
  75. translate([0,-c_r+(lens_thick*2)+2,c_h/2])
  76. rotate([90,0,0])
  77. cylinder(h=lens_thick,r=lens_r,false);
  78.  
  79.  
  80. // Lens Thru-cutout thickness, punch hole through hull
  81. translate([0,-c_r+lens_cutout_thick,c_h/2])
  82. rotate([90,0,0])
  83. cylinder(h=lens_cutout_thick,r=lens_cutout_r,false);
  84.  
  85. // Cone Taper Cutout, maybe make black ?
  86. translate([0,-c_r+lens_cutout_thick-35,c_h/2])
  87. rotate([90,0,180])
  88. cylinder(h=lens_cutout_thick,r1=lens_cutout_r+10, r2=lens_cutout_r,false);
  89.  
  90. }
  91. }
  92.  
  93. ear_hole_diameter = 33;
  94. air_gap=80;
  95.  
  96. module left_side() {
  97. translate([-air_gap,0,0])
  98. rotate([0,-90,0])
  99. difference() {
  100. cylinder(h=25,r1=100,r2=75);
  101. translate([0,0,-2])
  102. cylinder(h=30,r=32,center=false); // Core it out
  103. }
  104. translate([-air_gap,0,0])
  105. rotate([0,-90,0])
  106. translate([0,0,-0.125])
  107. color("green",1.0)
  108. threaded_hole();
  109.  
  110.  
  111. translate([-air_gap+12,0,0])
  112. rotate([0,-90,0])
  113.  
  114. difference(){
  115. cylinder(h=15,r=(c_r+10),center=false);
  116. translate([0,0,-5])
  117. cylinder(h=15,r=c_r,center=false);
  118. color("green",1.0)
  119. bare_threaded_hole(c_r*2,10,5);
  120. }
  121.  
  122. }
  123. module right_side() {
  124.  
  125.  
  126.  
  127.  
  128. translate([c_h+air_gap,0,0])
  129. rotate([0,90,0])
  130. difference() {
  131. cylinder(h=25,r1=100,r2=75);
  132. translate([0,0,-2])
  133. cylinder(h=30,r=32,center=false); // Core it out
  134. }
  135. translate([c_h+air_gap,0,0])
  136. rotate([0,90,0])
  137. translate([0,0,-0.125])
  138. color("green",1.0)
  139. threaded_hole();
  140.  
  141.  
  142.  
  143. translate([c_h+air_gap-12,0,0])
  144. rotate([0,90,0])
  145.  
  146. difference(){
  147. cylinder(h=15,r=(c_r+10),center=false);
  148. translate([0,0,-5])
  149. cylinder(h=15,r=c_r,center=false);
  150. color("green",1.0)
  151. bare_threaded_hole(c_r*2,10,5);
  152. }
  153.  
  154. /*
  155.  
  156. translate([c_h+air_gap-12,0,0])
  157. rotate([0,90,0])
  158. color("green",1.0)
  159. bare_threaded_cylinder(197.5,10,5) ;
  160. */
  161.  
  162.  
  163. }
  164.  
  165. //TODO Large Hex Screw Embedded in Screw Cap for torque down?
  166. module left_screw() {
  167.  
  168. translate([-230,0,0])
  169. rotate([0,90,0])
  170. color("green",1.0)
  171. threaded_cylinder();
  172.  
  173. translate([-230,0,0])
  174. rotate([0,90,0])
  175. cylinder(h=25,r=40);
  176. /* Works, but will slow you to a crawl
  177. knurled_cylinder(
  178. height=25, // knurled cylinder height
  179. diameter=80, // knurled cylinder outer diameter
  180. knurl_width=3, // knurling polyhedron width
  181. knurl_height=4, // knurling polyhedron height
  182. knurl_depth=1.5, // knurling polyhedron depth
  183. bevel=3, // bevel height
  184. smooth=0 // percentage between 0 and 100
  185. );
  186. */
  187.  
  188. }
  189.  
  190. module right_screw() {
  191. translate([330,0,0])
  192. rotate([0,-90,0])
  193. color("green",1.0)
  194. threaded_cylinder();
  195.  
  196. translate([330,0,0])
  197. rotate([0,-90,0])
  198. cylinder(h=25,r=40);
  199. /* Works, but will slow you to a crawl
  200. knurled_cylinder(
  201. height=25, // knurled cylinder height
  202. diameter=80, // knurled cylinder outer diameter
  203. knurl_width=3, // knurling polyhedron width
  204. knurl_height=4, // knurling polyhedron height
  205. knurl_depth=1.5, // knurling polyhedron depth
  206. bevel=3, // bevel height
  207. smooth=0 // percentage between 0 and 100
  208. );
  209. */
  210. }
  211.  
  212. //socket_thread_diameter = 33;
  213. //socket_thread_length = 25;
  214. //socket_thread_pitch = 5;
  215.  
  216.  
  217. // Bezel Threads
  218. bezel_diameter = 60;
  219. bezel_rod_height=24;
  220. bezel_thread_length = 25;
  221. bezel_thread_pitch = 5;
  222. bezel_pipe_diameter = bezel_diameter-3*c_t;
  223.  
  224.  
  225. module bare_threaded_cylinder(rod_diameter,thread_length,thread_pitch) {
  226. RodStart(rod_diameter, 0,thread_length,rod_diameter,thread_pitch);
  227. }
  228.  
  229.  
  230. module bare_threaded_hole(rod_diameter,thread_length,thread_pitch) {
  231. RodEnd(rod_diameter, // Diameter
  232. thread_length, // height
  233. thread_length, // thread_len
  234. rod_diameter, // Thred_diam
  235. thread_pitch); // Thread_ptch
  236. }
  237.  
  238. module threaded_cylinder() {
  239. // Outer threaded cylinder
  240.  
  241. RodStart(bezel_diameter, bezel_rod_height,bezel_thread_length*1.75,bezel_diameter,bezel_thread_pitch);
  242.  
  243. }
  244.  
  245.  
  246.  
  247. // Module to create internal threads in Part B
  248. module threaded_hole() {
  249. RodEnd(bezel_diameter+20, // Diameter
  250. bezel_thread_length, // height
  251. bezel_thread_length, // thread_len
  252. bezel_diameter, // Thred_diam
  253. bezel_thread_pitch); // Thread_ptch
  254. }
  255.  
  256.  
  257.  
  258.  
  259. module pi_footprint() {
  260. color("crimson",1.0)
  261. translate([c_h - ((c_h-pi_l)/2),40,0])
  262. rotate([0,-45,90])
  263. cube([pi_w, pi_l,pi_h],center=false);
  264. }
  265.  
  266. rotate([0,90,0])
  267. main_hull();
  268.  
  269. pi_footprint();
  270. left_side();
  271. right_side();
  272.  
  273. left_screw();
  274. right_screw();
  275.  
  276.  
Advertisement
Add Comment
Please, Sign In to add comment