1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/examples/maze/twisted_maze.scad

26 lines
641 B
OpenSCAD
Raw Normal View History

2021-10-08 09:36:01 +08:00
use <polyline_join.scad>;
2020-12-20 10:49:16 +08:00
use <maze/mz_square_cells.scad>;
2020-10-01 11:59:03 +08:00
use <maze/mz_square_walls.scad>;
2020-03-25 17:41:04 +08:00
use <ptf/ptf_x_twist.scad>;
2020-03-24 17:12:21 +08:00
use <ptf/ptf_y_twist.scad>;
2019-09-07 10:35:15 +08:00
2020-03-25 17:41:04 +08:00
rows = 10;
columns = 10;
2020-12-20 10:49:16 +08:00
cell_width = 4;
2021-02-18 10:45:44 +08:00
line_diameter = 1;
2020-03-25 17:41:04 +08:00
angle = 90;
axis = "X_AXIS"; // [X_AXIS, Y_AXIS]
2019-09-07 10:35:15 +08:00
// $fn = 24;
2020-12-20 10:49:16 +08:00
cells = mz_square_cells(
2019-09-07 10:35:15 +08:00
rows, columns
);
2020-02-16 14:07:07 +08:00
2020-12-20 10:49:16 +08:00
walls = mz_square_walls(cells, rows, columns, cell_width);
2020-02-13 14:14:47 +08:00
2020-12-20 10:49:16 +08:00
size = [columns * cell_width, rows * cell_width];
2020-02-13 14:14:47 +08:00
for(wall_pts = walls) {
2020-03-25 17:41:04 +08:00
transformed = [for(pt = wall_pts) axis == "X_AXIS" ? ptf_x_twist(size, pt, angle) : ptf_y_twist(size, pt, angle)];
2021-10-08 09:36:01 +08:00
polyline_join(transformed)
sphere(d = line_diameter);
2019-09-07 10:35:15 +08:00
}