hyperion

Crates.iohyperion
lib.rshyperion
version
sourcesrc
created_at2024-12-11 19:20:21.249106
updated_at2024-12-11 19:20:21.249106
descriptionGeneric LSystem implementation.
homepage
repositoryhttps://github.com/wendivoid/hyperion/
max_upload_size
id1480478
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Patrick Greene (patrickisgreene)

documentation

README

Hyperion

crate version crate license Crates.io Docs.rs dependency status

unsafe forbidden

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 hyperion::{Rule, LSystemBuilder};

// By Default Alphabet is implemented for any `Copy + PartialEq` type.
#[derive(Clone, Copy, PartialEq)]
pub enum Algea {
    A,
    B,
}

/// Create an LSystem by passing in an Axiom and Rules.
use Algea::*;
let lsys = LSystemBuilder::new([A])
        .rule(Rule::new(A, [A, B]))
        .rule(Rule::new(B, [A]))
        .build();

// To Evauluate the LSystem call .`sample(generation)`. 
lsys.sample(4);
// 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:

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.

Commit count: 0

cargo fmt