1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-29 09:19:59 +02:00
This commit is contained in:
Justin Lin
2022-06-03 12:46:41 +08:00
parent cdb403ae8e
commit 0c4c338046

View File

@@ -0,0 +1,26 @@
use <util/rand.scad>;
use <experimental/circle_packing.scad>;
size = [200, 100];
min_radius = 1;
point_numbers = 100;
points = [
for(i = [0:point_numbers - 1])
[rand(0, size.x), rand(0, size.y)]
];
circles = circle_packing(points, min_radius);
mr = max([for(c = circles) c[1]]);
translate([0, 0, mr])
for(c = circles) {
translate(c[0])
sphere(c[1], $fn = 48);
}
for(c = circles) {
translate(c[0])
linear_extrude(mr)
circle(c[1]/ 3, $fn = 48);
}
linear_extrude(1) square(size);