1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/examples/voronoi/voronoi_holder.scad

40 lines
999 B
OpenSCAD
Raw Normal View History

2022-06-06 13:11:46 +08:00
use <bend_extrude.scad>
use <arc.scad>
use <voronoi/vrn2_cells_space.scad>
2020-06-21 15:34:58 +08:00
size = [200, 72];
grid_w = 8; // grid_w must divide size equally.
thickness = 2;
spacing = 1.5;
frags = 24;
module voronoi_holder() {
half_spacing = spacing / 2;
cells = vrn2_cells_space(
size = size,
grid_w = grid_w
);
r = size[0] / (2 * PI) - thickness * 1.5;
difference() {
bend_extrude(size = size, thickness = thickness * 3, angle = 360, frags = frags)
difference() {
square(size);
2022-04-06 17:02:32 +08:00
for(cell = cells) {
offset(-half_spacing)
2020-06-21 15:34:58 +08:00
polygon(cell[1]);
2022-04-06 17:02:32 +08:00
}
2020-06-21 15:34:58 +08:00
}
linear_extrude(size[1] - thickness)
arc(radius = r, angle = 360, width = thickness, $fn = frags);
}
linear_extrude(thickness)
circle(r + thickness * 1.75, $fn = frags);
linear_extrude(thickness * 2)
circle(r - 0.25 * thickness, $fn = frags);
}
voronoi_holder();