diff --git a/examples/voronoi/voronoi_melon.scad b/examples/voronoi/voronoi_melon.scad new file mode 100644 index 00000000..b084ae38 --- /dev/null +++ b/examples/voronoi/voronoi_melon.scad @@ -0,0 +1,56 @@ +use ; +use ; +use ; +use ; + +eyelets = 500; +radius = 5; + +voronoi_melon(eyelets, radius); + +module voronoi_melon(eyelets, radius) { + pts = rand_pts_sphere(radius, eyelets); + cells = vrn_sphere(pts); + + color("DarkKhaki") + for(cell = cells) { + polyline_join(concat(cell, [cell[0]])) + sphere(radius / 60, $fn = 4); + } + + color("Olive") + sphere(radius, $fn = 96); + + color("DarkOliveGreen") { + r_union3(.6) { + scale(.99) + sphere(radius, $fn = 24); + + translate([0, 0, radius * 0.875]) + hull() { + $fn = 8; + sphere(radius / 15); + translate([0, 0, radius * .25]) + sphere(radius / 20); + } + } + + translate([0, 0, radius * 0.9]) { + $fn = 8; + + hull() { + translate([radius / 2, 0, radius * .30]) + sphere(radius / 40); + translate([0, 0, radius * .25]) + sphere(radius / 20); + } + + hull() { + translate([-radius / 4, radius / 10, radius * .35]) + sphere(radius / 40); + translate([0, 0, radius * .25]) + sphere(radius / 20); + } + } + } +} \ No newline at end of file