diff --git a/examples/arc_tiled_lines.scad b/examples/arc_tiled_lines.scad deleted file mode 100644 index 4a976098..00000000 --- a/examples/arc_tiled_lines.scad +++ /dev/null @@ -1,40 +0,0 @@ -use ; -use ; -use ; -use ; - -module arc_tiled_lines(size, angle, step, line_width = 1) { - sizexy = is_num(size) ? [size, size] : size; - s = is_undef(step) ? line_width * 2 : step; - - function rand_diagonal_line_pts(x, y, size) = - rand(0, 1) >= 0.5 ? [[x, y], [x + size, y + size]] : [[x + size, y], [x, y + size]]; - - lines = [ - for(x = [0:s:sizexy[0] - s]) - for(y = [0:s:sizexy[1] - s]) - rand_diagonal_line_pts(x, y, s) - ]; - - for(line = lines) { - pts = [for(p = line) tf_ring(size, p, size[0], angle)]; - hull_polyline2d(pts, width = line_width); - } - - arc_width = line_width * 2; - arc(radius = size[0], angle = angle, width = arc_width, $fn = 36); - arc(radius = size[0] * 2, angle = angle, width = arc_width, $fn = 36); - - if(angle != 360) { - hull_polyline2d([[size[0], 0], [size[0] * 2, 0]], width = arc_width); - rotate(angle) - hull_polyline2d([[size[0], 0], [size[0] * 2, 0]], width = arc_width); - } -} - -size = [20, 100]; -line_width = .5; -step = 1; -angle = 360; - -arc_tiled_lines(size, angle, step, line_width); diff --git a/examples/tiled_line_mobius.scad b/examples/tiled_line_mobius.scad new file mode 100644 index 00000000..04b31952 --- /dev/null +++ b/examples/tiled_line_mobius.scad @@ -0,0 +1,40 @@ +use ; +use ; +use ; + +module tiled_line_mobius(size, twist, step, line_width = 1) { + sizexy = is_num(size) ? [size, size] : size; + s = is_undef(step) ? line_width * 2 : step; + + function rand_diagonal_line_pts(x, y, size) = + rand(0, 1) >= 0.5 ? [[x, y], [x + size, y + size]] : [[x + size, y], [x, y + size]]; + + lines = concat( + [ + for(x = [0:s:sizexy[0] - s]) + for(y = [0:s:sizexy[1] - s]) + rand_diagonal_line_pts(x, y, s) + ], + [ + for(i = [0:step:size[1] - 1]) + [[0, i], [0, i + step]] + ], + [ + for(i = [0:step:size[1] - 1]) + [[size[0], i], [size[0], i + step]] + ] + ); + + for(line = lines) { + pts = [for(p = line) tf_ring(size, p, size[0], 360, twist)]; + hull_polyline3d(pts, thickness = line_width); + } +} + +size = [20, 100]; +line_width = .5; +step = 1; +twist = 180; +$fn = 4; + +tiled_line_mobius(size, twist, step, line_width);