{"id":15401472,"url":"https://github.com/111116/sphere-set-approximation","last_synced_at":"2025-04-15T22:31:14.661Z","repository":{"id":88822240,"uuid":"274611363","full_name":"111116/sphere-set-approximation","owner":"111116","description":"approximate a mesh with a set of spheres","archived":false,"fork":false,"pushed_at":"2021-05-17T03:47:59.000Z","size":1961,"stargazers_count":22,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T03:51:15.206Z","etag":null,"topics":["mesh-processing"],"latest_commit_sha":null,"homepage":"","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/111116.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":"2020-06-24T08:04:05.000Z","updated_at":"2025-02-14T22:53:25.000Z","dependencies_parsed_at":"2023-06-12T19:30:28.269Z","dependency_job_id":null,"html_url":"https://github.com/111116/sphere-set-approximation","commit_stats":{"total_commits":68,"total_committers":1,"mean_commits":68.0,"dds":0.0,"last_synced_commit":"e5e0af24c6daed950bb1dcae836edca77a7e283b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/111116%2Fsphere-set-approximation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/111116%2Fsphere-set-approximation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/111116%2Fsphere-set-approximation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/111116%2Fsphere-set-approximation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/111116","download_url":"https://codeload.github.com/111116/sphere-set-approximation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249166010,"owners_count":21223362,"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":["mesh-processing"],"created_at":"2024-10-01T15:58:25.546Z","updated_at":"2025-04-15T22:31:12.114Z","avatar_url":"https://github.com/111116.png","language":"C++","readme":"# Sphere Set Approximation\n\n**WORK IN PROGRESS**\n\nApproximate a mesh by bounding it with a set of spheres, which can be used for collision detection, shadowing, etc.\n\n![demo](demo.jpg)\n\nThe program requires an original mesh and a simplified manifold version of the mesh, which can be generated from the original mesh using [hjwdzh/Manifold](https://github.com/hjwdzh/Manifold). The original mesh is used for surface constraint, while the manifold mesh is used for volume constraint \u0026 redundant volume optimization.\n\nYou may try with different seeds to get better result.\n\n## Usage\n\n```bash\ncd src\nmake\n./main -i ../armadillo.obj -m ../armadillo_manifold.obj -n 64\n```\n\nIt outputs to `stdout` and logs to `stderr`.\n\nThe algorithm runs quite slow (proportional to number of triangular faces of the manifold).\n\nThe manifold must be closed and orientable.\n\n## Algorithm\n\nWe use method described in\n\n[*Variational Sphere set Approximation for Solid Objects*](http://dx.doi.org/10.1007/s00371-006-0052-0)\n\nwith several minor changes:\n\n- bugfixes SOTV, which in this paper is overestimated in some cases\n- provides an analytic algorithm to solve swing volume\n- voxel size doesn't have to be manually specified\n- better sample quality of surface points\n- other minor strategy optimizations\n\n#### paper abstract\n\nWe approximate a solid object represented as a triangle mesh by a bounding set of spheres having minimal summed volume outside the object. We show how outside volume for a single sphere can be computed using a simple integration over the object’s triangles. We then minimize the total outside volume over all spheresin the set using a variant of iterative Lloyd clustering which splits the mesh points into sets and bounds each with an outside volume-minimizing sphere. The resulting sphere sets are tighter than those of previous methods. In experiments comparing against a state-of-the-art alternative (adaptive medial axis), our method often requires half or fewer as many spheres to obtain the same error, under a variety of error metrics including total outside volume, shadowing fidelity, and proximity measurement.\n\n#### Optimization steps\n\n1. Fix the centers of spheres. Greedily assign points to them, minimizing SOV\n2. Fix the point clusters. Adjust the spheres using Powell's method, minimizing SOV\n3. Teleportation: Remove the most redundant sphere. Split the sphere with most SOV\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F111116%2Fsphere-set-approximation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F111116%2Fsphere-set-approximation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F111116%2Fsphere-set-approximation/lists"}