{"id":16162371,"url":"https://github.com/sunsided/space-partitioning","last_synced_at":"2025-07-11T16:36:23.612Z","repository":{"id":57668006,"uuid":"391731800","full_name":"sunsided/space-partitioning","owner":"sunsided","description":"Space partitioning algorithms in Rust","archived":false,"fork":false,"pushed_at":"2024-02-26T11:29:34.000Z","size":273,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-17T12:48:47.988Z","etag":null,"topics":["interval-tree","quadtree","rust","space-partitioning"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/space-partitioning","language":"Rust","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/sunsided.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-01T20:30:41.000Z","updated_at":"2025-02-01T18:58:10.000Z","dependencies_parsed_at":"2024-10-27T19:17:09.281Z","dependency_job_id":"a78cdbed-e3d3-4dcd-b1a8-104231a31e5c","html_url":"https://github.com/sunsided/space-partitioning","commit_stats":{"total_commits":108,"total_committers":1,"mean_commits":108.0,"dds":0.0,"last_synced_commit":"d36f2d9fc6a7a382a4878eda9811928e4fbbc25a"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/sunsided/space-partitioning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fspace-partitioning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fspace-partitioning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fspace-partitioning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fspace-partitioning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunsided","download_url":"https://codeload.github.com/sunsided/space-partitioning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Fspace-partitioning/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264851951,"owners_count":23673332,"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":["interval-tree","quadtree","rust","space-partitioning"],"created_at":"2024-10-10T02:29:54.121Z","updated_at":"2025-07-11T16:36:23.595Z","avatar_url":"https://github.com/sunsided.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Space Partitioning\n\nSpace partitioning algorithms in Rust. A work in progress.\n\n## Implemented algorithms\n\n### QuadTrees\n\nPartitions 2D space into a tree of four non-overlapping segments each. Intersection tests are only\nimplemented using axis-aligned bounding boxes. The tree is currently implemented using\n`i32` types only to speed up intersection tests; proper pre-scaling of floating-point data \nis therefore required.\n\nThe example showcases a ray-box test where a 2D ray is implemented using `f32`. It can\nbe started using\n\n```console\n$ cargo run --release --example quadtree\n```\n\n![Ray-Box Test in QuadTree](docs/ray-box-test.png)\n\n### Interval Trees\n\nSee [Interval Trees] on Wikipedia. \n\n```console\n$ cargo run --example interval_tree\n```\n\nUsage example:\n\n```rust\nuse space_partitioning::interval_tree::{IntervalTree, Interval, IntervalType};\n\n#[derive(Debug, PartialOrd, PartialEq, Copy, Clone, Default)]\nstruct Vec2d {\n    pub x: f64,\n    pub y: f64,\n}\n\nimpl IntervalType for Vec2d {}\n\nfn main() {\n    let tree = IntervalTree::from_iter([\n        (\n            Interval::new(Vec2d { x: 1., y: 2. }, Vec2d { x: 10., y: 10. }),\n            \"Any data (A)\",\n        ),\n        (\n            Interval::new(Vec2d { x: -5., y: -5. }, Vec2d { x: 5., y: 5. }),\n            \"Any data (B)\",\n        ),\n        (\n            Interval::new(Vec2d { x: -10., y: -10. }, Vec2d { x: -7., y: -7. }),\n            \"Any data (C)\",\n        ),\n    ]);\n\n    let test = Interval::new(Vec2d::default(), Vec2d::default());\n    let result = tree.overlap_search(test).unwrap();\n\n    assert_eq!(result.data, \"Any data (B)\")\n}\n```\n\n[Interval Trees]: https://en.wikipedia.org/wiki/Interval_tree\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fspace-partitioning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsided%2Fspace-partitioning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Fspace-partitioning/lists"}