Pylanet is a procedural planet generator written in Python. It builds a UV sphere, deforms it with layered 3D Perlin noise, assigns biome colors, and exports the result as a vertex-colored PLY mesh. It also includes a local Web UI for generating and inspecting planets interactively.
- Procedural 3D planet meshes
- Configurable resolution, seed, terrain relief, sea level, octaves, gain, continent scale, plains bias, biome bias, and color texture
- Planet presets: earthlike, arid, frozen, oceanic, and volcanic
- Layered biome coloring for oceans, beaches, grasslands, forests, rainforests, savannas, deserts, tundra, rock, snow, basalt, and lava
- CLI export to
planet.ply - WebGL viewer with rotate and zoom controls
- Web UI PLY saving after generation
- Black universe-style background
- No web framework required; the UI runs on Python's built-in HTTP server
python -m venv venv
**Windows:**
```powershell
.\venv\Scripts\Activate.ps1
**Linux/macOS:**
```bash
source venv/bin/activate
```powershell
pip install -r requirements.txtEdit config.yaml, then run:
python main.pyThe mesh is written to the path configured in:
export:
filename: planet.plyOpen the exported PLY in tools such as Blender, MeshLab, or CloudCompare. The file includes RGB vertex colors.
python web.pyOpen:
http://127.0.0.1:8000
Use Generate to rebuild the planet after changing settings. Drag on the planet to rotate it and use the mouse wheel or trackpad scroll to zoom. Use Save PLY to download the current generated mesh with vertex colors.
The Web UI exposes resolution as one slider. The slider controls latitude segments, and longitude is set automatically to a 4:3 ratio for cleaner spherical coverage.
The main controls live in config.yaml.
planet:
preset: earthlike
base_radius: 1.0
resolution:
lat: 180
lon: 240
noise:
seed: 106
amplitude: 0.28
octaves: 6
lacunarity: 2.0
gain: 0.5
terrain:
pattern_scale: 1.0
color_detail: 0.5
plains_bias: 0.0
continent_scale: 0.95
mountain_strength: 0.34
detail_strength: 0.08
moisture: 0.62
temperature: 0.58
ice_caps: 0.35
biome_biases:
ocean: 1.0
desert: 1.0
grassland: 1.0
forest: 1.0
snow: 1.0Useful knobs:
seed: changes the generated world while keeping the same settingsamplitude: increases or reduces terrain heightsea_level: controls how much land is underwaterpattern_scale: changes the overall size of noise patterns across terrain and biomescolor_detail: controls how strongly biome colors are broken up by layered surface textureplains_bias: flattens ridges and compresses elevation to make broader plain areasbiome_biases: controls how strongly each biome competes during classification;1.0is neutralcontinent_scale: lower values create larger landmasses; higher values create smaller, noisier onesmountain_strength: adds sharper ridged terraindetail_strength: adds fine surface variationmoisture,temperature,ice_caps: influence biome placementlat,lon: control mesh resolution
Pylanet/
config.py YAML loader
config.yaml default planet settings
main.py CLI PLY exporter
planetgen.py shared planet generation pipeline
web.py local Web UI server
export/ply.py PLY writer
mesh/sphere.py UV sphere mesh builder
procnoise/perlin.py 3D Perlin/fBM noise
procnoise/deform.py terrain deformation and biome classification
static/ WebGL viewer
High resolutions create larger responses in the Web UI and larger PLY files. The default lat: 180 and lon: 240 gives much sharper biome boundaries; lower it while exploring if generation feels slow.