成果暂存

This commit is contained in:
2026-07-24 16:03:15 +08:00
parent 662f8d908b
commit fb2a36ac7e
32 changed files with 198341 additions and 12 deletions

89
blender/README.md Normal file
View File

@@ -0,0 +1,89 @@
# Nantaizi Lake Blender scene
This generator combines the source OSM building, water and height tags with
the detailed osm2streets GeoJSON road layers.
## Outputs
- `../outputs/nantaizi-lake-innovation-valley/nantaizi_lake_innovation_valley.blend`
- `../outputs/nantaizi-lake-innovation-valley/nantaizi_lake_innovation_valley.png`
- `../outputs/nantaizi-lake-innovation-valley/nantaizi_lake_innovation_valley_cesium.glb`
- `../outputs/nantaizi-lake-innovation-valley/nantaizi_lake_innovation_valley_cesium.json`
- `../outputs/nantaizi-lake-innovation-valley/nantaizi_cesium_preview.html`
## Regenerate
```bash
/Applications/Blender.app/Contents/MacOS/Blender \
--background \
--factory-startup \
--python blender/generate_nantaizi.py -- \
--osm "/Users/que01/Desktop/南台子湖创新谷OSM.osm" \
--geojson "/Users/que01/osm2streets-qgis-workflow/outputs/nantaizi-lake-innovation-valley/osm2streets_web_out" \
--output "/Users/que01/osm2streets-qgis-workflow/outputs/nantaizi-lake-innovation-valley/nantaizi_lake_innovation_valley.blend" \
--render "/Users/que01/osm2streets-qgis-workflow/outputs/nantaizi-lake-innovation-valley/nantaizi_lake_innovation_valley.png"
```
The OSM file contains distant subway relation members. The generator uses the
explicit OSM `bounds` element to keep the scene limited to the park.
Vegetation is read from the OSM export: `natural=tree` nodes become individual
trees, `natural=tree_row` ways become evenly spaced rows using their height,
`landuse=grass` becomes green ground, and `natural=scrub` becomes low shrub
volumes. `amenity=fountain` nodes become low-poly fountain basins and water
sprays. No trees or fountains are inferred from open ground.
The renderer adds procedural presentation detail without changing OSM massing:
rounded layered crowns and tapered trunks for trees, window bands and roof
equipment for office buildings, and clerestory windows, skylights and roof
equipment for `building=industrial` footprints.
Ordinary `building=yes` footprints below 30 meters are rendered as three-floor
park offices at 11.4 meters plus a small roof unit. Explicit high-rises and all
`building=industrial` heights remain sourced from OSM. White plaster, gray
corrugated iron, grass and bark use 1K CC0 textures downloaded from Poly Haven.
The images used by the scene are packed into the generated `.blend`; source and
license details are recorded in `assets/textures/polyhaven/SOURCES.md`.
OSM ways `117753521` and `117753535` are explicitly rendered as three-floor
white offices because the surveyed site use differs from their current
`building=industrial` tags.
## Export for Cesium
```bash
/Applications/Blender.app/Contents/MacOS/Blender \
--background \
--python blender/export_cesium.py
```
The GLB uses a local east-north-up meter frame centered on the OSM bounds. Its
companion JSON records the WGS84 anchor used by the preview page. The export
script applies mesh modifiers, creates UVs, converts Blender-only materials to
glTF-compatible PBR materials, and embeds the used texture images in the GLB.
For the Cesium preview, use this script rather than Blender's manual glTF
export: it preserves the local ENU placement metadata and bakes/overrides the
building display materials so the web preview stays close to Blender's clean
material-preview look.
You can export directly from Blender for a quick material sanity check, but the
manual GLB will not create/update `nantaizi_lake_innovation_valley_cesium.json`
and therefore will not be positioned automatically by
`nantaizi_cesium_preview.html`.
Serve the output directory over HTTP before opening the preview because web
browsers do not allow the page to fetch GLB/JSON files from `file://`:
```bash
cd outputs/nantaizi-lake-innovation-valley
python3 -m http.server 8765
```
Then open `http://localhost:8765/nantaizi_cesium_preview.html`.
## Blender MCP
The current machine has the `blosm` add-on but no Blender MCP add-on or Codex
MCP server configuration. An MCP workflow requires both sides and a Codex
restart after adding the server. The generator remains useful with MCP because
it creates a stable base scene that can then be edited interactively.