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

24 lines
601 B
OpenSCAD
Raw Normal View History

2022-06-06 13:11:46 +08:00
use <polyline_join.scad>
use <maze/mz_square.scad>
use <maze/mz_squarewalls.scad>
use <ptf/ptf_x_twist.scad>
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;
cells = mz_square(rows, columns);
2020-02-16 14:07:07 +08:00
walls = mz_squarewalls(cells, 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
}