mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 18:24:28 +02:00
remove unnecessary param
This commit is contained in:
@@ -12,13 +12,14 @@ use <__comm__/__angy_angz.scad>;
|
|||||||
|
|
||||||
// slow but workable
|
// slow but workable
|
||||||
|
|
||||||
module voronoi3d(points, space_size = "auto", spacing = 1) {
|
module voronoi3d(points, spacing = 1) {
|
||||||
xs = [for(p = points) p[0]];
|
xs = [for(p = points) p[0]];
|
||||||
ys = [for(p = points) abs(p[1])];
|
ys = [for(p = points) abs(p[1])];
|
||||||
zs = [for(p = points) abs(p[2])];
|
zs = [for(p = points) abs(p[2])];
|
||||||
|
|
||||||
space_size = max([max(xs) - min(xs), max(ys) - min(ys), max(zs) - min(zs)]);
|
space_size = max([max(xs) - min(xs), max(ys) - min(ys), max(zs) - min(zs)]);
|
||||||
half_space_size = 0.5 * space_size;
|
half_space_size = 0.5 * space_size;
|
||||||
|
double_space_size = space_size * 2;
|
||||||
offset_leng = spacing * 0.5 + half_space_size;
|
offset_leng = spacing * 0.5 + half_space_size;
|
||||||
|
|
||||||
function normalize(v) = v / norm(v);
|
function normalize(v) = v / norm(v);
|
||||||
@@ -31,7 +32,7 @@ module voronoi3d(points, space_size = "auto", spacing = 1) {
|
|||||||
|
|
||||||
translate((pt + p) / 2 - normalize(v) * offset_leng)
|
translate((pt + p) / 2 - normalize(v) * offset_leng)
|
||||||
rotate([0, -ryz[0], ryz[1]])
|
rotate([0, -ryz[0], ryz[1]])
|
||||||
cube([space_size, space_size * 2, space_size * 2], center = true);
|
cube([space_size, double_space_size, double_space_size], center = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user