mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-03-14 02:59:42 +01:00
rename
This commit is contained in:
parent
43a52bbaa0
commit
810a1d3ece
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:
|
||||
|
||||
@ -17,20 +17,20 @@ Creats a [Voronoi diagram](https://en.wikipedia.org/wiki/Voronoi_diagram). The i
|
||||
|
||||
## Examples
|
||||
|
||||
include <voronoi.scad>;
|
||||
include <voronoi2d.scad>;
|
||||
|
||||
xs = rands(-20, 20, 50);
|
||||
ys = rands(-20, 20, 50);
|
||||
|
||||
points = [for(i = [0:len(xs) - 1]) [xs[i], ys[i]]];
|
||||
|
||||
voronoi(points);
|
||||
voronoi2d(points);
|
||||
translate([60, 0, 0])
|
||||
voronoi(points, region_type = "circle");
|
||||
|
||||

|
||||

|
||||
|
||||
include <voronoi.scad>;
|
||||
include <voronoi2d.scad>;
|
||||
include <hollow_out.scad>;
|
||||
|
||||
xs = rands(0, 40, 50);
|
||||
@ -40,8 +40,8 @@ Creats a [Voronoi diagram](https://en.wikipedia.org/wiki/Voronoi_diagram). The i
|
||||
|
||||
difference() {
|
||||
square([40, 20]);
|
||||
voronoi(points);
|
||||
voronoi2d(points);
|
||||
}
|
||||
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]];
|
||||
ys = [for(p = points) abs(p[1])];
|
||||
|
Loading…
x
Reference in New Issue
Block a user