1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/examples/tiles/hitomezashi_stitching.scad

41 lines
853 B
OpenSCAD
Raw Normal View History

2021-07-31 15:25:19 +08:00
use <line2d.scad>;
use <experimental/tile_hitomezashi.scad>;
2021-07-31 16:16:58 +08:00
use <experimental/select.scad>;
2021-07-31 15:25:19 +08:00
size = [50, 25];
tile_width = 5;
line_width = 1;
for(tile = tile_hitomezashi(size)) {
x = tile[0];
y = tile[1];
i = tile[2];
2021-07-31 16:16:58 +08:00
translate([x, y] * tile_width)
select(i) {
2021-07-31 15:25:19 +08:00
tile00(x, y, tile_width, line_width);
tile01(x, y, tile_width, line_width);
tile02(x, y, tile_width, line_width);
tile03(x, y, tile_width, line_width);
};
}
module tile00(x, y, tile_width, line_width) {
// nope
}
// _
module tile01(x, y, tile_width, line_width) {
2021-07-31 16:16:58 +08:00
line2d([0, 0], [tile_width, 0], line_width);
2021-07-31 15:25:19 +08:00
}
// |_
module tile02(x, y, tile_width, line_width) {
2021-07-31 16:16:58 +08:00
line2d([0, 0], [0, tile_width], line_width);
2021-07-31 15:25:19 +08:00
}
// |
module tile03(x, y, tile_width, line_width) {
2021-07-31 16:16:58 +08:00
line2d([0, 0], [0, tile_width], line_width);
line2d([0, 0], [tile_width, 0], line_width);
2021-07-31 15:25:19 +08:00
}