mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-10 00:36:40 +02:00
add space_type parameter
This commit is contained in:
@@ -2,7 +2,7 @@ include <__private__/__angy_angz.scad>;
|
||||
|
||||
// slow but workable
|
||||
|
||||
module voronoi3d(points, spacing = 1) {
|
||||
module voronoi3d(points, spacing = 1, space_type = "cube") {
|
||||
xs = [for(p = points) p[0]];
|
||||
ys = [for(p = points) abs(p[1])];
|
||||
zs = [for(p = points) abs(p[2])];
|
||||
@@ -21,7 +21,12 @@ module voronoi3d(points, spacing = 1) {
|
||||
|
||||
translate((pt + p) / 2 - normalize(v) * offset_leng)
|
||||
rotate([0, -ryz[0], ryz[1]])
|
||||
if(space_type == "cube") {
|
||||
cube(space_size, center = true);
|
||||
}
|
||||
else if(space_type == "sphere") {
|
||||
cube(half_space_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user