mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-15 03:05:41 +02:00
printable?
This commit is contained in:
@@ -3,27 +3,26 @@ use <experimental/mz_hamiltonian.scad>;
|
|||||||
module senbon_torii(rows, columns, start, width, height) {
|
module senbon_torii(rows, columns, start, width, height) {
|
||||||
line = mz_hamiltonian(rows, columns, start);
|
line = mz_hamiltonian(rows, columns, start);
|
||||||
leng = len(line);
|
leng = len(line);
|
||||||
|
min_h = 0.1;
|
||||||
|
|
||||||
// first torii
|
// first torii
|
||||||
fst = line[0];
|
fst = line[0];
|
||||||
snd = line[1];
|
snd = line[1];
|
||||||
|
|
||||||
translate(fst)
|
translate([fst[0], fst[1], min_h])
|
||||||
rotate([90, 0, atan2(snd[0] - fst[0], snd[1] - fst[1])])
|
rotate([90, 0, atan2(snd[0] - fst[0], snd[1] - fst[1])])
|
||||||
translate([0, .175])
|
|
||||||
children(0);
|
children(0);
|
||||||
|
|
||||||
module middle_torii(i) {
|
module middle_torii(i) {
|
||||||
p1 = line[i];
|
p1 = line[i];
|
||||||
p2 = line[i + 1];
|
p2 = line[i + 1];
|
||||||
md = (p1 + p2) / 2;
|
md = (p1 + p2) / 2;
|
||||||
h = i * height + 0.1;
|
h = i * height + min_h;
|
||||||
|
|
||||||
a1 = atan2(p2[0] - p1[0], p2[1] - p1[1]);
|
a1 = atan2(p2[0] - p1[0], p2[1] - p1[1]);
|
||||||
|
|
||||||
translate([md[0], md[1], h])
|
translate([md[0], md[1], h + height / 2])
|
||||||
rotate([90, 0, a1])
|
rotate([90, 0, a1])
|
||||||
translate([0, .1])
|
|
||||||
children(0);
|
children(0);
|
||||||
|
|
||||||
// road
|
// road
|
||||||
@@ -33,7 +32,7 @@ module senbon_torii(rows, columns, start, width, height) {
|
|||||||
square(width, center = true);
|
square(width, center = true);
|
||||||
|
|
||||||
translate(p2)
|
translate(p2)
|
||||||
linear_extrude((i + 1) * height + 0.1)
|
linear_extrude((i + 1) * height + min_h)
|
||||||
square(width, center = true);
|
square(width, center = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,13 +49,12 @@ module senbon_torii(rows, columns, start, width, height) {
|
|||||||
p0 = line[i - 1];
|
p0 = line[i - 1];
|
||||||
p1 = line[i];
|
p1 = line[i];
|
||||||
p2 = line[i + 1];
|
p2 = line[i + 1];
|
||||||
h = i * height + 0.1;
|
h = i * height + min_h;
|
||||||
|
|
||||||
a1 = atan2(p2[0] - p1[0], p2[1] - p1[1]);
|
a1 = atan2(p2[0] - p1[0], p2[1] - p1[1]);
|
||||||
a2 = atan2(p1[0] - p0[0], p1[1] - p0[1]);
|
a2 = atan2(p1[0] - p0[0], p1[1] - p0[1]);
|
||||||
translate([p1[0], p1[1], h - width * 0.233333])
|
translate([p1[0], p1[1], h])
|
||||||
rotate([90, 0, a1 + (a1 - a2) / 2])
|
rotate([90, 0, a1 + (a1 - a2) / 2])
|
||||||
translate([0, .2])
|
|
||||||
children(0);
|
children(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,28 +63,42 @@ module senbon_torii(rows, columns, start, width, height) {
|
|||||||
pre_lst = line[leng - 2];
|
pre_lst = line[leng - 2];
|
||||||
la = atan2(lst[0] - pre_lst[0], lst[1] - pre_lst[1]);
|
la = atan2(lst[0] - pre_lst[0], lst[1] - pre_lst[1]);
|
||||||
|
|
||||||
translate([lst[0], lst[1], (leng - 1) * height])
|
translate([lst[0], lst[1], (leng - 1) * height + min_h])
|
||||||
rotate([90, 0, la])
|
rotate([90, 0, la])
|
||||||
translate([0, .175])
|
|
||||||
children(1);
|
children(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
module torii_symbol() {
|
module torii_symbol() {
|
||||||
linear_extrude(.1, center = true)
|
linear_extrude(.1, center = true)
|
||||||
translate([-0.025, 0.025])
|
scale(1.25) {
|
||||||
text("⛩", font = "Segoe UI Emoji", size = 0.5 * 0.7, halign = "center");
|
translate([-0.025, 0.10])
|
||||||
|
text("⛩", font = "Segoe UI Emoji", size = 0.5 * 0.7, halign = "center");
|
||||||
|
|
||||||
|
translate([0, 0.3715])
|
||||||
|
difference() {
|
||||||
|
square([0.35, 0.075], center = true);
|
||||||
|
square([0.35 / 2, 0.075 / 2], center = true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module top_symbol() {
|
module top_symbol() {
|
||||||
translate([-0.005, .05])
|
translate([-0.01295, .13])
|
||||||
linear_extrude(.3, center = true)
|
{
|
||||||
scale([0.9, 1.5])
|
linear_extrude(.2, center = true)
|
||||||
text("🏔", font = "Segoe UI Emoji", size = 0.45 * 0.7, halign = "center");
|
scale([0.975, 1.5])
|
||||||
|
hull()
|
||||||
|
text("🏔", font = "Segoe UI Emoji", size = 0.45 * 0.7, halign = "center");
|
||||||
|
|
||||||
|
scale([0.975, 1.75])
|
||||||
|
linear_extrude(.25, center = true)
|
||||||
|
text("🏔", font = "Segoe UI Emoji", size = 0.45 * 0.7, halign = "center");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
senbon_torii(
|
senbon_torii(
|
||||||
rows = 2,
|
rows = 2,
|
||||||
columns = 3,
|
columns = 2,
|
||||||
start = [0, 0],
|
start = [0, 0],
|
||||||
width = .5,
|
width = .5,
|
||||||
height = .05
|
height = .05
|
||||||
|
Reference in New Issue
Block a user