ここまでの 地形万華鏡OS(惑星生成エンジン) のモジュールを全部そろえた今、
「典型的な使い方(処理順序と呼び出す関数)」を OS の公式パイプラインとしてまとめるね。

あなたが作ったモジュール構造はすでに OS そのもの。
ここでは 実際に Python で惑星を生成する時の“流れ” を、
Planet → Noise → Height → Terrain → Biome → Chunk → Export
の順に、関数名まで明確に示す。


🌍 地形万華鏡OS:典型的な処理順序

以下は 1 惑星を生成 → Chunk をサンプリング → PNG を出力
までの一連の流れ。


🟥 ① PlanetParameters を作る(惑星の基本 OS)

from terrain_kaleidoscope.planet.parameters import PlanetParameters

params = PlanetParameters(
    seed=12345,
    radius=6371.0,
    sea_level=0.45,
    pixel_size=1.0,
    axial_tilt=23.4,
    solar_intensity=1.0,
    plate_activity=0.8
)

🟦 ② PlanetSpace / OctaSpace で座標変換を準備

from terrain_kaleidoscope.planet.planet_space import latlon_to_vector
from terrain_kaleidoscope.planet.octaspace import vector_to_octa

典型的には:

(lat, lon) → vector → (U, V)

🟩 ③ NoiseSpace(大陸・山脈・湿度・気温)を計算

from terrain_kaleidoscope.noise.fbm import fbm
from terrain_kaleidoscope.noise.ridge import ridge_noise
from terrain_kaleidoscope.noise.humidity import humidity_noise
from terrain_kaleidoscope.noise.temperature import temperature_noise

典型的な使い方:

continent = fbm(U, V, freq=1.2, octaves=5, seed=params.seed)
mountain   = ridge_noise(U, V, freq=6.0, octaves=4, seed=params.seed)
humidity   = humidity_noise(U, V, seed=params.seed)
temperature = temperature_noise(U, V, seed=params.seed)

🟫 ④ HeightSpace(連続標高関数)を計算

from terrain_kaleidoscope.height.heightmap import compute_height
height = compute_height(U, V, params)

🟫 ⑤ TerrainSpace(海・陸・山・河川)を分類

from terrain_kaleidoscope.terrain.terrain_type import classify_terrain
terrain_type = classify_terrain(height, slope=None, flow=None)

※ slope / flow は後で追加可能。


🌱 ⑥ BiomeSpace(森林・砂漠・ツンドラ・湿地)を分類

from terrain_kaleidoscope.biome.biome_type import (
    compute_temperature,
    compute_humidity,
    classify_biome
)
T = compute_temperature(lat, height, params)
H = compute_humidity(U, V, params)
biome = classify_biome(T, H, height, params.sea_level)

🟦 ⑦ ChunkSpace(256×256 タイル)を決定

from terrain_kaleidoscope.chunk.chunk_index import chunk_from_uv
from terrain_kaleidoscope.chunk.chunk_sampler import sample_chunk
chunk_id = chunk_from_uv(U, V)
chunk_data = sample_chunk(chunk_id, compute_height, classify_biome)

🟧 ⑧ Export(Roblox 用 PNG を生成)

from terrain_kaleidoscope.export.png_heightmap import export_heightmap
from terrain_kaleidoscope.export.png_materialmap import export_materialmap
export_heightmap(chunk_data, "chunk_12_34_height.png")
export_materialmap(chunk_data, "chunk_12_34_material.png")

🟪 ⑨ Roblox(表示 OS)で読み込む

Roblox 側は writevoxels_template.lua を使うだけ。


🌌 まとめ:地形万華鏡OSの公式パイプライン

PlanetParameters(惑星パラメータ)
    ↓
PlanetSpace / OctaSpace(座標系)
    ↓
NoiseSpace(大陸・山脈・湿度・気温)
    ↓
HeightSpace(連続標高関数)
    ↓
TerrainSpace(海・陸・山・河川)
    ↓
BiomeSpace(森林・砂漠・ツンドラ)
    ↓
ChunkSpace(256×256)
    ↓
Export(PNG)
    ↓
Roblox(表示OS)

この順序が 地形万華鏡OSの正しい使い方で、
あなたが作ったモジュール構造と完全に一致している。


🌟 次に深めるなら…

  • HeightSpace の公式をもっと自然にする
  • 河川(flow map)を追加する
  • BiomeSpace を 12 種類に拡張する
  • ChunkSpace を並列化する
  • Roblox Lua の最適化(WriteVoxels の高速化)

どこに進めたい?