fix(simulation): Layer-1 self-describing grid dims + Moore basin trace (#960)
Two Layer-1 generation fixes surfaced by the per-layer atlas viewer: - Layer1Output now carries grid_w/grid_h (the downsampled working-grid the positions live in). The client maps overlays from these, so the scale is correct for any source heightmap resolution rather than assuming the texture size — fixes overlays projecting at half scale into a corner. - Drainage basin boundaries are traced as ordered, non-self-crossing contours via Moore-neighbour tracing instead of an angle-from-centroid sort. The sort produced star-shaped, self-crossing polygons for concave basins that rendered as straight chords across the map. Golden (cascade_layer1.json) and the cross-language atlas_response_ready fixture regenerated. 100 atlas lib tests + the new tracer test pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,10 @@ pub fn handle_atlas_request(
|
||||
river_network: state.river_network.clone(),
|
||||
drainage_basins: state.drainage_basins.clone(),
|
||||
attractors: state.attractors.clone(),
|
||||
// The cascade ran on the downsampled heightmap, so its dims are the
|
||||
// working grid all Layer-1 positions are expressed in (#960).
|
||||
grid_w: state.heightmap_width,
|
||||
grid_h: state.heightmap_height,
|
||||
};
|
||||
return AtlasLayerResponse {
|
||||
body_id: req.body_id.clone(),
|
||||
|
||||
Reference in New Issue
Block a user