diff --git a/examples/maze/maze_city.scad b/examples/maze/maze_city.scad index 3118443f..47c2d029 100644 --- a/examples/maze/maze_city.scad +++ b/examples/maze/maze_city.scad @@ -1,6 +1,6 @@ use use -use +use use use <../tiles/city_tile.scad> @@ -18,7 +18,7 @@ module maze_city(rows, columns, skyscraper_prs) { cells = mz_square(rows, columns, [0, 0], init_cells = mz_square_initialize(rows, columns, mask)); - tiles = mz_wang_tiles(cells); + tiles = mz_tiles(cells); tile_width = 30; for(tile = tiles) { diff --git a/src/experimental/note.md b/src/experimental/note.md index 0da47583..25421a07 100644 --- a/src/experimental/note.md +++ b/src/experimental/note.md @@ -6,7 +6,7 @@ new: - triangle/tri_subdivide -- maze/mz_wang_tiles? +- maze/mz_tiles? - mz_hamiltonian supports init_cells diff --git a/src/maze/_impl/_mz_wang_tiles_impl.scad b/src/maze/_impl/_mz_tiles_impl.scad similarity index 82% rename from src/maze/_impl/_mz_wang_tiles_impl.scad rename to src/maze/_impl/_mz_tiles_impl.scad index 85f8762e..4d3fe4fe 100644 --- a/src/maze/_impl/_mz_wang_tiles_impl.scad +++ b/src/maze/_impl/_mz_tiles_impl.scad @@ -2,21 +2,21 @@ use <../../util/set/hashset_has.scad> include <../../__comm__/_pt2_hash.scad> -function _mz_wang_tiles_top(x, y) = +function _mz_tiles_top(x, y) = let( nx = x * 2, ny = y * 2 ) [[nx + 1, ny + 2]]; -function _mz_wang_tiles_right(x, y) = +function _mz_tiles_right(x, y) = let( nx = x * 2, ny = y * 2 ) [[nx + 2, ny + 1]]; -function _mz_wang_tiles_top_right(x, y) = +function _mz_tiles_top_right(x, y) = let( nx = x * 2, ny = y * 2 @@ -24,7 +24,7 @@ function _mz_wang_tiles_top_right(x, y) = [[nx + 1, ny + 2], [nx + 2, ny + 1]]; hash = function(p) _pt2_hash(p); -function _mz_wang_tile_type(dots, x, y) = +function _mz_tile_type(dots, x, y) = let( px = x * 2 + 1, py = y * 2 + 1, diff --git a/src/maze/mz_wang_tiles.scad b/src/maze/mz_tiles.scad similarity index 75% rename from src/maze/mz_wang_tiles.scad rename to src/maze/mz_tiles.scad index 520ecb2e..9195e570 100644 --- a/src/maze/mz_wang_tiles.scad +++ b/src/maze/mz_tiles.scad @@ -1,20 +1,20 @@ /** -* mz_wang_tiles.scad +* mz_tiles.scad * * @copyright Justin Lin, 2020 * @license https://opensource.org/licenses/lgpl-3.0.html * -* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_wang_tiles.html +* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-mz_tiles.html * **/ -use <_impl/_mz_wang_tiles_impl.scad> +use <_impl/_mz_tiles_impl.scad> use use <../util/set/hashset.scad> include <../__comm__/_pt2_hash.scad> -function mz_wang_tiles(cells, left_border = true, bottom_border = true) = +function mz_tiles(cells, left_border = true, bottom_border = true) = let( rows = len(cells), columns = len(cells[0]), @@ -27,9 +27,9 @@ function mz_wang_tiles(cells, left_border = true, bottom_border = true) = x = cell.x, y = cell.y, type = mz_square_get(cell, "t"), - pts = type == "TOP_WALL" ? _mz_wang_tiles_top(x, y) : - type == "RIGHT_WALL" ? _mz_wang_tiles_right(x, y) : - type == "TOP_RIGHT_WALL" || type == "MASK" ? _mz_wang_tiles_top_right(x, y) : [] + pts = type == "TOP_WALL" ? _mz_tiles_top(x, y) : + type == "RIGHT_WALL" ? _mz_tiles_right(x, y) : + type == "TOP_RIGHT_WALL" || type == "MASK" ? _mz_tiles_top_right(x, y) : [] ) each pts ], @@ -48,5 +48,5 @@ function mz_wang_tiles(cells, left_border = true, bottom_border = true) = ) [ for(y = [0:rows - 1], x = [0:columns - 1]) - [x, y, _mz_wang_tile_type(dot_pts, x, y)] + [x, y, _mz_tile_type(dot_pts, x, y)] ]; \ No newline at end of file