diff --git a/examples/tiles/penrose_basket.scad b/examples/tiles/penrose_basket.scad index 719d8162..a00a1c90 100644 --- a/examples/tiles/penrose_basket.scad +++ b/examples/tiles/penrose_basket.scad @@ -7,20 +7,28 @@ use ; use ; basket_radius = 40; -radius_in_plane = basket_radius / 1.25 / cos(36); +radius_in_plane = basket_radius; + n = 4; line_diameter = 2; +bottom_radius = 8; +bottom_height = 3; shell_random_threshold = 0.5; // 0 ~ 1 $fn = 4; -penrose_basket(basket_radius, radius_in_plane, n, line_diameter, shell_random_threshold); - -module penrose_basket(basket_radius, radius_in_plane, n, line_diameter, shell_random_threshold) { - tris = tile_penrose3(n); +penrose_basket(basket_radius, radius_in_plane, n, line_diameter, bottom_radius, bottom_height, shell_random_threshold); +module penrose_basket(basket_radius, radius_in_plane, n, line_diameter, bottom_radius, bottom_height, shell_random_threshold) { + tris = [for(t = tile_penrose3(n)) t[1] * radius_in_plane]; for(t = tris) { - if(every(t[1], function(p) norm(p * radius_in_plane) < radius_in_plane * 1.25)) { - pts = [for(p = t[1] * radius_in_plane) ptf_c2sphere(p, basket_radius)]; + if(every(t, function(p) norm(p) < radius_in_plane * 1.25)) { + pts = [ + for(p = t) + let(cp = ptf_c2sphere(p, basket_radius)) + norm(p) < bottom_radius ? + [cp[0], cp[1], -cp[2] + 2 * basket_radius - bottom_height * 2] : + cp + ]; hull_polyline3d( pts,