{"id":20103483,"url":"https://github.com/swift502/octarr","last_synced_at":"2025-06-30T06:32:53.467Z","repository":{"id":47323905,"uuid":"360286190","full_name":"swift502/Octarr","owner":"swift502","description":"Dynamic array-like octree written in C#","archived":false,"fork":false,"pushed_at":"2025-05-28T09:58:12.000Z","size":34,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-28T10:53:49.905Z","etag":null,"topics":["array","csharp","dynamic","octree"],"latest_commit_sha":null,"homepage":"https://jblaha.art/projects/octarr/","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/swift502.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}},"created_at":"2021-04-21T19:38:58.000Z","updated_at":"2025-05-28T09:58:15.000Z","dependencies_parsed_at":"2022-09-10T05:23:15.298Z","dependency_job_id":null,"html_url":"https://github.com/swift502/Octarr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/swift502/Octarr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift502%2FOctarr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift502%2FOctarr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift502%2FOctarr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift502%2FOctarr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swift502","download_url":"https://codeload.github.com/swift502/Octarr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift502%2FOctarr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262723811,"owners_count":23354118,"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":["array","csharp","dynamic","octree"],"created_at":"2024-11-13T17:36:09.297Z","updated_at":"2025-06-30T06:32:53.455Z","avatar_url":"https://github.com/swift502.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Octarr\n\nStands for \u003cb\u003eoct\u003c/b\u003eree based 3D \u003cb\u003earr\u003c/b\u003eay.\n\nOctarr is a dynamic cubic octree capable of storing class data, accessed via indexers. Written in C#, based on the C++ [Cubic-octree](https://github.com/markusgod/cubic-octree).\n\nBasically a generic endless 3D array, which can be accessed like regular arrays and grows and shrinks depending on how much space needs to be allocated. Location index can be positive or negative in any direction. Octarr is centered around the zero coordinate (0, 0, 0), and grows and shrinks _from_ and _to_ this zero coordinate.\n\nUnlike multidimensional or jagged arrays, octarr is memory friendly. You can write a data block at the `[2^64, 2^64, 2^64]` position and not run out of memory. It will then take roughly 64 octree node lookups (logarithmic complexity) to find that data, or anything near it. Octarr is internally using the [BigInteger](https://docs.microsoft.com/dotnet/api/system.numerics.biginteger) data type to allow for unconstrained data location.\n\n```cs\n// Usage\npublic Octarr\u003cData\u003e octarr = new Octarr\u003cData\u003e();\t// Create an octarr\noctarr[10, -20, 30] = new Data();\t\t\t// Write\nData data = octarr[10, -20, 30];\t\t\t// Read assigned, returns your object\ndata = octarr[1, 2, 3];\t\t\t\t\t// Read unassigned, returns null\n\n// Debug\nint nodeCount = octarr.GetNodeCount();\t// Count all octree nodes\noctarr.DrawTree((float x, float y, float z, float halfSize) =\u003e\n{\n\tDrawBox(x, y, z, halfSize);\t// Draw the octree using your own box drawing function\n});\n```\n\n## Limitations\n\nData is currently required to be classes. If you want to store structs (int, string, etc.) it'll require some simple modifications and a definition of a default data value other than null.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswift502%2Foctarr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswift502%2Foctarr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswift502%2Foctarr/lists"}