Untitled
unknown
plain_text
10 months ago
1.9 kB
19
Indexable
import matplotlib.pyplot as plt
import matplotlib.patches as patches
# Room dimensions (in meters)
room_width = 5.42
room_length = 7.22
# Border width (in meters)
border_width = 0.15
# Create figure and axis
fig, ax = plt.subplots(figsize=(10, 13))
ax.set_xlim(0, room_width)
ax.set_ylim(0, room_length)
ax.set_aspect('equal')
ax.set_title('Tile Layout Overview (Not to Scale)', fontsize=14)
# Draw the full room (outer rectangle)
room = patches.Rectangle((0, 0), room_width, room_length, linewidth=1.5, edgecolor='black', facecolor='lightgrey', label='Room Area')
ax.add_patch(room)
# Draw the inner field area (excluding border)
inner_width = room_width - 2 * border_width
inner_length = room_length - 2 * border_width
field = patches.Rectangle((border_width, border_width), inner_width, inner_length, linewidth=1.5, edgecolor='green', facecolor='white', label='Field Area (Octagon Sage + Helix)')
ax.add_patch(field)
# Add helix tiles (randomly placed for visual, not exact)
# We'll place 3 rows of 6 tiles
helix_tile_size = 0.45
rows = 3
cols = 6
start_x = border_width + 0.3
start_y = border_width + 0.3
for i in range(rows):
for j in range(cols):
x = start_x + j * (helix_tile_size + 0.1)
y = start_y + i * (helix_tile_size + 0.1)
if x + helix_tile_size < room_width - border_width and y + helix_tile_size < room_length - border_width:
tile = patches.Rectangle((x, y), helix_tile_size, helix_tile_size, edgecolor='darkgreen', facecolor='lightgreen', linewidth=1, label='Sage Helix' if i == 0 and j == 0 else "")
ax.add_patch(tile)
# Add legend
handles, labels = ax.get_legend_handles_labels()
by_label = dict(zip(labels, handles))
ax.legend(by_label.values(), by_label.keys(), loc='upper right')
# Hide axes
ax.axis('off')
plt.tight_layout()
plt.show()
Editor is loading...
Leave a Comment