# Geodesic icosahedron
Creating geodesic icosahedron given subdivision frequency.
## Installation
Install the module using ```pip install icosphere``` or clone the repository.
## Use
``` python
from icosphere import icosphere
nu = 5 # or any other integer
vertices, faces = icosphere(nu)
```
## Examples
Check the examples in [icosphere github](https://github.com/vedranaa/icosphere), python script uses matplotlib for visualization, and jupyter notebook uses plotly.
## Why use subdivision frequency?
For a certain subdivision frequency `nu`, each edge of the icosahedron will be split into `nu` segments, and each face will be split into `nu**2` faces.

This is different than a more common approach which recursively applies a subdivision with `nu = 2`, for example as used in pytorch3d [ico_sphere](https://github.com/facebookresearch/pytorch3d/blob/master/pytorch3d/utils/ico_sphere.py), pymeshlab [sphere](https://pymeshlab.readthedocs.io/en/latest/filter_list.html#sphere), trimesh [icosphere](https://trimsh.org/trimesh.creation.html?highlight=icosahedron#trimesh.creation.icosphere), and PyMesh [generate_icosphere](https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/meshutils/generate_icosphere.py).
The advantage of using the subdivision frequency, compared to the recursive subdivision, is in controlling the mesh resolution. Mesh resolution grows quadratically with subdivision frequencies while it grows exponentially with iterations of the recursive subdivision. To be precise, using the recursive subdivision, the number of vertices and faces in the resulting icosphere grows with iterations `iter` as `nr_vertex = 12 + 10 * (4**iter -1)` and `nr_face = 10 * 4**iter` which gives a sequence of mesh vertices
12, 42, 162, 642, 2562, 10242, 40962, 163842, 655362, 2621442, 10485762...
Notice for example there is no mesh having between 2562 and 10242 vertices. Using subdivision frequency, the number of vertices and faces grows with `nu` as
Notice for example there is no mesh having between 2562 and 10242 vertices. Using subdivision frequency, the number of vertices and faces grows with `nu` as `nr_vertex = 12 + 10 * (nu**2 -1)` and `nr_face = 20 * nu**2` which gives a sequence of mesh vertices
12, 42, 92, 162, 252, 362, 492, 642, 812, 1002, 1212, 1442, 1692, 1962,
2252, 2562, 2892, 3242, 3612, 4002, 4412, 4842, 5292, 5762, 6252, 6762,
7292, 7842, 8412, 9002, 9612, 10242...
Now there is 15 meshes having between 2562 and 10242 vertices. The advantage is even more pronounced when using higher resolutions.
The code was originally developed for [this work](https://ieeexplore.ieee.org/document/7182720).
Raw data
{
"_id": null,
"home_page": "https://github.com/vedranaa/icosphere",
"name": "icosphere",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Vedrana Andersen Dahl",
"author_email": "vand@dtu.dk",
"download_url": "https://files.pythonhosted.org/packages/92/7b/ad40ff61c4a31b0683a55737c7551ca534904c8fa7845ca300e7c1874622/icosphere-0.1.3.tar.gz",
"platform": "",
"description": "# Geodesic icosahedron\nCreating geodesic icosahedron given subdivision frequency.\n## Installation\nInstall the module using ```pip install icosphere``` or clone the repository.\n## Use\n``` python\nfrom icosphere import icosphere\nnu = 5 # or any other integer\nvertices, faces = icosphere(nu)\n```\n## Examples\nCheck the examples in [icosphere github](https://github.com/vedranaa/icosphere), python script uses matplotlib for visualization, and jupyter notebook uses plotly.\n## Why use subdivision frequency?\nFor a certain subdivision frequency `nu`, each edge of the icosahedron will be split into `nu` segments, and each face will be split into `nu**2` faces.\n\nThis is different than a more common approach which recursively applies a subdivision with `nu = 2`, for example as used in pytorch3d [ico_sphere](https://github.com/facebookresearch/pytorch3d/blob/master/pytorch3d/utils/ico_sphere.py), pymeshlab [sphere](https://pymeshlab.readthedocs.io/en/latest/filter_list.html#sphere), trimesh [icosphere](https://trimsh.org/trimesh.creation.html?highlight=icosahedron#trimesh.creation.icosphere), and PyMesh [generate_icosphere](https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/meshutils/generate_icosphere.py).\n\nThe advantage of using the subdivision frequency, compared to the recursive subdivision, is in controlling the mesh resolution. Mesh resolution grows quadratically with subdivision frequencies while it grows exponentially with iterations of the recursive subdivision. To be precise, using the recursive subdivision, the number of vertices and faces in the resulting icosphere grows with iterations `iter` as `nr_vertex = 12 + 10 * (4**iter -1)` and `nr_face = 10 * 4**iter` which gives a sequence of mesh vertices\n\n 12, 42, 162, 642, 2562, 10242, 40962, 163842, 655362, 2621442, 10485762...\nNotice for example there is no mesh having between 2562 and 10242 vertices. Using subdivision frequency, the number of vertices and faces grows with `nu` as\nNotice for example there is no mesh having between 2562 and 10242 vertices. Using subdivision frequency, the number of vertices and faces grows with `nu` as `nr_vertex = 12 + 10 * (nu**2 -1)` and `nr_face = 20 * nu**2` which gives a sequence of mesh vertices\n\n 12, 42, 92, 162, 252, 362, 492, 642, 812, 1002, 1212, 1442, 1692, 1962,\n 2252, 2562, 2892, 3242, 3612, 4002, 4412, 4842, 5292, 5762, 6252, 6762,\n 7292, 7842, 8412, 9002, 9612, 10242...\nNow there is 15 meshes having between 2562 and 10242 vertices. The advantage is even more pronounced when using higher resolutions.\n\nThe code was originally developed for [this work](https://ieeexplore.ieee.org/document/7182720).\n\n\n",
"bugtrack_url": null,
"license": "GNU Lesser General Public License v2.1",
"summary": "Constructs geodesic icosahedron given subdivision frequency.",
"version": "0.1.3",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "d17fb678571a92506d78f90d5857b9e8",
"sha256": "08f0c8469a280cc5cdbca33cff0a251576da8cea5f88ecf2d3b7835beee671a7"
},
"downloads": -1,
"filename": "icosphere-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "d17fb678571a92506d78f90d5857b9e8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14654,
"upload_time": "2021-11-28T14:49:45",
"upload_time_iso_8601": "2021-11-28T14:49:45.096029Z",
"url": "https://files.pythonhosted.org/packages/92/7b/ad40ff61c4a31b0683a55737c7551ca534904c8fa7845ca300e7c1874622/icosphere-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2021-11-28 14:49:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "vedranaa",
"github_project": "icosphere",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "icosphere"
}