Refactor fountain assembly module
This commit is contained in:
@@ -50,7 +50,8 @@
|
||||
| `mesh.py` | bpy | `MeshBatch`、`make_prism`、`add_roof`、`add_wall_panel`、`add_polyline`、集合管理 |
|
||||
| `materials.py` | bpy | 把 `catalog` 的规格变成真实材质:`from_spec()`、贴图、程序化噪声、tint、alpha-clip |
|
||||
| `tree.py` | bpy | 两个 vendored 模型 → 一套可实例化的运行时形状 |
|
||||
| `water.py` / `grass.py` / `scrub.py` | bpy | 单一 OSM 要素的装配 |
|
||||
| `water.py` / `grass.py` / `scrub.py` | bpy | 单一 OSM 面要素的装配 |
|
||||
| `fountain.py` | bpy | 单一 OSM 点要素 `amenity=fountain` 的装配 |
|
||||
|
||||
### `geom.py` 的两条隐含约定
|
||||
|
||||
@@ -62,7 +63,7 @@
|
||||
|
||||
## 要素模块的统一形状
|
||||
|
||||
`water.py` / `grass.py` / `scrub.py` 三个要素模块签名一致:
|
||||
`water.py` / `grass.py` / `scrub.py` 三个面要素模块签名一致:
|
||||
|
||||
```python
|
||||
def assemble(ring, [way_id,] scene_xmin, scene_xmax, scene_ymin, scene_ymax,
|
||||
@@ -83,6 +84,17 @@ def assemble(ring, [way_id,] scene_xmin, scene_xmax, scene_ymin, scene_ymax,
|
||||
的 `focus`)
|
||||
4. **不自己找数据**。ring 由 `generate_scene.py` 传入,模块只负责装配
|
||||
|
||||
`fountain.py` 是点要素模块,不收 ring 或裁剪边界:
|
||||
|
||||
```python
|
||||
def assemble(name, x, y, collection, materials):
|
||||
...
|
||||
```
|
||||
|
||||
`generate_scene.py` 仍负责过滤 `amenity=fountain`、检查点是否在范围内、投影坐标、
|
||||
创建三张 fountain 材质,并维护 `counts["fountain_count"]`。模块只负责在已投影
|
||||
坐标上创建 basin / water / pedestal / spray objects,保持对象名和自定义属性不变。
|
||||
|
||||
### 加一种新 OSM 要素
|
||||
|
||||
目标形态:**新增一个模块 + 注册一行,不改 `build()`**。
|
||||
|
||||
Reference in New Issue
Block a user