49xur

bagel_0105c

Jun 21st, 2022 (edited)
68
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.08 KB | None | 0 0
  1. /**
  2. * based off example from https://github.com/JustinSDK/dotSCAD/blob/master/docs/lib3x-torus_knot.md
  3. * using library https://github.com/JustinSDK/dotSCAD (latest master version required 938507d)
  4. **/
  5.  
  6. /*
  7. *
  8. * Version 0102a: First release with usability improvements
  9. * Version 0103a: Fix for level 0 torus radius was calculating incorrectly, also added correct examples for D-4D using the torus center line for rad_p properly.
  10. * Version 0104a: Initial support for generating winding molds
  11. * Version 0105a: Clean-up for generating winding molds.
  12. * Version 0105b: Remove work-around hacks for issue with dotSCAD path extrude (no fixed)
  13. * Version 0105c: Added phase attribute to align model coils with winding props
  14. */
  15.  
  16. use <dotSCAD/src/shape_circle.scad>;
  17. use <dotSCAD/src/path_extrude.scad>;
  18. use <dotSCAD/src/util/degrees.scad>;
  19. use <dotSCAD/src/__comm__/__frags.scad>;
  20.  
  21. function shape_circle(radius, start_n, stop_n) =
  22. let(
  23. _frags = __frags(radius),
  24. step_a = 360 / _frags,
  25. from = (is_undef(start_n) || start_n < 0) ? 0: start_n,
  26. to = (is_undef(stop_n) || stop_n > _frags) ? _frags - 1: stop_n - 1
  27. )
  28. [
  29. for(a = [each [from:to]] * step_a)
  30. [radius * cos(a), radius * sin(a)]
  31. ];
  32.  
  33. function length_3d(lt) =
  34. let(end = len(lt) - 1)
  35. end == 0 ? lt[0] :
  36. let(
  37. cum_total = [
  38. for(i = 0, s = 0, is_continue = i < end;
  39. is_continue;
  40. is_continue = i < end, s = is_continue ? s + sqrt((lt[i+1][0]-lt[i][0])^2+(lt[i+1][1]-lt[i][1])^2+(lt[i+1][2]-lt[i][2])^2) : undef, i = i + 1) s]
  41. )
  42. cum_total[end];
  43.  
  44. function single_torus_knot(q, rad, dir, phase, phi_step, min_phi=0, max_phi=-1) =
  45. [
  46. for(phi = min_phi; phi < (max_phi == -1 ? 6.283185307179586 : max_phi) - 0.00001; phi = phi + phi_step)
  47. let(
  48. phi_deg = degrees(phi),
  49. l0_deg = phi_deg+phase[0],
  50. l0_pos_x = rad[0]*cos(l0_deg),
  51. l0_pos_y = 0,
  52. l0_pos_z = rad[0]*sin(l0_deg)
  53. )
  54. [l0_pos_x,
  55. l0_pos_y,
  56. l0_pos_z]
  57. ];
  58.  
  59. function double_torus_knot(q, rad, dir, phase, phi_step, min_phi=0, max_phi=-1) =
  60. [
  61. for(phi = min_phi; phi < (max_phi == -1 ? 6.283185307179586*q[0] : max_phi) - 0.00001; phi = phi + phi_step)
  62. let(
  63. phi_deg = degrees(phi),
  64. l0_deg = -dir[0]*phi_deg+phase[0],
  65. l1_deg = phi_deg/q[0]+phase[1],
  66. l0_pos_x = rad[0]*cos(l0_deg),
  67. l0_pos_y = 0,
  68. l0_pos_z = rad[0]*sin(l0_deg),
  69. l1_pos_x = (l0_pos_x+rad[1])*cos(l1_deg)-l0_pos_y*sin(l1_deg),
  70. l1_pos_y = (l0_pos_x+rad[1])*sin(l1_deg)+l0_pos_y*cos(l1_deg),
  71. l1_pos_z = l0_pos_z
  72. )
  73. [l1_pos_x,
  74. l1_pos_y,
  75. l1_pos_z]
  76. ];
  77.  
  78. function triple_torus_knot(q, rad, dir, phase, phi_step, min_phi=0, max_phi=-1) =
  79. [
  80. for(phi = min_phi; phi < (max_phi == -1 ? 6.283185307179586*q[0]*q[1] : max_phi) - 0.00001; phi = phi + phi_step)
  81. let(
  82. phi_deg = degrees(phi),
  83. l0_deg = -dir[0]*phi_deg+phase[0],
  84. l1_deg = phi_deg/q[0]+phase[1],
  85. l0_pos_x = rad[0]*cos(l0_deg),
  86. l0_pos_y = 0,
  87. l0_pos_z = rad[0]*sin(l0_deg),
  88. l1_pos_x = (l0_pos_x+rad[1])*cos(l1_deg)-l0_pos_y*sin(l1_deg),
  89. l1_pos_y = (l0_pos_x+rad[1])*sin(l1_deg)+l0_pos_y*cos(l1_deg),
  90. l1_pos_z = l0_pos_z,
  91. l2_deg = dir[1]*phi_deg/q[0]/q[1]+phase[2],
  92. l2_pos_x = l1_pos_x,
  93. l2_pos_y = (l1_pos_y+rad[2])*cos(l2_deg)-l1_pos_z*sin(l2_deg),
  94. l2_pos_z = (l1_pos_y+rad[2])*sin(l2_deg)+l1_pos_z*cos(l2_deg)
  95. )
  96. [l2_pos_x,
  97. l2_pos_y,
  98. l2_pos_z]
  99. ];
  100.  
  101. function quad_torus_knot(q, rad, dir, phase, phi_step, min_phi=0, max_phi=-1) =
  102. [
  103. for(phi = min_phi; phi < (max_phi == -1 ? 6.283185307179586*q[0]*q[1]*q[2] : max_phi) - 0.00001; phi = phi + phi_step)
  104. let(
  105. phi_deg = degrees(phi),
  106. l0_deg = -dir[0]*phi_deg+phase[0],
  107. l1_deg = phi_deg/q[0]+phase[1],
  108. l0_pos_x = rad[0]*cos(l0_deg),
  109. l0_pos_y = 0,
  110. l0_pos_z = rad[0]*sin(l0_deg),
  111. l1_pos_x = (l0_pos_x+rad[1])*cos(l1_deg)-l0_pos_y*sin(l1_deg),
  112. l1_pos_y = (l0_pos_x+rad[1])*sin(l1_deg)+l0_pos_y*cos(l1_deg),
  113. l1_pos_z = l0_pos_z,
  114. l2_deg = dir[1]*phi_deg/q[0]/q[1]+phase[2],
  115. l2_pos_x = l1_pos_x,
  116. l2_pos_y = (l1_pos_y+rad[2])*cos(l2_deg)-l1_pos_z*sin(l2_deg),
  117. l2_pos_z = (l1_pos_y+rad[2])*sin(l2_deg)+l1_pos_z*cos(l2_deg),
  118. l3_deg = -dir[2]*phi_deg/q[0]/q[1]/q[2]+phase[3],
  119. l3_pos_x = l2_pos_x*cos(l3_deg)-(l2_pos_y+rad[3])*sin(l3_deg),
  120. l3_pos_y = l2_pos_x*sin(l3_deg)+(l2_pos_y+rad[3])*cos(l3_deg),
  121. l3_pos_z = l2_pos_z
  122. )
  123. [l3_pos_x,
  124. l3_pos_y,
  125. l3_pos_z]
  126. ];
  127.  
  128.  
  129. module single_torus(q, rad_p, rad_c, dir, phase, show_cores, phi_step, base_seg) {
  130. wire_1_cross_section_radius = rad_c[0];
  131. wire_1_cross_section_pts = shape_circle(wire_1_cross_section_radius,$fn=base_seg*rad_p[0]);
  132. pts_1 = single_torus_knot(q, rad_p, dir, phase, phi_step*rad_p[0]);
  133. length = length_3d(pts_1);
  134. echo("Length Wire", length);
  135. echo("Approx Volume Wire (length*crosssection)", length*3.141592654*rad_c[0]^2);
  136. path_extrude(
  137. wire_1_cross_section_pts,
  138. [each pts_1, pts_1[0]],
  139. closed = true,
  140. twist = 0,
  141. method = "AXIS_ANGLE"
  142. );
  143. }
  144.  
  145.  
  146. module double_torus(q, rad_p, rad_c, dir, phase, show_cores, phi_step, base_seg) {
  147. wire_1_cross_section_radius = rad_c[0];
  148. wire_1_cross_section_pts = shape_circle(wire_1_cross_section_radius,$fn=base_seg*rad_p[0]);
  149. pts_1 = double_torus_knot(q, rad_p, dir, phase, phi_step*rad_p[0]);
  150. length = length_3d(pts_1);
  151. echo("Length Wire", length);
  152. echo("Approx Volume Wire (length*crosssection)", length*3.141592654*rad_c[0]^2);
  153. path_extrude(
  154. wire_1_cross_section_pts,
  155. [each pts_1, pts_1[0]],
  156. closed = true,
  157. twist = 0,
  158. method = "AXIS_ANGLE"
  159. );
  160. if (show_cores > 0) {
  161. wire_2_cross_section_radius = rad_c[1];
  162. wire_2_cross_section_pts = shape_circle(wire_2_cross_section_radius,$fn=base_seg*rad_p[1]);
  163. pts_2 = double_torus_knot(q, [0,rad_p[1]], dir, phase, phi_step*rad_p[1]);
  164. length = length_3d(pts_2);
  165. echo("Length Core 1", length);
  166. echo("Approx Volume Core 1 (length*crosssection)", length*3.141592654*rad_c[1]^2);
  167. color([1,0,0])
  168. path_extrude(
  169. wire_2_cross_section_pts,
  170. [each pts_2, pts_2[0]],
  171. closed = true,
  172. twist = 0,
  173. method = "AXIS_ANGLE"
  174. );
  175. }
  176. }
  177.  
  178.  
  179. module triple_torus(q, rad_p, rad_c, dir, phase, show_cores, phi_step, base_seg) {
  180. wire_1_cross_section_radius = rad_c[0];
  181. wire_1_cross_section_pts = shape_circle(wire_1_cross_section_radius,$fn=base_seg*rad_p[0]);
  182. pts_1 = triple_torus_knot(q, rad_p, dir, phase, phi_step*rad_p[0]);
  183. length = length_3d(pts_1);
  184. echo("Length Wire", length);
  185. echo("Approx Volume Wire (length*crosssection)", length*3.141592654*rad_c[0]^2);
  186. path_extrude(
  187. wire_1_cross_section_pts,
  188. [each pts_1, pts_1[0]],
  189. closed = true,
  190. twist = 0,
  191. method = "AXIS_ANGLE"
  192. );
  193. if (show_cores > 0) {
  194. wire_2_cross_section_radius = rad_c[1];
  195. wire_2_cross_section_pts = shape_circle(wire_2_cross_section_radius,$fn=base_seg*rad_p[1]);
  196. pts_2 = triple_torus_knot(q, [0,rad_p[1],rad_p[2]], dir, phase, phi_step*rad_p[1]);
  197. length = length_3d(pts_2);
  198. echo("Length Core 1", length);
  199. echo("Approx Volume Core 1 (length*crosssection)", length*3.141592654*rad_c[1]^2);
  200. color([1,0,0])
  201. path_extrude(
  202. wire_2_cross_section_pts,
  203. [each pts_2, pts_2[0]],
  204. closed = true,
  205. twist = 0,
  206. method = "AXIS_ANGLE"
  207. );
  208. if (show_cores > 1) {
  209. wire_3_cross_section_radius = rad_c[2];
  210. wire_3_cross_section_pts = shape_circle(wire_3_cross_section_radius,$fn=base_seg*rad_p[2]);
  211. pts_3 = triple_torus_knot(q, [0,0,rad_p[2]], dir, phase, phi_step*rad_p[2]);
  212. length = length_3d(pts_3);
  213. echo("Length Core 2", length);
  214. echo("Approx Volume Core 2 (length*crosssection)", length*3.141592654*rad_c[2]^2);
  215. color([0,1,0])
  216. path_extrude(
  217. wire_3_cross_section_pts,
  218. [each pts_3, pts_3[0]],
  219. closed = true,
  220. twist = 0,
  221. method = "AXIS_ANGLE"
  222. );
  223. }
  224. }
  225. }
  226.  
  227. module triple_torus_winding_prop_sub(q, rad_p, rad_c, dir, phase, phi_step, base_seg, hollow_core) {
  228. wire_2_cross_section_radius = rad_c[1]+2*rad_c[0];
  229. wire_2_cross_section_pts = shape_circle(wire_2_cross_section_radius,$fn=base_seg*rad_p[0]);
  230. pts_2 = double_torus_knot([q[1]], [rad_p[1],rad_p[2]], [dir[1]], [phase[1],phase[2]], phi_step);
  231. wire_3_cross_section_radius = rad_c[2]+1*rad_c[1]+3*rad_c[0]; // use 3*rad_c[0] so we get some grip...
  232. wire_3_cross_section_pts = shape_circle(wire_3_cross_section_radius,$fn=base_seg*rad_p[1]);
  233. hollow_core_cross_section_pts = shape_circle(hollow_core,$fn=base_seg*rad_p[1]);
  234. pts_3 = double_torus_knot([q[1]], [0,rad_p[2]], [dir[1]], [phase[1],phase[2]], phi_step*rad_p[1], max_phi=6.283185307179586*q[1]);
  235. difference() {
  236. union() {
  237. path_extrude(
  238. wire_3_cross_section_pts,
  239. [each pts_3, pts_3[0]],
  240. closed = true,
  241. method = "AXIS_ANGLE"
  242. );
  243. }
  244. union() {
  245. path_extrude(
  246. wire_2_cross_section_pts,
  247. [each pts_2, pts_2[0]],
  248. closed = true,
  249. method = "AXIS_ANGLE"
  250. );
  251. if (hollow_core > 0) {
  252. path_extrude(
  253. hollow_core_cross_section_pts,
  254. [each pts_3, pts_3[0]],
  255. closed = true,
  256. method = "AXIS_ANGLE"
  257. );
  258. }
  259. }
  260. }
  261. }
  262.  
  263. module triple_torus_winding_prop(q, rad_p, rad_c, dir, phase, phi_step, base_seg, split=0, gap=0, hollow_core=0) {
  264. difference() {
  265. union() {
  266. if (split > 0) {
  267. translate([0,0,1])
  268. intersection() {
  269. triple_torus_winding_prop_sub(q, rad_p, rad_c, dir, phase, phi_step, base_seg, hollow_core);
  270. translate([-2*rad_p[2],-2*rad_p[2],0])
  271. cube([4*rad_p[2],4*rad_p[2],2*rad_p[2]]);
  272. }
  273. translate([0,0,-1])
  274. intersection() {
  275. triple_torus_winding_prop_sub(q, rad_p, rad_c, dir, phase, phi_step, base_seg, hollow_core);
  276. translate([-2*rad_p[2],-2*rad_p[2],-2*rad_p[2]])
  277. cube([4*rad_p[2],4*rad_p[2],2*rad_p[2]]);
  278. }
  279. }
  280. else {
  281. triple_torus_winding_prop_sub(q, rad_p, rad_c, dir, phase, phi_step, base_seg, hollow_core);
  282. }
  283. }
  284. union() {
  285. if (gap > 0) {
  286. translate([0,-gap/2,-2*rad_p[2]])
  287. cube([2*rad_p[2],gap,4*rad_p[2]]);
  288. }
  289. }
  290. }
  291. }
  292.  
  293. module quad_torus(q, rad_p, rad_c, dir, phase, show_cores, phi_step, base_seg) {
  294. wire_1_cross_section_radius = rad_c[0];
  295. wire_1_cross_section_pts = shape_circle(wire_1_cross_section_radius,$fn=base_seg*rad_p[0]);
  296. pts_1 = quad_torus_knot(q, rad_p, dir, phase, phi_step*rad_p[0]);
  297. length = length_3d(pts_1);
  298. echo("Length Wire", length);
  299. echo("Approx Volume Wire (length*crosssection)", length*3.141592654*rad_c[0]^2);
  300. path_extrude(
  301. wire_1_cross_section_pts,
  302. [each pts_1, pts_1[0]],
  303. closed = true,
  304. twist = 0,
  305. method = "AXIS_ANGLE"
  306. );
  307. if (show_cores > 0) {
  308. wire_2_cross_section_radius = rad_c[1];
  309. wire_2_cross_section_pts = shape_circle(wire_2_cross_section_radius,$fn=base_seg*rad_p[1]);
  310. pts_2 = quad_torus_knot(q, [0,rad_p[1],rad_p[2],rad_p[3]], dir, phase, phi_step*rad_p[1]);
  311. length = length_3d(pts_2);
  312. echo("Length Core 1", length);
  313. echo("Approx Volume Core 1 (length*crosssection)", length*3.141592654*rad_c[1]^2);
  314. color([1,0,0])
  315. path_extrude(
  316. wire_2_cross_section_pts,
  317. [each pts_2, pts_2[0]],
  318. closed = true,
  319. twist = 0,
  320. method = "AXIS_ANGLE"
  321. );
  322. if (show_cores > 1) {
  323. wire_3_cross_section_radius = rad_c[2];
  324. wire_3_cross_section_pts = shape_circle(wire_3_cross_section_radius,$fn=base_seg*rad_p[2]);
  325. pts_3 = quad_torus_knot(q, [0,0,rad_p[2],rad_p[3]], dir, phase, phi_step*rad_p[2]);
  326. length = length_3d(pts_3);
  327. echo("Length Core 2", length);
  328. echo("Approx Volume Core 2 (length*crosssection)", length*3.141592654*rad_c[2]^2);
  329. color([0,1,0])
  330. path_extrude(
  331. wire_3_cross_section_pts,
  332. [each pts_3, pts_3[0]],
  333. closed = true,
  334. twist = 0,
  335. method = "AXIS_ANGLE"
  336. );
  337. if (show_cores > 2) {
  338. wire_4_cross_section_radius = rad_c[3];
  339. wire_4_cross_section_pts = shape_circle(wire_4_cross_section_radius,$fn=base_seg*rad_p[3]);
  340. pts_4 = quad_torus_knot(q, [0,0,0,rad_p[3]], dir, phase, phi_step*rad_p[3]);
  341. length = length_3d(pts_4);
  342. echo("Length Core 3", length);
  343. echo("Approx Volume Core 3 (length*crosssection)", length*3.141592654*rad_c[3]^2);
  344. color([0,0,1])
  345. path_extrude(
  346. wire_4_cross_section_pts,
  347. [each pts_4, pts_4[0]],
  348. closed = true,
  349. twist = 0,
  350. method = "AXIS_ANGLE"
  351. );
  352. }
  353. }
  354. }
  355. }
  356.  
  357. module quad_torus_winding_prop(q, rad_p, rad_c, dir, phase, phi_step, base_seg, key_size_multiplier=1, key_size_tolerance=0.2, segments=1) {
  358. wire_2_cross_section_radius = rad_c[1]+2*rad_c[0];
  359. wire_2_cross_section_pts = shape_circle(wire_2_cross_section_radius,$fn=base_seg*rad_p[0]);
  360. wire_3_cross_section_radius = rad_c[2]+1*rad_c[1]+3*rad_c[0]; // use 3*rad_c[0] so we get some grip...
  361. wire_3_cross_section_pts = shape_circle(wire_3_cross_section_radius,undef,undef,$fn=base_seg*rad_p[1]);
  362. pts_3 = triple_torus_knot([q[1],q[2]], [0,rad_p[2],rad_p[3]], [dir[1],dir[2]], [phase[1],phase[2],phase[3]], phi_step, min_phi=0, max_phi=6.283185307179586*segments*q[1]);
  363. difference() {
  364. union() {
  365. if (q[2] == segments) {
  366. path_extrude(
  367. wire_3_cross_section_pts,
  368. [each pts_3, pts_3[0]],
  369. closed = true,
  370. method = "AXIS_ANGLE"
  371. );
  372. }
  373. else {
  374. path_extrude(
  375. wire_3_cross_section_pts,
  376. [each pts_3],
  377. method = "AXIS_ANGLE"
  378. );
  379. }
  380. if (key_size_multiplier > 0) {
  381. translate([rad_p[2],rad_p[3],0])
  382. rotate([45/q[2]*4,0,0])
  383. cube([2*rad_c[2]/3*key_size_multiplier-key_size_tolerance,4*rad_c[2]/3*key_size_multiplier-key_size_tolerance,2*rad_c[2]/3*key_size_multiplier-key_size_tolerance], center=true);
  384. }
  385. }
  386. union() {
  387. if (q[2] == segments) {
  388. pts_2 = triple_torus_knot([q[1],q[2]], [rad_p[1],rad_p[2],rad_p[3]], [dir[1],dir[2]], [phase[1],phase[2],phase[3]], phi_step, min_phi=0, max_phi=6.283185307179586*segments*q[1]);
  389. path_extrude(
  390. wire_2_cross_section_pts,
  391. [each pts_2, pts_2[0]],
  392. closed = true,
  393. method = "AXIS_ANGLE"
  394. );
  395. }
  396. else {
  397. pts_2 = triple_torus_knot([q[1],q[2]], [rad_p[1],rad_p[2],rad_p[3]], [dir[1],dir[2]], [phase[1],phase[2],phase[3]], phi_step, min_phi=-6.283185307179586, max_phi=6.283185307179586*(segments+0.5)*q[1]);
  398. path_extrude(
  399. wire_2_cross_section_pts,
  400. [each pts_2],
  401. method = "AXIS_ANGLE"
  402. );
  403. }
  404. if (key_size_multiplier > 0) {
  405. rotate([segments*360/q[2],0,0])
  406. translate([rad_p[2],rad_p[3],0])
  407. rotate([45/q[2]*4,0,0])
  408. cube([2*rad_c[2]/3*key_size_multiplier,4*rad_c[2]/3*key_size_multiplier,2*rad_c[2]/3*key_size_multiplier], center=true);
  409. }
  410. }
  411. }
  412. }
  413.  
  414. /**
  415. * Coil Sample Parameters
  416. * q - number of loops per level
  417. * rad_p - radius of torus center line per level (this is used for positioning of the wire and cores relative to the center of each parent flux loop)
  418. * rad_c - radius of wire/cores (this is used for the wire/core model radius)
  419. * dir - rotation direction 1 clockwise (right-handed?), -1 counter-clockwise (left-handed?)
  420. * phase - the phase angle to start each winding at (default should be 0 for each level) (there is an example below that illustrates how this can be used to align a model coil to a winding prop)
  421. * show_cores - number of cores to show
  422. * phi_step - length of longitudinal wire segment in radians (this is then multiplied by the rad_p radius to reduce data in cores)
  423. * base_seg - segments for wire diameter (this is then multiplied by the rad_p radius to reduce data in cores)
  424. **/
  425.  
  426. // D-4D
  427. //single_torus([], [2-0.5], [0.5], [], [0], 0, 6.283185307179586/20, 40);
  428. //double_torus([12], [2-0.5,8-2], [0.5,1], [1], [0,0], 1, 6.283185307179586/20, 20);
  429. //triple_torus([12,18], [2-0.5,8-2,32-8], [0.5,1,4], [1,1], [0,0,0], 2, 6.283185307179586/20, 20);
  430. //quad_torus([12,18,24], [2-0.5,8-2,32-8,128-32], [0.5,1,4,16], [1,1,1], [0,0,0,0], 3, 6.283185307179586/20, 10);
  431. //quad_torus([24,24,24], [2-0.5,8-2,32-8,128-32], [0.5,1,4,16], [1,1,1], [0,0,0,0], 3, 6.283185307179586/20, 10);
  432.  
  433. // Other Dimensions
  434. //quad_torus([10,10,10], [1.15,4,10.5,28], [0.5,1,4,16], [1,1,1], [0,0,0,0], 0, 6.283185307179586/20, 10); // this is designed to be printed more affordably in metal
  435.  
  436. /**
  437. * Winding Prop Sample Parameters
  438. * takes the same parameters as coil sample parameters in addition to those specified below
  439. *
  440. * triple_torus_winding_mold
  441. * split - split the torus in half so it can be printed without supports and joined later (0 - no split, 1 - split) (default 0)
  442. * gap - the gap to leave through which your wire coil can be fed (0 - no gap, # - gap size) (default 0)
  443. * hollow_core - the radius of hollow core (0 - no hollow core, # - radius size)
  444. *
  445. * quad_torus_winding_prop
  446. * key_size_multiplier - a multiplier to control the size of the key used to connect together segments (set to 0 if you don't want any key) (default 1)
  447. * key_size_tolerance - the difference in size between the key hole and key protrusion (default 0.2)
  448. * segments - how many segments to generate in one chunk (the more segments you have in a chunk the more times you need to thread your coiled wire through as you wind it) (default 1)
  449. **/
  450.  
  451. // D-4D
  452. //triple_torus_winding_prop([12,18], [2-0.5,8-2,32-8], [0.5,1,4], [1,1], [0,0,0], 6.283185307179586/20, 20, split=1, gap=6, hollow_core=3);
  453. //quad_torus_winding_prop([12,18,24], [2-0.5,8-2,32-8,128-32], [0.5,1,4,16], [1,1,1], [0,0,0,0], 6.283185307179586/20, 10, key_size_multiplier=1.5, key_size_tolerance=0.2, segments=4);
  454. quad_torus_winding_prop([24,24,24], [2-0.5,8-2,32-8,128-32], [0.5,1,4,16], [1,1,1], [0,0,0,0], 6.283185307179586/20, 10, key_size_multiplier=1.5, key_size_tolerance=0.2, segments=6);
  455.  
  456. // Other Examples
  457. //quad_torus_winding_prop([24,24,24+1], [2-0.5,8-2,32-8,(128-32)/24*25], [0.5,1,4,16], [1,1,1], [0,0,0,0], 6.283185307179586/20, 10, key_size_multiplier=1.5, key_size_tolerance=0.2, segments=24); // this is the same as the D-4D one but a full ring of 24 segments but then spread by an extra segment (with increased radius so that it is easy to thread the wire through then glue it closed after. This is possible because most filaments are flexible.
  458.  
  459. // Example showing alignment of model coil to winding prop
  460. //quad_torus_winding_prop([12,18,24], [2-0.5,8-2,32-8,128-32], [0.5,1,4,16], [1,1,1], [0,0,0,0], 6.283185307179586/20, 10, key_size_multiplier=1.5, key_size_tolerance=0.2, segments=24); // this is an example showing what happens when you specify parameters that should generated a closed loop with no cut
  461. //rotate([360/(24*4),0,0])rotate([0,-90,0])quad_torus([12,18,24], [2-0.5,8-2,32-8,128-32], [0.5,1,4,16], [1,1,1], [0,-90,0,0], 1, 6.283185307179586/20, 10); // this is the wire coil for the above winding prop
Comments
  • 49xur
    2 years
    # text 0.08 KB | 0 0
    1. Latest version at https://pastebin.com/kbwK5EdL or referenced from that newer version.
Add Comment
Please, Sign In to add comment