1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/examples/tiles/hitomezashi_stitching.scad
2022-06-06 13:11:46 +08:00

37 lines
758 B
OpenSCAD

use <line2d.scad>
use <experimental/tile_hitomezashi.scad>
use <select.scad>
size = [50, 25];
tile_width = 5;
line_width = 1;
for(tile = tile_hitomezashi(size)) {
translate([tile.x, tile.y] * tile_width)
select(tile[2]) {
tile00(tile_width, line_width);
tile01(tile_width, line_width);
tile02(tile_width, line_width);
tile03(tile_width, line_width);
};
}
module tile00(tile_width, line_width) {
// nope
}
// _
module tile01(tile_width, line_width) {
line2d([0, 0], [tile_width, 0], line_width);
}
// |_
module tile02(tile_width, line_width) {
line2d([0, 0], [0, tile_width], line_width);
}
// |
module tile03(tile_width, line_width) {
line2d([0, 0], [0, tile_width], line_width);
line2d([0, 0], [tile_width, 0], line_width);
}