1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-18 12:31:17 +02:00
This commit is contained in:
Justin Lin
2020-02-26 16:20:20 +08:00
parent 2448fe26d9
commit cf1c8c71ab
2 changed files with 32 additions and 31 deletions

View File

@@ -1,7 +1,6 @@
use <hull_polyline3d.scad>;
use <util/rand.scad>;
use <experimental/tri_bisectors.scad>;
use <experimental/ptf_bend.scad>;
use <hollow_out_square.scad>;
width = 5;
columns = 30;
@@ -10,35 +9,6 @@ radius = 30;
angle = 360;
thickness = 2;
function h_lines_in_square(width) =
let(
w = width / 2,
i = ceil(rand() * 10) % 2,
tris = i == 0 ?
[
[[0, 0], [width, 0], [width, width]],
[[0, 0], [width, width], [0, width]]
]
:
[
[[width, 0], [0, width], [0, 0]],
[[width, 0], [width, width], [0, width]]
]
)
concat(tri_bisectors(tris[0]), tri_bisectors(tris[1]));
function hollow_out_square(size, width) =
let(
columns = size[0],
rows = size[1]
)
[
for(y = [0:width:width * rows - width])
for(x = [0:width:width * columns - width])
for(line = h_lines_in_square(width))
[for(p = line) p + [x, y]]
];
lines = concat(
hollow_out_square([columns, rows], width),
[[

View File

@@ -0,0 +1,31 @@
use <util/rand.scad>;
use <experimental/tri_bisectors.scad>;
function h_lines_in_square(width) =
let(
w = width / 2,
i = ceil(rand() * 10) % 2,
tris = i == 0 ?
[
[[0, 0], [width, 0], [width, width]],
[[0, 0], [width, width], [0, width]]
]
:
[
[[width, 0], [0, width], [0, 0]],
[[width, 0], [width, width], [0, width]]
]
)
concat(tri_bisectors(tris[0]), tri_bisectors(tris[1]));
function hollow_out_square(size, width) =
let(
columns = size[0],
rows = size[1]
)
[
for(y = [0:width:width * rows - width])
for(x = [0:width:width * columns - width])
for(line = h_lines_in_square(width))
[for(p = line) p + [x, y]]
];