fullseye

mesh_scatter_boulders — 3D terrain op

使い方

Scatter partly-buried boulders on a mesh (power-law sizes, seeded) → (V, F)

(or (V, F, info) with return_info=True).

shape='ellipsoid' (default, unchanged behaviour): icosphere ellipsoids with semi-axes D/2 × aspect (1 : 0.7 : 0.5, shortest axis along the local surface normal), spun about the normal and sunk by embed (0 = resting, 1 = centre on the surface). shape='hull': angular blocks — the convex hull of seeded random points on an ellipsoid of the same aspect with 20 % radial jitter (flat facets, sharp edges, the look of Itokawa’s boulders), hull_points per block (default size-dependent: 10 + 8·log2(D/d_min), 10..40). orientation='random' gives each block a uniform random rotation instead of aligning its short axis with the normal. For hulls the sink is the size-dependent burial fraction from :func:sample_boulders (30–60 % of the block’s height below the surface by default; embed is ignored). max_count caps the expected number by raising d_min along the same law (see :func:sample_boulders; info['d_min_effective'] reports it).

Placement and sizes come from :func:sample_boulders (Poisson process, N(>D) ∝ D^-exponent); boulders sit on the mesh as passed — pass the displaced / subdivided terrain so they rest on the final surface. region_weights from :func:terrain_region_mask keeps the seas smooth. The boulders are appended as real geometry, so they self-shadow, cast shadows and occlude through the same rasteriser / ray-cast path as the terrain. info = the sample dict plus faces_per_boulder and n_boulders. Deterministic under seed. Fail-closed.

手順: :func:sample_boulders で位置(面上の一様点)・面法線・直径 D を引き、岩ごとに 小さなメッシュを作って入力メッシュの後ろに連結する(頂点は末尾に追加、面 index は オフセット済み)。入力の頂点・面はそのまま残るので、info['faces_per_boulder'] と 元の面数から岩の面だけを切り出せる。

岩は実ジオメトリなので ambient_occlusion / cast_shadow / shadow_raycast の レイに普通に当たる。置く面は渡したメッシュそのものなので、mesh_displace_spectrummesh_subdivide に呼ぶこと(先に呼ぶと岩が地面から浮く/埋まる)。

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

実行できる例(この 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_edge_lengths · mesh_subdivide · displacement_band_weights · mesh_displace_spectrum · 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.