{"id":16147407,"url":"https://github.com/edap/ofxlsystem","last_synced_at":"2025-07-15T16:37:33.169Z","repository":{"id":145594134,"uuid":"54144323","full_name":"edap/ofxLSystem","owner":"edap","description":"3D turtle graphics interpretation of L-Systems","archived":false,"fork":false,"pushed_at":"2019-03-14T14:24:24.000Z","size":15320,"stargazers_count":39,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-06T06:05:17.068Z","etag":null,"topics":["3d","addon","algorithmic-botany","shaders","tree"],"latest_commit_sha":null,"homepage":"https://vimeo.com/161169445","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-03-17T19:04:34.000Z","updated_at":"2025-03-21T22:23:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d2c990a-bfd8-4a54-bff6-85c87499f9a5","html_url":"https://github.com/edap/ofxLSystem","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/edap/ofxLSystem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2FofxLSystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2FofxLSystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2FofxLSystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2FofxLSystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edap","download_url":"https://codeload.github.com/edap/ofxLSystem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2FofxLSystem/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265445481,"owners_count":23766489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","addon","algorithmic-botany","shaders","tree"],"created_at":"2024-10-10T00:25:12.575Z","updated_at":"2025-07-15T16:37:33.148Z","avatar_url":"https://github.com/edap.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ofxLSystem\n\n[![Build status](https://travis-ci.org/edap/ofxLSystem.svg?branch=master)](https://travis-ci.org/edap/ofxLSystem)\n[![Build status](https://ci.appveyor.com/api/projects/status/etxh1ocwr7nbcf84?svg=true)](https://ci.appveyor.com/project/edap/ofxlsystem)\n\n\nThis addon has a dependency on [ofxLSystemGrammar](https://github.com/edap/ofxLSystemGrammar). Download it and add it to your addon folder\n\nofxLSystem is a 3D graphic turtle graphic interpretation of L-Syestems. In the readme of ofxLSystemGrammar you can find some information about L-System.\nThis addon can be used to generate meshes as the following ones:\n\n![example](img/violet.png)\n![example](img/green.png)\n![example](img/azul.png)\n![example](img/forest.png)\n![example](img/rings.gif)\n\n## Supported platforms\n\nIt is currently tested on mac, linux and windows and the current version of openFrameworks in master\n\nOn linux, you need g++ \u003e 4.9 and the `-std=gnu++14` flag. Otherwise you will have an error about `std::regex_iterator`. This flag is the default since OF 0.9.3, just in case you set it to `std=c++11` as described in this [post]( https://forum.openframeworks.cc/t/openframeworks-0-9-qtcreator/21312/7).\n\n## Usage\n\nIn your header file include `ofxLSystem` and declare an instance of it. Declare also a material, it will be applied to the tree's mesh.\n\n```cpp\n#include \"ofxLSystem.h\"\n// ...\nofxLSystem tree\nofMaterial treeMaterial\n```\n\nIn your `ofApp.cpp`\n\n```cpp\nvoid ofApp::setup(){\n  treeMaterial.setDiffuseColor(ofFloatColor::blueSteel)\n  tree.setStep(4);\n  tree.build();\n}\n\n\nvoid ofApp::draw(){\n  treeMaterial.begin();\n  tree.draw();\n  treeMaterial.end();\n}\n```\n\n`tree.setAxiom(\"F\")` tells to ofxLSystem to use `F` as axiom, `tree.setRules({\"F -\u003e FF[+F][-F]\"})` to use `F -\u003e FF[+F][-F]` as reproduction rule and `tree.setStep(4)` to iterate 4 times. Have a look into ofxLSystemGrammar or in the 2 examples in this project for more L-System examples.\n\nBy default, each L-System is initialized with this parameters:\n\n```cpp\ntypedef map\u003cstring,float\u003e Constants;\n\nvector\u003cstring\u003e    rulesContainer = {\"F -\u003e F[+F][-F]\"};\nstring            axiom = \"F\";\nbool              randomYRotation = false;\nint               depth = 1;\nfloat             theta = 25.00;\nfloat             stepWidth = 10.00;\nbool              scaleWidth = false;\nfloat             stepLength = 100.00;\nmap\u003cstring,float\u003e constants = Constants();\n```\n\nyou can overwrite the default parameters using these methods:\n\n```cpp\nvoid setAxiom(string _axiom);\nvoid setRules(vector\u003cstring\u003e _rulesContainer);\nvoid setTheta(float _theta);\nvoid setRandomZRotation(bool _randomYRotation);\nvoid setStep(int _depth);\nvoid setScaleWidth(bool _scaleWidht);\nvoid setStepWidth(float _stepWidth);\nvoid setStepLength(float _stepLength);\nvoid setConstants(map\u003cstring,float\u003e _Constants);\n```\n\nFor example, the following snippet:\n\n```cpp\nofxLSystem tree;\nmap\u003cstring, float\u003e constants;\nconstants.insert(make_pair(\"R\", 1.456));\n\ntree.setAxiom(\"A(100)\");\ntree.setRules({\"A(s) -\u003e F(s)[+A(s/R)][-A(s/R)]\"});\ntree.setRandomYRotation(true);\ntree.setConstants(constants);\ntree.setStep(4);\ntree.setScaleWidth(true);\ntree.setStepLength(90);\n```\n\nGenerates a tree like this:\n\n![example](img/scaleWidth.png)\n\n\n\n## Examples\n\n- *example-gui* contains ~10 differents L-Systems, with a GUI to change colors, rotation angle, n steps ecc. It saves the settings for each tree on a separate xml file\n- *example-forest* An example on how you can build a forest merging the meshes of 60 trees in one  \n- *example-shader* I've added some simple shaders following \"the book of shader\" of Patricio Gonzalo Vivo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedap%2Fofxlsystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedap%2Fofxlsystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedap%2Fofxlsystem/lists"}