1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-24 07:13:34 +02:00
This commit is contained in:
Justin Lin
2020-02-16 16:34:30 +08:00
parent 246a3a3d84
commit 2b336e881a

View File

@@ -1,4 +1,5 @@
use <square_maze.scad>; use <experimental/mz_blocks.scad>;
use <experimental/mz_walls.scad>;
maze_rows = 10; maze_rows = 10;
block_width = 2; block_width = 2;
@@ -11,24 +12,27 @@ module pyramid_maze(maze_rows, block_width, wall_thickness) {
square(leng, center = true); square(leng, center = true);
} }
maze_blocks = go_maze( blocks = mz_blocks(
1, 1, // starting point [1, 1],
starting_maze(maze_rows, maze_rows),
maze_rows, maze_rows maze_rows, maze_rows
); );
walls = mz_walls(blocks, maze_rows, maze_rows, block_width);
leng = maze_rows * block_width ; leng = maze_rows * block_width ;
half_leng = leng / 2; half_leng = leng / 2;
intersection() { intersection() {
linear_extrude(leng * 2) linear_extrude(leng * 2)
translate([-half_leng, -half_leng]) build_square_maze( translate([-half_leng, -half_leng])
maze_rows, for(wall = walls) {
maze_rows, for(i = [0:len(wall) - 2]) {
maze_blocks, hull() {
block_width, translate(wall[i]) square(wall_thickness, center = true);
wall_thickness translate(wall[i + 1]) square(wall_thickness, center = true);
); }
}
}
pyramid(leng + wall_thickness); pyramid(leng + wall_thickness);
} }