mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-07 15:26:39 +02:00
rename
This commit is contained in:
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
@@ -1,4 +1,4 @@
|
|||||||
# voronoi
|
# voronoi2d
|
||||||
|
|
||||||
Creats 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:
|
Creats 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:
|
||||||
|
|
||||||
@@ -17,20 +17,20 @@ Creats a [Voronoi diagram](https://en.wikipedia.org/wiki/Voronoi_diagram). The i
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
include <voronoi.scad>;
|
include <voronoi2d.scad>;
|
||||||
|
|
||||||
xs = rands(-20, 20, 50);
|
xs = rands(-20, 20, 50);
|
||||||
ys = rands(-20, 20, 50);
|
ys = rands(-20, 20, 50);
|
||||||
|
|
||||||
points = [for(i = [0:len(xs) - 1]) [xs[i], ys[i]]];
|
points = [for(i = [0:len(xs) - 1]) [xs[i], ys[i]]];
|
||||||
|
|
||||||
voronoi(points);
|
voronoi2d(points);
|
||||||
translate([60, 0, 0])
|
translate([60, 0, 0])
|
||||||
voronoi(points, region_type = "circle");
|
voronoi(points, region_type = "circle");
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
include <voronoi.scad>;
|
include <voronoi2d.scad>;
|
||||||
include <hollow_out.scad>;
|
include <hollow_out.scad>;
|
||||||
|
|
||||||
xs = rands(0, 40, 50);
|
xs = rands(0, 40, 50);
|
||||||
@@ -40,8 +40,8 @@ Creats a [Voronoi diagram](https://en.wikipedia.org/wiki/Voronoi_diagram). The i
|
|||||||
|
|
||||||
difference() {
|
difference() {
|
||||||
square([40, 20]);
|
square([40, 20]);
|
||||||
voronoi(points);
|
voronoi2d(points);
|
||||||
}
|
}
|
||||||
hollow_out(shell_thickness = 1) square([40, 20]);
|
hollow_out(shell_thickness = 1) square([40, 20]);
|
||||||
|
|
||||||

|

|
@@ -1,4 +1,4 @@
|
|||||||
module voronoi(points, spacing = 1, r = 0, delta = 0, chamfer = false, region_type = "square") {
|
module voronoi2d(points, spacing = 1, r = 0, delta = 0, chamfer = false, region_type = "square") {
|
||||||
xs = [for(p = points) p[0]];
|
xs = [for(p = points) p[0]];
|
||||||
ys = [for(p = points) abs(p[1])];
|
ys = [for(p = points) abs(p[1])];
|
||||||
|
|
Reference in New Issue
Block a user