1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-16 19:54:29 +02:00

add tree2

This commit is contained in:
Justin Lin
2020-04-16 08:41:39 +08:00
parent a8aaf56b50
commit 697698a296

View File

@@ -1,7 +1,7 @@
use <experimental/lsystem3.scad>; use <experimental/lsystem3.scad>;
use <hull_polyline3d.scad>; use <hull_polyline3d.scad>;
for(line = plant()) { for(line = tree2()) {
hull_polyline3d( hull_polyline3d(
[line[0], line[1]], [line[0], line[1]],
thickness = 0.25, thickness = 0.25,
@@ -9,7 +9,7 @@ for(line = plant()) {
); );
} }
function tree(n = 4, angle = 22.5, leng = 1, heading = 0, start = [0, 0, 0]) = function tree1(n = 4, angle = 22.5, leng = 1, heading = 0, start = [0, 0, 0]) =
let( let(
axiom = "FFFA", axiom = "FFFA",
rules = [ rules = [
@@ -18,6 +18,17 @@ function tree(n = 4, angle = 22.5, leng = 1, heading = 0, start = [0, 0, 0]) =
) )
lsystem3(axiom, rules, n, angle, leng, heading, start); lsystem3(axiom, rules, n, angle, leng, heading, start);
function tree2(n = 4, angle = 18, leng = 1, heading = 0, start = [0, 0, 0]) =
let(
axiom = "BBBBBA",
rules = [
["A", "[++BB[--C][++C][&&C][^^C]A]/////+BBB[--C][++C][&&C][^^C]A"],
["B", "\\\\B"],
["C", ""]
]
)
lsystem3(axiom, rules, n, angle, leng, heading, start, forward_chars = "ABC");
function plant(n = 4, angle = 30, leng = 1, heading = 0, start = [0, 0, 0]) = function plant(n = 4, angle = 30, leng = 1, heading = 0, start = [0, 0, 0]) =
let( let(
axiom = "A", axiom = "A",