1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-15 03:05:41 +02:00
This commit is contained in:
Justin Lin
2020-02-22 20:44:40 +08:00
parent 53c79bf7a4
commit aee7794fd2
3 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
use <hull_polyline2d.scad>; use <hull_polyline2d.scad>;
use <shape_square.scad>; use <shape_square.scad>;
use <experimental/voronoi_cells.scad>; use <experimental/voronoi2d_cells.scad>;
xs1 = rands(-20, 20, 15); xs1 = rands(-20, 20, 15);
ys1 = rands(-20, 20, 15); ys1 = rands(-20, 20, 15);
@@ -16,7 +16,7 @@ function default_region_size(points) =
size = default_region_size(points); size = default_region_size(points);
region_shape = shape_square(size, corner_r = size / 10); region_shape = shape_square(size, corner_r = size / 10);
cells = voronoi_cells(points, region_shape); cells = voronoi2d_cells(points, region_shape);
for(i = [0:len(points) - 1]) { for(i = [0:len(points) - 1]) {
pt = points[i]; pt = points[i];
cell = cells[i]; cell = cells[i];

View File

@@ -1,7 +1,7 @@
use <experimental/_impl/_voronoi_cells_impl.scad>; use <experimental/_impl/_voronoi2d_cells_impl.scad>;
use <experimental/convex_intersection_for.scad>; use <experimental/convex_intersection_for.scad>;
function voronoi_cells(points, region_shape) = function voronoi2d_cells(points, region_shape) =
let( let(
size = _default_region_size(points), size = _default_region_size(points),
shape = is_undef(region_shape) ? shape_square(size) : region_shape, shape = is_undef(region_shape) ? shape_square(size) : region_shape,