1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-30 09:49:59 +02:00
This commit is contained in:
Justin Lin
2020-04-15 16:21:14 +08:00
parent f63b57043d
commit cf61c25302

View File

@@ -1,7 +1,7 @@
use <experimental/lsystem2.scad>;
use <line2d.scad>;
for(line = tree()) {
for(line = fern()) {
line2d(
line[0],
line[1],
@@ -11,6 +11,17 @@ for(line = tree()) {
);
}
function fern(n = 8, angle = 4, leng = 1, heading = 0, start = [0, 0]) =
let(
axiom = "EEEA",
rules = [
["A", "[++++++++++++++EC]B+B[--------------ED]B+BA"],
["C", "[---------EE][+++++++++EE]B+C"],
["D", "[---------EE][+++++++++EE]B-D"]
]
)
lsystem2(axiom, rules, n, angle, leng, heading, start, forward_chars = "ABCDE");
function tree(n = 2, angle = 36, leng = 1, heading = 0, start = [0, 0]) =
let(
axiom = "F",