1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/examples/tiles/tiled_line_torus.scad
Justin Lin 5399224ff0 move
2021-07-30 11:02:55 +08:00

31 lines
763 B
OpenSCAD

use <experimental/tile_truchet.scad>;
use <hull_polyline3d.scad>;
use <ptf/ptf_torus.scad>;
size = [20, 50];
line_diameter = 1;
twist = 180;
$fn = 4;
module tiled_line_torus(size, twist, line_diameter = 1) {
lines = [
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]]
];
for(line = lines) {
pts = [for(p = line) ptf_torus(size, p, [size[0], size[0] / 2], twist = twist)];
hull_polyline3d(pts, diameter = line_diameter);
}
}
tiled_line_torus(size, twist, line_diameter);
color("black")
rotate_extrude($fn = 36)
translate([size[0] * 1.5, 0, 0])
circle(size[0] / 2);