Skip to content

Enhancement/map2png objshow#28

Merged
voshch merged 6 commits into
voshch:humblefrom
asympto712:enhancement/map2png-objshow
Mar 24, 2026
Merged

Enhancement/map2png objshow#28
voshch merged 6 commits into
voshch:humblefrom
asympto712:enhancement/map2png-objshow

Conversation

@asympto712
Copy link
Copy Markdown

Overview

added static object bounding boxes to .png export from Map

Changes

  • Wall class generate_png:
    changed so that it will take optional arguments for tuple of object name and shapely polygon to draw grey rect on entity position
  • WorldDescription class render
    modified to work with the new generate_png method

rendered image example

exported from AIrchitect app
map

# get the corners for entity

# if dimension is given as extra property, use it
_width = entity.asdict(expand_extra=True).get("width")
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear to me how the width/heights would be provided in practice. Picture in the PNG seems to have all default widths.
Are there any current use cases where width/height is explicitly passed?

import shapely
import math

staticObjects: list[tuple[str, shapely.Polygon]] = []
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drawing objects should be entirely optional. Default behavior of touch_world script must remain unchanged.

@asympto712
Copy link
Copy Markdown
Author

fixed it following suggestions

@asympto712
Copy link
Copy Markdown
Author

Update

found some errors and corrected it, here is an actual instance of exported map.png
map

@voshch voshch self-requested a review March 24, 2026 12:52
@voshch voshch merged commit faf9427 into voshch:humble Mar 24, 2026
voshch added a commit that referenced this pull request Mar 24, 2026
voshch added a commit that referenced this pull request Mar 24, 2026
(cherry picked from commit 9785cf9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants