Hyperion
Hyperion is a highly Generic crate for working with lindenmayer systems (LSystems). Inspired by The Algorithmic beauty of Plants. Made to work with all types of lssytems including:
- Stochasic
- Contextual
- Parametric
Usage
As an example well implement the origin LSystem for the growth of algea.
Hyperion is a framework for working with generic LSystems the first step is to create an enum for grammar that makes up the lsystem.
NOTE: This doesn't necessarily have to be an enum. &'static str/String could also work.
use ;
// By Default Alphabet is implemented for any `Copy + PartialEq` type.
/// Create an LSystem by passing in an Axiom and Rules.
use *;
let lsys = new
.rule
.rule
.build;
// To Evauluate the LSystem call .`sample(generation)`.
lsys.sample;
// returns [A, B, A, A, B, A, B, A]
More examples can be found in the tests
folder.
License
All code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or APACHE)
at your option. This means you can select the license you prefer.
Your contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.