L-System(エルシステム)
Self-similar plant growth — 書き換え規則から生まれる植物の形
使い方 / Getting started
シダ状・枝分かれ・低木状・コッホ曲線から選び、世代数や角度を変えてください。開始文字列と規則を編集し「適用」を押すと、自分のモデルを描けます。「次の世代」は全ての文字にもう一度規則を適用します。
Choose a fern-like plant, branching tree, bush-like plant, or Koch curve. Adjust generations and turn angles, or edit the axiom and rules and press Apply. Next advances by one rewriting generation.
- ドラッグで移動、ホイールや拡大率でズーム。「全体表示」で戻ります。 / Drag to pan, zoom with the wheel or slider, and use Fit to restore the full view.
- 「描画」は線を順番に表示し、途中で停止・再開できます。 / Draw reveals the lines sequentially; pause and resume at any time.
- PNG保存は現在の表示を保存します。スマートフォンでは⚙で設定を開きます。 / Save the current view as PNG. On mobile, open settings with ⚙.
文字列を並列に書き換える / Parallel rewriting
L-System(Lindenmayer system)は、開始文字列と書き換え規則から世代ごとの文字列を生成する仕組みです。同じ世代の文字は全て、その世代の開始時の文字列をもとに置き換えます。置き換え直後の文字に同じ世代でもう一度規則を適用することはありません。
Rule: F → F[+F]F[-F]F
Generation 0: F
Generation 1: F[+F]F[-F]F
An L-system generates strings by rewriting all symbols in parallel. A rule applies once per generation to each symbol in the previous string. Symbols without a rule remain unchanged.
文字を枝に変える / Turtle interpretation
仮想のペンが上向きに原点から出発し、文字列を読み進めます。F・Gは線を描いて前進、fは描かずに前進、+は左回転、-は右回転です。[で位置・向きを保存し、]で保存した状態に戻るため、幹から枝分かれできます。Xなどの文字は描画せず、次の世代の書き換えに使います。
A virtual pen starts at the origin facing up. F/G draw forward; f moves without drawing; + turns left and - turns right. Brackets save and restore position and heading, creating branches. Other uppercase letters are rewriting placeholders.
規則は1行に1つ、例:F=FF。空の右辺はその文字を消します。開始文字列と各規則の [ ] は対応させてください。 / Enter one rule per line. An empty replacement deletes a symbol. Brackets must balance within the axiom and each replacement.
自己相似と植物 / Self-similarity and plants
同じ生成手順を枝の中でも繰り返すと、部分が全体に似た形を作ります。分岐角度や文字の置き換え方を変えるだけでも、背の高い形、広がる形、幾何学的な曲線へ変化します。色は枝分かれの深さ、太さの変化は見やすさのための表現です。
Repeated rules can produce parts resembling the whole. Branch angles and rewriting rules determine the resulting structure; color and taper visualize branch depth.
このページは決定的な2次元のL-Systemです。光・栄養・重力などの生理的な成長要因は扱いません。「描画」のアニメーションは完成した文字列をたどる表示で、植物の成長時間を再現したものではありません。
This is a deterministic 2D L-system, without physiological growth factors such as light or nutrients. The drawing animation reveals a completed string rather than simulating biological growth time.
計算の上限 / Limits
0〜8世代、最大16万文字まで計算します。規則によって文字数は急増するため、上限を超える場合は前の描画を保ち、世代を減らす案内を表示します。
The simulator supports 0–8 generations and up to 160,000 symbols. If expansion exceeds the limit, the previous drawing is preserved.
参考資料 / References
- Prusinkiewicz & Lindenmayer — The Algorithmic Beauty of Plants
- Prusinkiewicz — Graphical applications of L-systems
hamzALIFE · Privacy