diff --git a/examples/photo_fibonacci_lattice.scad b/examples/photo_fibonacci_lattice.scad index fa1b1285..48e456ea 100644 --- a/examples/photo_fibonacci_lattice.scad +++ b/examples/photo_fibonacci_lattice.scad @@ -1,8 +1,9 @@ use num_pts = 5000; -dot_r = .6; -dot_fn = 4; +thickness = 3; +dot_r_scale = 0.00125; +dot_fn = 12; levels = [ [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], @@ -113,15 +114,26 @@ r = min(rows, columns) / 2; pts = fibonacci_lattice2(num_pts); -for(p = pts) { - sample_p = r * p + center; - h = levels[rows - floor(sample_p.y) - 1][floor(sample_p.x)]; - a = atan2(p.y, p.x); - - color([h, h, h] / 255) - translate(r * p) - linear_extrude(h / 100 + 1) - rotate(a) - circle(dot_r, $fn = dot_fn); +color("white") +translate([0, 0, thickness / 2]) +linear_extrude(thickness / 2) +difference() { + circle(r, $fn = 48); + { + for(p = pts) { + sample_p = r * p + center; + h = levels[rows - floor(sample_p.y) - 1][floor(sample_p.x)]; + a = atan2(p.y, p.x); + dot_r = (255 - h) * dot_r_scale; + if(dot_r > 0) { + translate(r * p) + rotate(a) + circle(dot_r + 0.4, $fn = dot_fn); + } + } + } } +color("black") +linear_extrude(thickness / 2) + circle(r); \ No newline at end of file