From dc31063b4cc0c09cfa53d80dc75ddf1bf7d1d99f Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sat, 7 Sep 2019 15:23:52 +0800 Subject: [PATCH] y twisted --- examples/twisted_maze.scad | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/twisted_maze.scad b/examples/twisted_maze.scad index f0b11f96..56722331 100644 --- a/examples/twisted_maze.scad +++ b/examples/twisted_maze.scad @@ -2,8 +2,8 @@ include ; include ; include ; -rows = 8; -columns = 16; +rows = 16; +columns = 8; block_width = 2; wall_thickness = 1; angle = 90; @@ -35,20 +35,20 @@ function maze_walls(blocks, rows, columns, block_width, left_border = true, bott , left_walls, buttom_walls ); -function x_twist(walls, angle, rows, columns, block_width) = +function y_twist(walls, angle, rows, columns, block_width) = let( - y_offset = rows * block_width / 2, - y_centered = [ + x_offset = columns * block_width / 2, + x_centered = [ for(wall_pts = walls) - [for(pt = wall_pts) [pt[0], pt[1], 0] + [0, -y_offset, 0]] + [for(pt = wall_pts) [pt[0], pt[1], 0] + [-x_offset, 0, 0]] ], - a_step = angle / columns + a_step = angle / rows ) [ - for(wall_pts = y_centered) + for(wall_pts = x_centered) [ for(pt = wall_pts) - rotate_p(pt, [pt[0] * a_step, 0, 0]) + [0, y_offset, 0] + rotate_p(pt, [0, pt[1] * a_step, 0]) + [x_offset, 0, 0] ] ]; @@ -60,6 +60,6 @@ blocks = go_maze( walls = maze_walls(blocks, rows, columns, block_width); -for(wall_pts = x_twist(walls, angle, rows, columns, block_width)) { +for(wall_pts = y_twist(walls, angle, rows, columns, block_width)) { hull_polyline3d(wall_pts, wall_thickness); } \ No newline at end of file