mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-26 07:55:16 +02:00
add convext_hull
This commit is contained in:
14
src/experimental/demo/convex_hull_demo.scad
Normal file
14
src/experimental/demo/convex_hull_demo.scad
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
use <experimental/tri_bisectors.scad>;
|
||||||
|
use <experimental/convex_hull.scad>;
|
||||||
|
use <shape_starburst.scad>;
|
||||||
|
|
||||||
|
xs = rands(-20, 20, 150);
|
||||||
|
ys = rands(-20, 20, 150);
|
||||||
|
points = [for(i = [0:len(xs) - 1]) [xs[i], ys[i]]];
|
||||||
|
|
||||||
|
for(p = points) {
|
||||||
|
translate(p)
|
||||||
|
sphere(.5);
|
||||||
|
}
|
||||||
|
hull_shape = convex_hull(points);
|
||||||
|
#hull_polyline2d(concat(hull_shape, [hull_shape[0]]), width = 1);
|
Reference in New Issue
Block a user