1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-30 01:40:02 +02:00

refactor: use new maze functions/modules

This commit is contained in:
Justin Lin
2022-03-27 12:24:34 +08:00
parent 15478290e1
commit 9f3ecd0b3c
19 changed files with 93 additions and 117 deletions

View File

@@ -1,6 +1,6 @@
use <line2d.scad>;
use <hollow_out.scad>;
use <maze/mz_square_cells.scad>;
use <maze/mz_square.scad>;
use <maze/mz_square_get.scad>;
// only for creating a small maze
@@ -49,9 +49,7 @@ module regular_polygon_maze(radius, ccells, levels, thickness = 1, sides) {
arc_angle = 360 / ccells;
r = radius / (levels + 1);
cells = mz_square_cells(
ccells, levels, y_wrapping = true
);
cells = mz_square(ccells, levels, y_wrapping = true);
difference() {
render() union() {
@@ -60,8 +58,7 @@ module regular_polygon_maze(radius, ccells, levels, thickness = 1, sides) {
}
for(i = [0:len(cells) - 1]) {
cell = cells[i];
for(row = cells, cell = row) {
cr = get_x(cell) + 1;
cc = get_y(cell);
@@ -78,8 +75,7 @@ module regular_polygon_maze(radius, ccells, levels, thickness = 1, sides) {
// ring_regular_polygon_sector(r, arc_angle / 1.975 , thickness, r / 3, sides);
// road to the next level
for(i = [0:len(cells) - 1]) {
cell = cells[i];
for(row = cells, cell = row) {
cr = get_x(cell) + 1;
cc = get_y(cell);