Claude/minecraft heightmap generator dhk a4#14
Merged
stephenkall merged 3 commits intomainfrom May 8, 2026
Merged
Conversation
When crop_poly is set, _crop_to_polygon slices the heightmap to the bounding box and zeroes pixels outside the polygon. The water_map was not being sliced, causing a shape mismatch in build_ocean_mask. - _crop_to_polygon: add extra_bool_maps parameter; applies the same row/col slice and outside-mask to each array in the list - load_save: pass [water_map] as extra_bool_maps so it is cropped together with the heightmap in a single call - stage_load cache-resume: if cached water_map has wrong shape (saved before this fix), discard it rather than crashing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ir above Minecraft heightmap convention: heightmap[z,x] = Y+1 of the topmost solid block (i.e. the first air block from above), not the block itself. The old code used heightmap[z,x] directly, which pointed one above the surface block into air. _is_water(air) is always False, so water_map was all-False everywhere, and candidate & water_map killed all ocean detection. Fix: use heightmap[z,x] - 1 as the block Y to query. Also move y_min/y_max out of the inner loop (micro-optimization). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If the STL dimensions (max_x_mm, max_y_mm) are both <= tile dimensions (tile_x_mm, tile_y_mm), there is no point generating a mosaic — the entire model fits on a single print bed. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixing water_map issues