Refactor road assembly module
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
│ osmassets/materials.py 材质构建(消费 catalog 的声明) │
|
||||
│ osmassets/tree.py 树实例化 │
|
||||
│ osmassets/water.py grass.py scrub.py │
|
||||
│ osmassets/building.py fountain.py 要素装配 │
|
||||
│ osmassets/building.py fountain.py roads.py 要素装配 │
|
||||
│ │
|
||||
│ generate_scene.py export_cesium.py 两个入口 │
|
||||
│ tools/scene_digest.py 结构摘要工具 │
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
| 文件 | 行数 | 层 |
|
||||
|---|---|---|
|
||||
| `generate_scene.py` | 899 | bpy · 入口 |
|
||||
| `generate_scene.py` | 869 | bpy · 入口 |
|
||||
| `export_cesium.py` | 647 | bpy · 入口 |
|
||||
| `osmassets/tree.py` | 318 | bpy |
|
||||
| `osmassets/geom.py` | 241 | 纯 |
|
||||
@@ -129,7 +129,7 @@
|
||||
| `osmassets/catalog.py` | 197 | 纯 |
|
||||
| `osmassets/mesh.py` | 126 | bpy |
|
||||
| `osmassets/osm.py` | 89 | 纯 |
|
||||
| `osmassets/building.py` / `fountain.py` | 56 / 49 | bpy |
|
||||
| `osmassets/building.py` / `fountain.py` / `roads.py` | 56 / 49 / 40 | bpy |
|
||||
| `osmassets/water.py` / `grass.py` / `scrub.py` | 15 / 22 / 13 | bpy |
|
||||
| `tools/scene_digest.py` | 171 | bpy · 工具 |
|
||||
| `tests/test_pure.py` | 372 | 纯 · 测试 |
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
osmassets/materials.py 材质构建
|
||||
osmassets/tree.py 树实例化
|
||||
osmassets/water.py grass.py scrub.py
|
||||
osmassets/building.py fountain.py 要素装配
|
||||
osmassets/building.py fountain.py roads.py 要素装配
|
||||
generate_scene.py export_cesium.py 两个入口脚本
|
||||
tools/scene_digest.py 结构摘要工具
|
||||
```
|
||||
@@ -54,6 +54,7 @@
|
||||
| `water.py` / `grass.py` / `scrub.py` | bpy | 单一 OSM 面要素的装配 |
|
||||
| `building.py` | bpy | 单一 OSM 面要素 `building=*` 的装配 |
|
||||
| `fountain.py` | bpy | 单一 OSM 点要素 `amenity=fountain` 的装配 |
|
||||
| `roads.py` | bpy | osm2streets GeoJSON road layer 装配与 OSM highway 折线回退 |
|
||||
|
||||
### `geom.py` 的两条隐含约定
|
||||
|
||||
@@ -111,6 +112,18 @@ def assemble(ring, way_id, tag, office_overrides, collection, materials):
|
||||
`counts["industrial_count"]`,以及写 `scene["office_override_way_ids"]`。
|
||||
模块只负责 prism / roof / windows / bevel / building custom properties。
|
||||
|
||||
`roads.py` 是 road layer 装配模块,不拥有图层表或计数:
|
||||
|
||||
```python
|
||||
def assemble_geojson_layer(path, layer_id, projector, collection, material, z): ...
|
||||
def assemble_osm_fallback(ways, projector, collection, material): ...
|
||||
```
|
||||
|
||||
`generate_scene.py` 仍负责创建 `road_mats`、调用 `catalog.check_layers()` 并打印
|
||||
`Layer catalog warning:`、遍历 `catalog.ROAD_LAYERS`、维护 `road_counts`,以及写
|
||||
`scene["road_feature_counts"]` / `SCENE_DONE["road_features"]`。模块只负责把已选定的
|
||||
GeoJSON layer 或 OSM fallback ways 变成 `Road_<layer_id>` / `OSM_Road_<way_id>` 对象。
|
||||
|
||||
### 加一种新 OSM 要素
|
||||
|
||||
目标形态:**新增一个模块 + 注册一行,不改 `build()`**。
|
||||
|
||||
Reference in New Issue
Block a user