2020-02-16 16:54:43 +08:00
|
|
|
use <square_maze.scad>;
|
2019-09-10 13:24:10 +08:00
|
|
|
|
|
|
|
maze_rows = 10;
|
|
|
|
block_width = 2;
|
|
|
|
wall_thickness = 1;
|
|
|
|
|
|
|
|
module pyramid_maze(maze_rows, block_width, wall_thickness) {
|
|
|
|
module pyramid(leng) {
|
|
|
|
height = leng / 1.4142135623730950488016887242097;
|
2019-09-10 13:30:48 +08:00
|
|
|
linear_extrude(height, scale = 0)
|
|
|
|
square(leng, center = true);
|
2019-09-10 13:24:10 +08:00
|
|
|
}
|
2020-02-16 16:34:30 +08:00
|
|
|
|
2019-09-10 13:24:10 +08:00
|
|
|
leng = maze_rows * block_width ;
|
|
|
|
half_leng = leng / 2;
|
2019-09-10 13:30:48 +08:00
|
|
|
|
2019-09-10 13:24:10 +08:00
|
|
|
intersection() {
|
2019-09-10 13:30:48 +08:00
|
|
|
linear_extrude(leng * 2)
|
2020-02-16 16:34:30 +08:00
|
|
|
translate([-half_leng, -half_leng])
|
2020-02-16 16:54:43 +08:00
|
|
|
square_maze([1, 1], maze_rows, block_width, wall_thickness);
|
|
|
|
|
2019-09-10 13:24:10 +08:00
|
|
|
pyramid(leng + wall_thickness);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pyramid_maze(maze_rows, block_width, wall_thickness);
|