# Hallway nook: a dead-end nook from its owner's sizes, in metres: 120 cm wide, the wall on the left
# 210 long, the bathroom door on the right and 121 cm of wall after it. Storage that keeps it open:
# a chest on the end wall under a round mirror, a slim cabinet 25 cm deep on the long wall, 95 cm
# left to walk. Sizes are written in cm and turned into metres by c; the wall after the door is cut
# at 1 m to look in.
units("m")
c = 0.01
H = 240
plaster = "#eceae6"

def wall(x0, y0, x1, y1, z0=0, z1=H, name="wall", color=plaster):
    return box((x1 - x0) * c, (y1 - y0) * c, (z1 - z0) * c, at=(x0 * c, y0 * c, z0 * c), name=name, color=color)

box(1.4, 2.9, 0.05, at=(-0.1, -0.7, -0.05), name="floor", color="#c9c2b6")
wall(-10, 0, 0, 210, name="long wall")
wall(-10, 210, 130, 220, name="end wall")
wall(120, 89, 130, 210, 0, 100, name="wall after the door (cut)")
wall(120, 0, 130, 4, 0, 100, name="door jamb")
box(0.04, 0.83, 1.0, at=(1.23, 0.05, 0), name="bathroom door", color="#f6f5f2")
box(0.03, 0.12, 0.02, at=(1.20, 0.72, 0.95), name="door handle", color="#2b2b2e")

ch = chest_of_drawers(w=100, d=40, h=85, at=(0.10, 1.6, 0))
ch.move(0, 2.10 - ch.max[1], 0)
cylinder(0.35, 0.02, at=(0.60, 2.08, 1.45), axis="y", name="mirror", color="#cfd8dc")
box(0.25, 1.0, 0.9, at=(0, 0.55, 0), name="slim cabinet", color="#e8e4dc")
box(0.27, 1.02, 0.02, at=(0, 0.54, 0.9), name="slim cabinet top", color="oak")

dim((0, -0.15, 0), (1.2, -0.15, 0), offset=0.001, text="120")
dim((0.25, 1.0, 0), (1.2, 1.0, 0), offset=0.001, text="95 to walk")
dim((1.3, 0.89, 1.0), (1.3, 2.1, 1.0), offset=0.15, text="121")
dim((0, 0, H * c), (0, 2.1, H * c), offset=-0.15, text="210")
label("chest 100 x 40 under a mirror", at=(0.6, 1.85, 1.95))
label("slim cabinet 100 x 25", at=(0.12, 1.05, 1.25), to=(0.12, 1.05, 0.92))
label("bathroom door", at=(1.75, 0.45, 0.6))
