From 57ec3f46ef2a80068b82d85cc20e7b237007a1bf Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Tue, 5 Apr 2022 11:52:37 +0800 Subject: [PATCH] del --- src/experimental/rand_pts_circle.scad | 25 ------------------ src/experimental/rand_pts_sphere.scad | 37 --------------------------- 2 files changed, 62 deletions(-) delete mode 100644 src/experimental/rand_pts_circle.scad delete mode 100644 src/experimental/rand_pts_sphere.scad diff --git a/src/experimental/rand_pts_circle.scad b/src/experimental/rand_pts_circle.scad deleted file mode 100644 index 1db729f0..00000000 --- a/src/experimental/rand_pts_circle.scad +++ /dev/null @@ -1,25 +0,0 @@ -function rand_pts_circle(radius, value_count, seed = undef) = - let( - seed_undef = is_undef(seed), - theta = seed_undef ? rands(0, 360, value_count * 2) : rands(0, 360, value_count * 2, seed), - k = seed_undef ? rands(0, 1, value_count * 2) : rands(0, 1, value_count * 2, seed) - - ) - [ - for(i = [0:value_count - 1]) - let(r = sqrt(k[i]) * radius) - [cos(theta[i]), sin(theta[i])] * r - ]; - -/* -number = 10000; -radius = 2; - -points = rand_pts_circle(radius, number); - -for(p = points) { - translate(p) - circle(.01); -} - -%circle(radius, $fn = 96);*/ \ No newline at end of file diff --git a/src/experimental/rand_pts_sphere.scad b/src/experimental/rand_pts_sphere.scad deleted file mode 100644 index 7f2b153a..00000000 --- a/src/experimental/rand_pts_sphere.scad +++ /dev/null @@ -1,37 +0,0 @@ -use ; - -function rand_pts_sphere(radius, value_count, seed = undef) = - let(r_nums = is_undef(seed) ? rands(0, 1, value_count * 2) : rands(0, 1, value_count * 2, seed)) - [ - for(i = [0:value_count - 1]) - let( - theta = degrees(2 * PI * r_nums[i]), - phi = acos(r_nums[i + value_count] * 2 - 1), - sin_phi = sin(phi), - x = sin_phi * cos(theta), - y = sin_phi * sin(theta), - z = cos(phi) - ) - [x, y, z] - ] * radius; - -/* - -use ; -use ; - -number = 20; -radius = 2; - -points = rand_pts_sphere(radius, number); - -polyhedron_hull(points); - -for(p = points) { - translate(p) - sphere(.05); -} - -%sphere(radius, $fn = 48); - -*/ \ No newline at end of file