Baltor Get started

Gallery / Mesh algorithms

Cube sphere with equal-area mapping

In your harnessMesh algorithmMIT

Map the six faces of a subdivided cube onto a sphere as one welded quad mesh, with a polynomial mapping that keeps cell areas within about 16 percent. Use it for planets and cube-map spheres.

Render of Cube sphere with equal-area mapping
The render its check recorded in Godot 4.7.2, 256 by 256 pixels.

What it takes and gives

Entry points
cube_to_sphere, cube_sphere, face_area_ratio, main
Parameters
radius, divisions, mapping
Complexity
O(divisions^2)
Axes
+Y up, metres

Limits. No texture coordinates in the welded mesh; per-face cube-map coordinates need the six faces split apart. Cells are even but not equal (largest over smallest area about 1.16 at 12 divisions with the equal_area mapping, about 4.2 with plain normalization).

Details

Kind
Mesh algorithm
Engine
Python 3.10 or later
Files
10 files, 213.2 KB
Licence
MIT
Declared effects
reads files, runs commands, writes files
Checked with
Godot 4.7.2, gl_compatibility, OpenGL 3 driver, Mesa llvmpipe under Xvfb
Checks
generator runs system python, generator runs verifier python, gltf strict structure, interpreters agree, example matches generator, godot headless gltf load, godot compatibility render
Techniques
Cube to sphere polynomial mapping x sqrt(1 - y^2/2 - z^2/2 + y^2 z^2/3), Integer lattice welding of cube faces
Tags
primitive, sphere, cube sphere, quad sphere, planet, cube map
Identity
library.supply.creative_originals.3428dbd0c45fb47787f52d7e.6b39f714a7b8a0b2
Version
6b39f714a7b8a0b2044cb1bad46bb4073ae47f66a33c21e5cc3e2179b37f8398

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.