โ† All examples

mesh algorithms

Cube sphere with equal-area mapping

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.

Recorded render of Cube sphere with equal-area mapping

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • component.json
  • cube_sphere.py
  • example.gltf
  • meshkit.py
  • preview.png
  • test_package.py
  • verification/native.json

How it works

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

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • generator_runs_system_python
  • generator_runs_verifier_python
  • gltf_strict_structure
  • interpreters_agree
  • example_matches_generator
  • godot_headless_gltf_load
  • godot_compatibility_render

Limits to consider

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).