Examples

A Voronoi pattern over sites you place yourself.

A Voronoi pattern over sites you place yourself.

Source: examples/explicit_points.scad
// A Voronoi pattern over sites you place yourself.
use <../voronoi.scad>

points = [
  [0, 0], [30, 0], [20, 10], [50, 20], [15, 30], [85, 30], [35, 30], [12, 60],
  [45, 50], [80, 80], [20, -40], [-20, 20], [-15, 10], [-15, 50]
];
voronoi(points, L = 80, thickness = 1, round = 4, nuclei = true);

examples/explicit_points.scad on GitHub

Voronoi webs filling three outlines, with and without a rim.

Source: examples/fill_polygon.scad
// Voronoi webs filling three outlines, with and without a rim.
use <../voronoi.scad>

kite = [[362.13, 35.7], [388.01, 47.59], [409.81, 58.66], [427.16, 68.73], [439.78, 77.62], [447.43, 85.19],
        [450.0, 91.29], [447.43, 95.84], [439.78, 98.75], [427.16, 99.96], [409.81, 99.47], [388.01, 97.27],
        [362.13, 93.41], [350.0, 60.5]];
color("Tomato") linear_extrude(height = 1) translate([-350, -35]) voronoi_polygon(kite, seed = 1);

box = [[0, 0], [-20, 0], [-20, -20], [0, -20]];
color("SteelBlue") linear_extrude(height = 2) translate([140, -5]) scale(3) voronoi_polygon(box, thickness = 0.2, round = 0.5, edging = 0, seed = 42);

column = [[0, 8], [20, 178], [40, 178], [60, 8]];
color("SeaGreen") linear_extrude(height = 10) translate([150, -10]) scale(0.5) voronoi_polygon(column, n = 50, seed = 7);

examples/fill_polygon.scad on GitHub

A 2 mm panel perforated with a Voronoi pattern inside a 4 mm frame.

Source: examples/perforated_panel.scad
// A 2 mm panel perforated with a Voronoi pattern inside a 4 mm frame.
use <../voronoi.scad>

size = [100, 60];
frame = 4;
linear_extrude(height = 2) difference() {
  square(size);
  intersection() {
    translate([frame, frame]) square(size - 2 * [frame, frame]);
    translate(size / 2) random_voronoi(n = 45, nuclei = false, thickness = 0.8, round = 1.5, min = 0, max = 100,
                                       seed = 5, center = true);
  }
}

examples/perforated_panel.scad on GitHub

Random Voronoi tiles in a 120 mm square, extruded.

Change the seed for another pattern. The square trims the outer cells, which otherwise reach out to L.

Source: examples/random_tiles.scad
// Random Voronoi tiles in a 120 mm square, extruded. Change the seed for another
// pattern. The square trims the outer cells, which otherwise reach out to L.
use <../voronoi.scad>

linear_extrude(height = 3) intersection() {
  square(120, center = true);
  random_voronoi(n = 40, thickness = 1, round = 2, min = 0, max = 120, seed = 42, center = true);
}

examples/random_tiles.scad on GitHub


This site uses Just the Docs, a documentation theme for Jekyll.