feat(extract): Flamingo Park in run.py, Parkwege in der Chunk-Ausgabe

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
knsoandClaude Sonnet 5 committed 2026-09-16 08:00:07 +02:00
1 parent 2ef9e6774a
commit 442f5b2ada
5 files changed
+64 -12

No files matched your search

+3 -1
View File
@@ -39,7 +39,7 @@ def _rings(poly: Polygon, i: int, j: int) -> list[list[list[float]]]:
for ring in (poly.exterior, *poly.interiors)]
def chunk_payload(i, j, *, land, surfaces, roads, centerlines, buildings, palms) -> dict:
def chunk_payload(i, j, *, land, surfaces, roads, centerlines, buildings, palms, paths=()) -> dict:
ox = SLICE["x0"] + i * CHUNK_SIZE
oy = SLICE["y1"] - j * CHUNK_SIZE
return {
@@ -52,6 +52,8 @@ def chunk_payload(i, j, *, land, surfaces, roads, centerlines, buildings, palms)
"buildings": [{"poly": _rings(p, i, j), "height": h["height"],
"source": h["source"], "speculative": s} for p, h, s in buildings],
"palms": [[round(x - ox, 2), round(-y + oy, 2)] for x, y in palms],
# Parkwege (Flamingo Park, docs/superpowers/specs/2026-09-15-flamingo-park-design.md), aufgebaut wie roads.
"paths": [{"poly": _rings(p, i, j)} for p in paths],
}
+14
View File
@@ -522,3 +522,17 @@ def apply_park(world: World, layout: ParkLayout, seed: int) -> World:
palms += palm_points([], _polygons(lawn), [], [] if blocked.is_empty else [blocked], [], [], seed)
return replace(world, roads=roads, centerlines=centerlines, surfaces=surfaces,
buildings=buildings, palms=palms, paths=world.paths + layout.paths)
def apply_flamingo_park(world: World, config_path: Path, seed: int) -> tuple[World, list[str]]:
"""Alles für Flamingo Park in der Reihenfolge der Spec: Ecken prüfen, Jefferson Avenue, Park."""
config = load_park(config_path)
check_corners(config, world.roads)
world = apply_street(world, config.street)
fit = ParkFit(config)
layout = build_layout(load_elements(config.osm_path), config, fit)
world = apply_park(world, layout, seed)
messages = [f"Warnung: {warning}" for warning in layout.warnings]
messages.append(f"Flamingo Park: {len(layout.paths)} Wegflächen, {len(layout.surfaces)} Flächen, "
f"{len(layout.buildings)} Gebäude, Jefferson Avenue {config.street.width:g} m breit")
return world, messages