mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-29 17:30:11 +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 = 8;
|
maze_rows = 8;
|
||||||
block_width = 10;
|
block_width = 10;
|
||||||
@@ -30,12 +31,13 @@ module pyramid_with_stairs(base_width, stairs_width, rows) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module step_pyramid_maze(maze_rows, block_width, stairs_width) {
|
module step_pyramid_maze(maze_rows, block_width, stairs_width) {
|
||||||
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);
|
||||||
|
|
||||||
intersection() {
|
intersection() {
|
||||||
pyramid_with_stairs(
|
pyramid_with_stairs(
|
||||||
maze_rows * block_width, stairs_width, maze_rows);
|
maze_rows * block_width, stairs_width, maze_rows);
|
||||||
@@ -46,13 +48,14 @@ module step_pyramid_maze(maze_rows, block_width, stairs_width) {
|
|||||||
|
|
||||||
translate([-(maze_rows * block_width) / 2, -(maze_rows * block_width) / 2, 0])
|
translate([-(maze_rows * block_width) / 2, -(maze_rows * block_width) / 2, 0])
|
||||||
difference() {
|
difference() {
|
||||||
build_square_maze(
|
for(wall = walls) {
|
||||||
maze_rows,
|
for(i = [0:len(wall) - 2]) {
|
||||||
maze_rows,
|
hull() {
|
||||||
maze_blocks,
|
translate(wall[i]) square(stairs_width, center = true);
|
||||||
block_width,
|
translate(wall[i + 1]) square(stairs_width, center = true);
|
||||||
stairs_width
|
}
|
||||||
);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// entry
|
// entry
|
||||||
translate([0, stairs_width])
|
translate([0, stairs_width])
|
||||||
|
Reference in New Issue
Block a user