Skip to main content

Creates a geodesic icosahedron given a subdivision frequency.

Project description

Geodesic Icosahedron

Creates a geodesic icosahedron given a subdivision frequency.

PyPI Downloads

Installation

Install with pip install icosphere, or clone this repository.

Usage

from icosphere import icosphere
nu = 5  # or any other integer
vertices, faces = icosphere(nu)

Examples

See examples in the icosphere GitHub repository:

  • example_in_matplotlib.py uses matplotlib for visualization.
  • Example_in_plotly.ipynb uses plotly for interactive visualization.

You can also open the notebooks in Colab:

  • Open In Colab - plotly
  • Open In Colab - matplotlib

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 from a more common approach that recursively applies subdivision with nu = 2, as used in pytorch3d ico_sphere, pymeshlab sphere, trimesh icosphere, and PyMesh generate_icosphere.

The subdivision-frequency approach gives better control of mesh resolution than recursive subdivision. In this approach, mesh resolution grows quadratically with nu, while in recursive subdivision it grows exponentially with the number of iterations. More precisely, under 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 the sequence of vertex counts

12, 42, 162, 642, 2562, 10242, 40962, 163842, 655362, 2621442, 10485762...

Notice, for example, that there is no mesh with a vertex count between 2562 and 10242. 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 the sequence of vertex counts

 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 are 15 meshes with vertex counts between 2562 and 10242. The advantage is even more pronounced at higher resolutions.

The code was originally developed for this work.

Reference this work

Dahl, V. A., Dahl, A. B., & Larsen, R. (2014). Surface Detection Using Round Cut. 2014 2nd International Conference on 3D Vision. https://doi.org/10.1109/3dv.2014.60

@inproceedings{Dahl_2014,
	doi = {10.1109/3dv.2014.60},
	url = {https://doi.org/10.1109%2F3dv.2014.60},
	year = 2014,
	month = {dec},
	publisher = {{IEEE}},
	author = {Vedrana A. Dahl and Anders B. Dahl and Rasmus Larsen},
	title = {Surface Detection Using Round Cut},
	booktitle = {2014 2nd International Conference on 3D Vision}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icosphere-0.2.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icosphere-0.2.0-py2.py3-none-any.whl (15.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file icosphere-0.2.0.tar.gz.

File metadata

  • Download URL: icosphere-0.2.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for icosphere-0.2.0.tar.gz
Algorithm Hash digest
SHA256 36fc68f4343435873486fcc78e8e6ee9735b8141a9ef9d1afe5c0a66e6056648
MD5 d021271488eb938b11e9750582c0ccf3
BLAKE2b-256 9571f04c567027913b7423d8c59db7ee83fa3f091a9901b4f6fc00f0bee023e5

See more details on using hashes here.

File details

Details for the file icosphere-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: icosphere-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for icosphere-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 51daed55e216773110395e35a70a714ad27bcb44189813c8e66ad9c034ffc465
MD5 138896c8bb1a4573564696e43b5d5ca3
BLAKE2b-256 8cfe62ec5e3a6deb2a736f80908cbd97ca9e8eefec69b707445e21572f720bb8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page