diff --git a/src/lemniscate_2circles.scad b/src/lemniscate_2circles.scad new file mode 100644 index 00000000..946c9585 --- /dev/null +++ b/src/lemniscate_2circles.scad @@ -0,0 +1,50 @@ +use <__comm__/__frags.scad>; +use ; +use ; + +function lemniscate_2circles(radius, c = 1) = + let( + fn = __frags(radius), + t_step = 180 / fn, + circle_path = shape_circle(radius = radius) + ) + concat( + [ + for(t = [0:fn - 1]) + [circle_path[t][0] - radius, circle_path[t][1], cos(t * t_step) * c] + ], + [ + for(t = [0:fn - 1]) + [-circle_path[t][0] + radius, circle_path[t][1], -cos(t * t_step) * c] + ] + ); + +/* +use ; +use ; + +shape_pts = [ + [3, -1.5], + [3, 1.5], + [2, 1.5], + [2, 0.5], + [-2, 0.5], + [-2, 1.5], + [-3, 1.5], + [-3, -1.5], + [-2, -1.5], + [-2, -0.5], + [2, -0.5], + [2, -1.5] +]; + +$fn = 48; + +path = lemniscate_2circles(10, 2); + +path_extrude( + shape_pts, + concat(path, [path[0]]), + method = "EULER_ANGLE" +); +*/ \ No newline at end of file