# Lounge with a fireplace: a 643 x 465 cm room from its owner's hand plan, in metres with the sizes written
# in cm (c). The fireplace is on the long wall, the TV stays in its corner by the conservatory doors, the
# garden window is at the other end, the door from the hallway in the far corner; the piano, a storage unit
# and the bookcase (moved beside the piano) stay. A sofa is floated to face the fire with a 110 cm walkway
# behind it, a two-seater stands at a right angle on the garden side. The hallway wall is cut low to look in.
# x: 0 = conservatory wall, 643 = garden wall; y: 0 = hallway wall, 465 = fireplace wall.
units("m")
c = 0.01
L, Wd, H, t = 643, 465, 250, 15
plaster = "#f1eee8"

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((L + 2 * t) * c, (Wd + 2 * t) * c, 0.05, at=(-t * c, -t * c, -0.05), name="floor", color="#cdc6b8")
wall(-t, Wd, L + t, Wd + t, name="fireplace wall")
left = wall(-t, -t, 0, Wd, name="conservatory wall")
right = wall(L, -t, L + t, Wd, name="garden wall")
wall(0, -t, 540, 0, 0, 55, name="hallway wall (cut)")
window(w=228, h=205, panes=4, at=(-0.115, 1.32, 0.02), turn=90, wall=left)
window(w=250, h=140, panes=3, at=(6.465, 1.31, 0.85), turn=90, wall=right)
box(0.08, 2.0, 0.6, at=(6.35, 1.55, 0.15), name="radiator", color="#f4f2ee")
box(2.2, 0.08, 0.4, at=(0.5, 0, 0.12), name="radiator 2", color="#f4f2ee")

# ---- the chimney breast: fire, hearth, mantel, mirror ----
wall(245, 430, 393, Wd, name="chimney breast")
box(0.6, 0.02, 0.66, at=(2.89, 4.28, 0.04), name="fire", color="#2b2b2e")
box(1.28, 0.35, 0.04, at=(2.55, 3.95, 0), name="hearth", color="gray stone")
box(1.58, 0.14, 0.08, at=(2.4, 4.16, 1.1), name="mantel", color="#e6dcc8")
cylinder(0.45, 0.02, at=(3.19, 4.28, 1.75), axis="y", name="mirror", color="#cfd8dc")

# ---- what stays: the TV in the corner, the piano and its stool, the storage unit; the bookcase moved beside the piano ----
tv_unit(w=120, d=40, h=50, at=(0.08, 3.5, 0), turn=45)
tv = box(1.1, 0.05, 0.65, at=(0.66, 4.08, 0.825), center=True, name="TV", color="#1e1f22")
tv.rotate(45, axis="z")
box(1.5, 0.6, 1.25, at=(4.1, 4.05, 0), name="piano", color="#3a1f1a")
box(1.5, 0.25, 0.08, at=(4.1, 3.8, 0.62), name="piano keys", color="#3a1f1a")
box(0.6, 0.35, 0.48, at=(4.55, 3.38, 0), name="piano stool", color="#3a1f1a")
bookcase(w=75, d=30, h=200, at=(5.66, 4.35, 0))
sideboard(w=115, d=40, h=80, at=(4.22, 0, 0), turn=180)

# ---- the new seating ----
sofa(w=220, d=95, at=(1.9, 1.2, 0), turn=180)
sofa(w=170, d=90, seats=2, at=(4.7, 1.3, 0), turn=270)
rug(w=240, d=170, at=(2.0, 2.25, 0))
coffee_table(w=110, d=60, h=42, at=(2.45, 2.6, 0.012))

# ---- notes ----
dim((3.0, 0.08, 0), (3.0, 1.2, 0), offset=0.001, text="110 cm walkway")
dim((3.9, 3.2, 0), (3.9, 3.95, 0), offset=0.001, text="75")
dim((0, Wd * c, H * c), (L * c, Wd * c, H * c), offset=-0.25, text="643")
dim((L * c, 0, H * c), (L * c, Wd * c, H * c), offset=0.25, text="465")
label("TV stays in its corner", at=(0.9, 4.2, 1.9), to=(0.66, 4.08, 1.2))
label("conservatory doors", at=(-1.3, 2.4, 0.4))
label("garden window", at=(7.6, 2.6, 1.2))
label("door from the hallway", at=(5.9, -0.25, 1.0))
label("piano", at=(4.85, 4.35, 1.6))
