mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-20 13:31:30 +02:00
refactor
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use <hull_polyline3d.scad>;
|
||||
use <rotate_p.scad>;
|
||||
use <square_maze.scad>;
|
||||
use <experimental/tf_y_twist.scad>;
|
||||
|
||||
rows = 16;
|
||||
columns = 8;
|
||||
@@ -9,23 +10,11 @@ wall_thickness = 1;
|
||||
angle = 180;
|
||||
// $fn = 24;
|
||||
|
||||
function tf_twist(size, p, ) =
|
||||
|
||||
function y_twist(walls, angle, rows, columns, block_width) =
|
||||
let(
|
||||
x_offset = columns * block_width / 2,
|
||||
x_centered = [
|
||||
let(size = [columns * block_width, rows * block_width])
|
||||
[
|
||||
for(wall_pts = walls)
|
||||
[for(pt = wall_pts) [pt[0], pt[1], 0] + [-x_offset, 0, 0]]
|
||||
],
|
||||
a_step = angle / (rows * block_width)
|
||||
)
|
||||
[
|
||||
for(wall_pts = x_centered)
|
||||
[
|
||||
for(pt = wall_pts)
|
||||
rotate_p(pt, [0, pt[1] * a_step, 0]) + [x_offset, 0, 0]
|
||||
]
|
||||
[for(pt = wall_pts) tf_y_twist(size, pt, angle)]
|
||||
];
|
||||
|
||||
blocks = go_maze(
|
||||
|
Reference in New Issue
Block a user