1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 09:44:16 +02:00

refactor: extract lines

This commit is contained in:
Justin Lin
2022-04-04 15:35:21 +08:00
parent f76fd33054
commit 438e9cfd93

View File

@@ -21,12 +21,11 @@ function h_lines_in_square(width) =
function hollow_out_square(size, width) = function hollow_out_square(size, width) =
let( let(
columns = size[0], columns = size[0],
rows = size[1] rows = size[1],
lines = h_lines_in_square(width)
) )
[ [
for(y = [0:width:width * rows - width], for(y = [0:width:width * rows - width], x = [0:width:width * columns - width])
x = [0:width:width * columns - width], let(coord = [x, y])
line = h_lines_in_square(width) for(line = lines) [for(p = line) p + coord]
)
[for(p = line) p + [x, y]]
]; ];