diff --git a/docs/images/lib3x-voronoi2d-1.JPG b/docs/images/lib3x-voronoi2d-1.JPG deleted file mode 100644 index a995d82b..00000000 Binary files a/docs/images/lib3x-voronoi2d-1.JPG and /dev/null differ diff --git a/docs/images/lib3x-voronoi2d-2.JPG b/docs/images/lib3x-voronoi2d-2.JPG deleted file mode 100644 index fa070606..00000000 Binary files a/docs/images/lib3x-voronoi2d-2.JPG and /dev/null differ diff --git a/docs/images/lib3x-voronoi3d-1.JPG b/docs/images/lib3x-voronoi3d-1.JPG deleted file mode 100644 index 2557f9cc..00000000 Binary files a/docs/images/lib3x-voronoi3d-1.JPG and /dev/null differ diff --git a/docs/images/lib3x-voronoi3d-2.JPG b/docs/images/lib3x-voronoi3d-2.JPG deleted file mode 100644 index ed780011..00000000 Binary files a/docs/images/lib3x-voronoi3d-2.JPG and /dev/null differ diff --git a/docs/lib3x-voronoi2d.md b/docs/lib3x-voronoi2d.md deleted file mode 100644 index 7a6d866e..00000000 --- a/docs/lib3x-voronoi2d.md +++ /dev/null @@ -1,44 +0,0 @@ -# voronoi2d - -Create a [Voronoi diagram](https://en.wikipedia.org/wiki/Voronoi_diagram). The initial region for each cell is calculated automatically from the given points by the following code: - - xs = [for(p = points) p[0]]; - ys = [for(p = points) abs(p[1])]; - region_size = max([(max(xs) - min(xs) / 2), (max(ys) - min(ys)) / 2]); - -**Since:** 1.3 - -## Parameters - -- `points` : Points for each cell. -- `spacing` : Distance between cells. Default to 1. -- `r`, `delta`, `chamfer` : The outlines of each cell can be moved outward or inward. These parameters have the same effect as [`offset`](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#offset). -- `region_type` : The initial shape for each cell can be `"square"` or `"circle"`. Default to `"square"`. - -## Examples - - use ; - - points = [for(i = [0:50]) rands(-20, 20, 2)]; - - voronoi2d(points); - translate([60, 0, 0]) - voronoi2d(points, region_type = "circle"); - -![voronoi2d](images/lib3x-voronoi2d-1.JPG) - - use ; - use ; - - xs = rands(0, 40, 50); - ys = rands(0, 20, 50); - - points = [for(i = [0:len(xs) - 1]) [xs[i], ys[i]]]; - - difference() { - square([40, 20]); - voronoi2d(points); - } - hollow_out(shell_thickness = 1) square([40, 20]); - -![voronoi2d](images/lib3x-voronoi2d-2.JPG) \ No newline at end of file diff --git a/docs/lib3x-voronoi3d.md b/docs/lib3x-voronoi3d.md deleted file mode 100644 index 373e7a31..00000000 --- a/docs/lib3x-voronoi3d.md +++ /dev/null @@ -1,60 +0,0 @@ -# voronoi3d - -Create a 3D version of [Voronoi diagram](https://en.wikipedia.org/wiki/Voronoi_diagram). The initial space for each cell is calculated automatically from the given points by the following code: - - xs = [for(p = points) p[0]]; - ys = [for(p = points) abs(p[1])]; - zs = [for(p = points) abs(p[2])]; - space_size = max([(max(xs) - min(xs) / 2), (max(ys) - min(ys)) / 2, (max(zs) - min(zs)) / 2]); - // cube([space_size, space_size * 2, space_size * 2]); - -The preview or rendering of 3D Voronoi is slow. If you want to use this module, render and export the 3D Voronoi model first. Then, `import` the model to do what you want. - -**Since:** 1.3. - -## Parameters - -- `points` : Points for each cell. -- `spacing` : Distance between cells. Default to 1. - -## Examples - - use ; - - r = 30; - - zas = rands(0, 359, 12); - yas = rands(0, 179, 12); - - points = [ - for(i = [0:len(zas) - 1]) - [ - r * cos(yas[i]) * cos(zas[i]), - r * cos(yas[i]) * sin(zas[i]), - r * sin(yas[i]) - ] - ]; - - #for(pt = points) { - translate(pt) cube(1); - } - - intersection() { - sphere(r); - voronoi3d(points); - } - -![voronoi3d](images/lib3x-voronoi3d-1.JPG) - -If you render, export and save the previous model as `voronoi3d.stl`, the following code will generate a Voronoi sphere. - - r = 30; - thickness = 2; - - difference() { - sphere(r); - scale(1.01) import("voronoi3d.stl"); - sphere(r - thickness); - } - -![voronoi3d](images/lib3x-voronoi3d-2.JPG) \ No newline at end of file