From c57ae76941ad33c2f3a7524461432d83a0aa0dc5 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Mon, 2 Mar 2020 16:10:37 +0800 Subject: [PATCH] update demo --- src/experimental/demo/voronoi_lines_demo.scad | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/experimental/demo/voronoi_lines_demo.scad b/src/experimental/demo/voronoi_lines_demo.scad index bbd59973..7a8a55dd 100644 --- a/src/experimental/demo/voronoi_lines_demo.scad +++ b/src/experimental/demo/voronoi_lines_demo.scad @@ -1,14 +1,28 @@ use ; use ; +use ; pt_nums = 50; width = 1; points = [for(i = [0:pt_nums - 1]) rands(-50, 50, 2)]; - -for(line = voronoi_lines(points)) { - hull_polyline2d( - line, - width = width, - $fn = 4 - ); -} \ No newline at end of file + +intersection() { + for(line = voronoi_lines(points)) { + hull_polyline2d( + line, + width = width, + $fn = 4 + ); + } + hull() + #for(p = points) { + translate(p) + circle(.5); + } +} + +hull_pts = convex_hull(points); +hull_polyline2d( + concat(hull_pts, [hull_pts[0]]), + width = width, $fn = 4 +); \ No newline at end of file