{"id":23395704,"url":"https://github.com/randogoth/xenobalanus","last_synced_at":"2025-04-08T17:19:24.943Z","repository":{"id":229803634,"uuid":"774321394","full_name":"randogoth/xenobalanus","owner":"randogoth","description":"Rust implementation of the DELFIN and DTSCAN Algorithm to find cluster and void areas in a planar point set","archived":false,"fork":false,"pushed_at":"2024-04-10T03:09:37.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T13:36:39.433Z","etag":null,"topics":["astronomy","cluster","dbscan","delaunay","delaunay-triangulation","delfin","dtscan","statistical-analysis","void"],"latest_commit_sha":null,"homepage":"","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/randogoth.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}},"created_at":"2024-03-19T10:49:30.000Z","updated_at":"2024-03-26T09:35:04.000Z","dependencies_parsed_at":"2024-04-06T15:26:12.190Z","dependency_job_id":"3ccee81f-67af-4a9d-9e99-aa9c8b80e6d0","html_url":"https://github.com/randogoth/xenobalanus","commit_stats":null,"previous_names":["randogoth/xenobalanus"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randogoth%2Fxenobalanus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randogoth%2Fxenobalanus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randogoth%2Fxenobalanus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randogoth%2Fxenobalanus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/randogoth","download_url":"https://codeload.github.com/randogoth/xenobalanus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247888568,"owners_count":21013002,"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":["astronomy","cluster","dbscan","delaunay","delaunay-triangulation","delfin","dtscan","statistical-analysis","void"],"created_at":"2024-12-22T07:16:57.715Z","updated_at":"2025-04-08T17:19:24.921Z","avatar_url":"https://github.com/randogoth.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xenobalanus\n\nA Rust implementation of the DELFIN and DTSCAN algorithms to find cluster and void areas in planar point distributions.\n\n## Overview\n\nDELFIN was designed to identify void areas within a point set by leveraging Delaunay triangulation. Void areas are low-density zones within a planar point distribution that have significantly fewer points than their surroundings, ideally none.\n\nThe original DELFIN algorithm was developed by Hervías, C., Hitschfeld-Kahler, N., Campusano, L.E., Font, G. (2014). \"[On Finding Large Polygonal Voids Using Delaunay Triangulation: The Case of Planar Point Sets](https://doi.org/10.1007/978-3-319-02335-9_16).\" In: Sarrate, J., Staten, M. (eds) Proceedings of the 22nd International Meshing Roundtable. Springer, Cham.\n\nDTSCAN is a clustering algorithm that combines Delaunay Triangulation with density-based spatial clustering of applications with noise (DBSCAN) principles to identify clusters in spatial data. Unlike traditional DBSCAN, DTSCAN leverages the geometric properties of Delaunay Triangulation to efficiently manage spatial relationships, making it particularly suited for large datasets and higher-dimensional data. \n\nDTSCAN was developed by Kim, Jongwon, and Jeongho Cho. \"[Delaunay triangulation-based spatial clustering technique for enhanced adjacent boundary detection and segmentation of LiDAR 3D point clouds.](https://doi.org/10.3390%2Fs19183926)\" Sensors 19.18 (2019): 3926. in their research paper 'Delaunay Triangulation-Based Spatial Clustering Technique for Enhanced Adjacent Boundary Detection and Segmentation of LiDAR 3D Point Clouds'\n\n## Functions\n\nThe Xenobalanus class is comprised of several key methods:\n\n- `random_points`: Generates uniformly distributed random points for testing.\n- `delaunay`: A wrapper of the [Delaunator crate](https://docs.rs/delaunator/latest/delaunator/). Performs Delaunay Triangulation on a given set of points to find their triangular connections.\n- `preprocess`: Iterates through all Delaunay triangles to build lookup tables for the DELFIN and DTSCAN functions.\n- `delfin`: Processes the lookup tables to find and delineate void areas, based on a threshold that determines what constitutes a significant void.\n- `dtscan`: Identifies clusters within the set of points based on the lookup tables, applying a modified DBSCAN algorithm that uses the triangular connections as a basis for neighborhood determination.\n\n## Example Code\n\nBelow is an example code snippet that demonstrates the workflow. This example generates random points, runs Delaunay Triangulation on these points, processes the triangulation result, and then performs a cluster and void search.\n\n```rust\nuse geo::Point;\nuse std::collections::{HashSet};\nuse xenobalanus;\n\nfn main() {\n    // Define test area and random points\n    let dots: u32 = 10000;\n    let side_length: f32 = 10000.0;\n    let mut xeno = Xenobalanus::new();\n    xeno.random_points((0.0, 0.0), side_length, dots);\n    println!(\"Generated {:#?} random dots\", dots);\n\n    // Run Delaunay triangulation\n    xeno.delaunay();\n    println!(\"Generated Delaunay triangulation\");\n\n    // Pre-process triangles\n    // 1 - attractors, 2 - voids, 0 - both\n    // true/false - parallel processing\n    xeno.preprocess(0, false);\n\n    // Execute delfin function with the generated GeometryData\n    let min_area: f32 = 1000.0; // threshold for voidness\n    let min_distance: f32 = 200.0; // threshold for minimum distance\n    let void_polygons: Vec\u003cHashSet\u003cusize\u003e\u003e = xeno.delfin(min_area, min_distance);\n    println!(\"Found {:#?} Voids\", void_polygons.len());\n\n    // Execute DTSCAN with the prepared data\n    let min_pts: usize = 5; // threshold for minimum number of points\n    let max_closeness: f32 = 100.5; // threshold for maximum closeness\n    let clusters: Vec\u003cVec\u003cusize\u003e\u003e = xeno.dtscan(min_pts, max_closeness);\n    println!(\"Found {:#?} Attractors\", clusters.len());\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandogoth%2Fxenobalanus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandogoth%2Fxenobalanus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandogoth%2Fxenobalanus/lists"}