A Lindenmayer system that draws a spiral on a hexagonal tiling, starting from its center. See also a square one.
As in the previous experiment, the X -> XF
rule takes into account the growth in length of the spiral sides. The Y -> Y+XF+X+XF+XF+XF+XF
rule describes the concatenation of full turns of the spiral (note that the second side is always one unit shorter than the others - just look at the top-left part of the figure to see that).
xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="Hex spiral (L-system)" />
<title>Hex spiral (L-system)</title>
<link rel="stylesheet" href="index.css">
<script src="https://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<script src="index.js"></script>
</body>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
https://d3js.org/d3.v3.min.js