Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/optimisticpeach/hexasphere
Subdividing triangle meshes.
https://github.com/optimisticpeach/hexasphere
Last synced: 2 days ago
JSON representation
Subdividing triangle meshes.
- Host: GitHub
- URL: https://github.com/optimisticpeach/hexasphere
- Owner: OptimisticPeach
- License: apache-2.0
- Created: 2020-08-04T02:38:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-10T17:21:47.000Z (6 months ago)
- Last Synced: 2024-07-15T09:31:46.061Z (6 months ago)
- Language: Rust
- Homepage:
- Size: 122 KB
- Stars: 60
- Watchers: 8
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: LICENSE-APACHE2
- Citation: CITATION.cff
Awesome Lists containing this project
README
# `hexasphere`
Library for subdividing shapes, such as an icosahedron. This provides
abstractions for almost anything to be possible, however there are many
predetermined shapes.## In the case of the icosphere:
### Geometry:
This starts off with an icoashedron, and then proceeds to subdivide it.
The subdivided points form the dual to a [goldberg polyhedron](https://en.wikipedia.org/wiki/Goldberg_polyhedron).
In essence, each point on this sphere is either a hexagon or a pentagon.### Interpolation:
Points are interpolated using the [geometric `slerp`](https://en.wikipedia.org/wiki/Slerp#Geometric_Slerp)
function to preserve their accuracy.---
### Features
- Base shapes
- Icosahedron
- Tetrahedron
- Triangle
- Square
- Cube
- Interpolation functions
- Spherical interpolation
- Linear interpolation
- Normalized linear interpolation
- Basic optimizations for `p == 0.5` in interpolation.
- An adjacency (neighbour) map which can be generated from the indices
that this library creates.A few more optimizations are coming, along with more options for generation:
- Remove nested triangle layers by placing them into their own `Vec`.
- Allow interpolation functions to have access to state. (This would
permit certain things such as sampling noise as part of the generation).
# License
Hexasphere is distributed under the terms of either the MIT license, or the Apache License (Version 2.0)
at the user's choice.See the files named LICENSE-MIT and LICENSE-APACHE2 relative to the root directory of this
project for more details.