1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-02-24 09:33:26 +01:00

update demo

This commit is contained in:
Justin Lin 2020-02-22 16:02:03 +08:00
parent 7868b07b02
commit 53c79bf7a4

View File

@ -14,21 +14,19 @@ function default_region_size(points) =
max([(max(xs) - min(xs) / 2), (max(ys) - min(ys)) / 2]); max([(max(xs) - min(xs) / 2), (max(ys) - min(ys)) / 2]);
size = default_region_size(points); size = default_region_size(points);
region_shape = shape_square(size, corner_r = size / 5); region_shape = shape_square(size, corner_r = size / 10);
cells = voronoi_cells(points, region_shape); cells = voronoi_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];
c = rands(0, 1, 3);
hull_polyline2d(concat(cell, [cell[0]]), width = .5); linear_extrude(1)
hull_polyline2d(concat(cell, [cell[0]]), width = 1);
color(c) color(rands(0, 1, 3))
translate(pt) translate(pt)
sphere(1); linear_extrude(2, scale = 0.8)
translate(-pt)
color(c)
offset(-0.1)
polygon(cell); polygon(cell);
} }