mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-05 06:17:32 +02:00
use rand_pts_sphere
This commit is contained in:
@@ -1,28 +1,17 @@
|
|||||||
use <voronoi/vrn_sphere.scad>;
|
use <voronoi/vrn_sphere.scad>;
|
||||||
use <polyline_join.scad>;
|
use <polyline_join.scad>;
|
||||||
use <experimental/convex_center_p.scad>;
|
|
||||||
use <sweep.scad>;
|
use <sweep.scad>;
|
||||||
use <fibonacci_lattice.scad>;
|
use <fibonacci_lattice.scad>;
|
||||||
|
use <experimental/convex_center_p.scad>;
|
||||||
|
use <experimental/rand_pts_sphere.scad>;
|
||||||
|
|
||||||
n = 60;
|
n = 60;
|
||||||
radius = 5;
|
radius = 5;
|
||||||
|
|
||||||
// pts = fibonacci_lattice(n, radius);
|
// pts = fibonacci_lattice(n, radius);
|
||||||
pts = [
|
pts = rand_pts_sphere(radius, n);
|
||||||
for(i = [0:n])
|
|
||||||
let(
|
|
||||||
theta = rands(0, 360, 1)[0],
|
|
||||||
phi = rands(15, 165, 1)[0],
|
|
||||||
rs = radius * sin(phi)
|
|
||||||
)
|
|
||||||
[
|
|
||||||
rs * cos(theta),
|
|
||||||
rs * sin(theta),
|
|
||||||
radius * cos(phi)
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
region_hollow = false;
|
region_hollow = true;
|
||||||
region_offset = 0.2;
|
region_offset = 0.2;
|
||||||
region_height = 1;
|
region_height = 1;
|
||||||
|
|
||||||
@@ -72,6 +61,6 @@ module voronoi_sphere(pts, region_hollow, region_offset, region_height) {
|
|||||||
|
|
||||||
|
|
||||||
polyline_join(concat(cell, [cell[0]]))
|
polyline_join(concat(cell, [cell[0]]))
|
||||||
sphere(region_offset / 2, $fn = 4);
|
sphere(region_offset / 2, $fn = 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user