{"id":16147471,"url":"https://github.com/edap/ofxspacecolonization","last_synced_at":"2026-03-05T13:32:50.732Z","repository":{"id":145594138,"uuid":"86985504","full_name":"edap/ofxSpaceColonization","owner":"edap","description":"Space Colonization algorithm implementation in openFrameworks","archived":false,"fork":false,"pushed_at":"2020-08-25T19:59:12.000Z","size":4217,"stargazers_count":66,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T18:11:58.039Z","etag":null,"topics":["addon","algorithmic-botany","openframeworks","space-colonization-algorithm","tree"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-02T12:43:56.000Z","updated_at":"2023-06-19T00:19:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"91ee4a42-1ece-4b4d-8a69-6dc129aecfc2","html_url":"https://github.com/edap/ofxSpaceColonization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/edap/ofxSpaceColonization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2FofxSpaceColonization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2FofxSpaceColonization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2FofxSpaceColonization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2FofxSpaceColonization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edap","download_url":"https://codeload.github.com/edap/ofxSpaceColonization/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edap%2FofxSpaceColonization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30127870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T12:40:50.676Z","status":"ssl_error","status_checked_at":"2026-03-05T12:39:32.209Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["addon","algorithmic-botany","openframeworks","space-colonization-algorithm","tree"],"created_at":"2024-10-10T00:25:24.156Z","updated_at":"2026-03-05T13:32:50.135Z","avatar_url":"https://github.com/edap.png","language":"C++","readme":"# ofxSpaceColonization\n\n[![Build status](https://ci.appveyor.com/api/projects/status/9in4i3qdxumv5o3p?svg=true)](https://ci.appveyor.com/project/edap/ofxspacecolonization)\n[![Build status](https://travis-ci.org/edap/ofxSpaceColonization.svg?branch=master)](https://travis-ci.org/edap/ofxSpaceColonization)\n\n![cover](img/cover.png)\n\n\nThis addon is an openFrameworks implementation of the paper [Modeling Trees with a Space Colonization Algorithm](http://algorithmicbotany.org/papers/colonization.egwnp2007.large.pdf) by Adam Runions, Brendan Lane, and Przemyslaw Prusinkiewicz.\n\n\n### Dependecies\nIt requires [ofxBranchesPrimitive](https://github.com/edap/ofxBranchesPrimitive). The example *example-ofxenvelope* requires the addon [ofxEnvelope](https://github.com/edap/ofxEnvelope)\n\n### Usage\n\n```cpp\n//in your header file\nofxSpaceColonization tree;\n\n// in your App.cpp file\nvoid ofApp::setup(){\n    tree.build();\n}\n\nvoid ofApp::update(){\n    tree.grow();\n}\n\nvoid ofApp::draw(){\n    tree.draw();\n}\n```\n\nThis will generate a tree using this standard options:\n\n```cpp\nstatic const ofxSpaceColonizationOptions defaultSpaceColOptions = {\n    150,                             // maxDist, leaves are attractive if closer than this distance\n    10,                              // minDist, leaves are attractive if farther than this distance\n    150,                             // trunkLength, the length of the trunk\n    glm::vec4(0.0f,0.0f,0.0f, 1.0f), // rootPosition, the position of the root\n    glm::vec3(0.0f, 1.0f, 0.0f),     // rootDirection, the direction on which the tree will starts to grow\n    7,                               // branchLength, the length of each branch\n    false,                           // doneDrawing, a value that indicates when the grow process is done\n    false,                           // cap, if the cylinders that compose the branches have caps or not\n    2.0,                             // radius, the radius of the branch\n    16,                              // resolution, the resolution of the cylinders that compose the geometry\n    1,                               // textureRepeat, how many times a texture has to be repeated on a branch\n    0.9997                           // radiusScale, how much the radius will increase or decrease at each interaction\n};\n```\n\nYou can specify yours options using the `setup` method:\n\n```cpp\nvoid ofApp::setup(){\n    auto myOpt = ofxSpaceColonizationOptions({\n       // ...\n    });\n    tree.setup(myOpt);\n    tree.build();\n}\n```\n\nThe form of the tree changes depending on these options and on the position of the leaves. By default, some default leaves are provided but you can provide your leaves by using the `setLeavesPositions()` method. It takes a `vector\u003cglm::vec3\u003e` as argument.\n\n```cpp\nvoid ofApp::setup(){\n    vector\u003cglm::vec3\u003e points;\n    // ... fullfill the vector\n    tree.setLeavesPositions(points);\n    tree.build();\n}\n```\n\nI've created an addon that can be used to generate the points, it is called [ofxEnvelope](https://github.com/edap/ofxEnvelope) and you can see in the example `example-ofxenvelope` how to use it.\n\n\n### Wind\n\nThe `grow` method takes a `glm::vec3` as optional parameter. This vector can be used to move the leaves, like [this](https://www.instagram.com/p/BV8B0FGDi1L/?taken-by=edapx)\nExample:\n\n```cpp\nvoid ofApp::update(){\n  float t = ofGetElapsedTimef();\n  float n = ofSignedNoise(t * windFreq) * windAmpl;\n  auto wind = glm::vec3(n,0.0,0.0); // a weird wind that only breezes on the x axis\n  tree.grow(wind);\n}\n```\n\n\n### Examples\n\n*example-3d*\n![example-3d](img/example-3d.png)\n\n*example-ofxenvelope*\n![example-ofxenvelope](img/example-ofxenvelope.gif)\n\n### License\nMIT\n\n### References\n\n[Procedurally Generated Trees with Space Colonization Algorithm in XNA C#](http://www.jgallant.com/procedurally-generating-trees-with-space-colonization-algorithm-in-xna/)\n\n[Daniel Shiffman Video](https://www.youtube.com/watch?v=kKT0v3qhIQY)\n\n[space-colonization](https://github.com/nicknikolov/space-colonization)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedap%2Fofxspacecolonization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedap%2Fofxspacecolonization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedap%2Fofxspacecolonization/lists"}