2021-07-30 11:06:47 +08:00
|
|
|
use <experimental/tile_truchet.scad>;
|
2021-10-08 09:36:01 +08:00
|
|
|
use <polyline_join.scad>;
|
2020-03-24 17:12:21 +08:00
|
|
|
use <ptf/ptf_ring.scad>;
|
2020-02-13 17:40:44 +08:00
|
|
|
|
2020-02-15 21:09:26 +08:00
|
|
|
size = [20, 100];
|
2021-02-18 10:45:44 +08:00
|
|
|
line_diameter = 1;
|
2020-02-15 21:09:26 +08:00
|
|
|
twist = 180;
|
|
|
|
$fn = 8;
|
|
|
|
|
2021-07-30 11:06:47 +08:00
|
|
|
module tiled_line_mobius(size, twist, line_diameter = 1) {
|
2020-02-13 17:40:44 +08:00
|
|
|
lines = concat(
|
|
|
|
[
|
2021-07-30 11:06:47 +08:00
|
|
|
for(tile = tile_truchet(size))
|
|
|
|
let(
|
|
|
|
x = tile[0],
|
|
|
|
y = tile[1],
|
|
|
|
i = tile[2]
|
|
|
|
)
|
|
|
|
i <= 1 ? [[x, y], [x + 1, y + 1]] : [[x + 1, y], [x, y + 1]]
|
2020-02-13 17:40:44 +08:00
|
|
|
],
|
|
|
|
[
|
2021-07-30 11:06:47 +08:00
|
|
|
for(i = [0:size[1] - 1])
|
|
|
|
[[0, i], [0, i + 1]]
|
2020-02-13 17:40:44 +08:00
|
|
|
],
|
|
|
|
[
|
2021-07-30 11:06:47 +08:00
|
|
|
for(i = [0:size[1] - 1])
|
|
|
|
[[size[0], i], [size[0], i + 1]]
|
2020-02-13 17:40:44 +08:00
|
|
|
]
|
|
|
|
);
|
2020-02-13 20:56:00 +08:00
|
|
|
|
2021-10-08 09:36:01 +08:00
|
|
|
half_line_diameter = line_diameter / 2;
|
2020-02-13 17:40:44 +08:00
|
|
|
for(line = lines) {
|
2020-02-24 10:10:51 +08:00
|
|
|
pts = [for(p = line) ptf_ring(size, p, size[0], twist = twist)];
|
2021-10-08 09:36:01 +08:00
|
|
|
polyline_join(pts) sphere(half_line_diameter);
|
2020-02-13 17:40:44 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-30 11:06:47 +08:00
|
|
|
tiled_line_mobius(size, twist, line_diameter);
|