Built with blockbuilder.org
forked from danbgray's block: L-System
forked from danbgray's block: Sierpinski
xxxxxxxxxx
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/danbgray/723bbd3a37053ba2bfaf96fd2fdfee00/raw/b8021f882b56d83e857ab56b228903e79e46f428/lsystem.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
</head>
<body>
<script>
/* The Seed / for Pascal's Tree */
v = ["A","B"];
w = "A";
P = {"A":"+B-A-B+","B":"-A+B+A-"};
levels = 6;
var svg = d3.select("body").append("svg")
.attr("width", 960)
.attr("height", 500)
position = [580,0];
w = G(v,w,P,levels);
path = drawToPath(position, w, 7,-Math.PI,Math.PI/3);
tree = svg.append("svg:path")
.attr("d",path)
.style("stroke-width","1")
.style("stroke","black")
.style("fill","green");
</script>
</body>
Updated missing url https://cdn.rawgit.com/danbgray/723bbd3a37053ba2bfaf96fd2fdfee00/raw/b8021f882b56d83e857ab56b228903e79e46f428/lsystem.js to https://cdn.jsdelivr.net/gh/danbgray/723bbd3a37053ba2bfaf96fd2fdfee00/raw/b8021f882b56d83e857ab56b228903e79e46f428/lsystem.js
https://d3js.org/d3.v4.min.js
https://cdn.rawgit.com/danbgray/723bbd3a37053ba2bfaf96fd2fdfee00/raw/b8021f882b56d83e857ab56b228903e79e46f428/lsystem.js