mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-24 07:13:34 +02:00
refactor
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user