fullseye

mesh_displace_spectrum — 3D terrain op

使い方

Displace vertices along their normals with a stated amplitude spectrum, band-limited

per vertex → (V, F).

displacement_i = Σ_k A_k · n_k(x_i) · gate_k(i) · w_k(i) with one seeded value-noise octave n_k ∈ [−1, 1] per (wavelength_k, amplitude_k) pair (mesh units — the Itokawa STL is in km, so the default is 3 m at 60 m falling as A ∝ λ^0.77 to 0.35 m at 3.75 m), gate = :func:displacement_band_weights on this mesh (an octave shorter than nyquist × local edge is not applied — it would alias into facet noise; route it to :func:bump_normals_fbm instead) and weights = optional (N,) per-vertex or (K, N) per-octave-per-vertex factor in [0,1] (e.g. the synthetic-relief weight 1 − gate of the source model). The peak displacement at a vertex is at most Σ_k A_k (tests pin it). Unlike :func:mesh_displace_fbm (one amplitude, octave ratio 2, no band limit) every octave’s amplitude is explicit. Deterministic under seed. Fail-closed on shapes / non-finite / negative values.

手順: (1) :func:displacement_band_weightsgate (K,N) を作る、(2) weights が あれば掛ける、(3) オクターブ k ごとに seed 固定の value noise n_k(x) ∈ [-1,1](波長 λ_k、格子オフセットはオクターブ番号で変える)を評価し Σ_k A_k · gate_k · n_k を法線方向の変位にする、(4) 面積重み付き頂点法線に沿って 頂点を動かす。返り値 (V' (N,3) float64, F のコピー)

mesh_displace_fbm との違いは、振幅をオクターブごとに明示すること、頂点ごとに 辺長で帯域を切ること。粗いメッシュに短波長を与えても折り返さず、単に無視される。

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(mesh を入力に取れる)

mesh_to_voxel · mesh_to_points · to_points · fuse_to_voxel · ambient_occlusion · cast_shadow · supersample_mesh · render_beauty

同カテゴリ(terrain)

mesh_displace_fbm · terrain_region_mask · mesh_scatter_boulders · mesh_edge_lengths · mesh_subdivide · displacement_band_weights · bump_normals_fbm


Provenance: render3d.py — 3D operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.