# Kitchen with a peninsula: a gutted 15.8 x 10 ft kitchen laid out for its owner, in feet. The range
# wall keeps the fridge, the range under a hood and wall units; the sink and the dishwasher go under
# the window; a peninsula just under 9 ft with four stools closes the room to the living room and
# stops 3 ft short of the partition, so there is a second way in. The dimensions are the clearances
# that were checked. x: 0 = west wall, 15.83 = window wall; y: 10 = range wall, 0 = the partition's
# line, below 0 = the living room. The library's sizes are in cm: c turns them into feet.
units("ft")
c = 1 / 30.48
W = "#f3f1ec"
CAB = "#e8e4dc"
TOP = "#c9a27a"
box(16.63, 14.9, 0.1, at=(-0.4, -4.5, -0.1), name="floor", color="oak planks")
box(16.63, 0.4, 8, at=(-0.4, 10, 0), name="north wall", color=W)
east = box(0.4, 14.5, 8, at=(15.83, -4.5, 0), name="east wall", color=W)
box(0.4, 10.8, 8, at=(-0.4, -4.5, 0), name="west wall", color=W)
box(0.4, 1, 8, at=(-0.4, 9, 0), name="west wall, north end", color=W)
box(0.4, 2.7, 1.33, at=(-0.4, 6.3, 6.67), name="over the doorway", color=W)
box(0.4, 3, 8, at=(3.5, 0, 0), name="partition (stays)", color=W)
window(w=183, h=107, panes=3, at=(15.9, 3, 3.5), turn=90, wall=east)

# range wall
x = 3.5
fridge(w=91, d=75, h=178, at=(x, 10 - 75 * c, 0))
x1 = x + 91 * c
base_unit(w=87, d=61, h=91, kind="drawers", at=(x1, 10 - 61 * c, 0))
x2 = x1 + 87 * c
base_unit(w=76, d=61, h=91, kind="hob_oven", at=(x2, 10 - 61 * c, 0))
x3 = x2 + 76 * c
base_unit(w=61, d=61, h=91, kind="doors", at=(x3, 10 - 61 * c, 0))
x4 = x3 + 61 * c
xe = 15.83 - 61 * c
wall_units(w=91, d=45, h=35, lift=180, at=(x, 10 - 45 * c, 180 * c))
wall_units(w=87, d=33, h=76, lift=137, at=(x1, 10 - 33 * c, 137 * c))
wall_units(w=121, d=33, h=76, lift=137, at=(x3, 10 - 33 * c, 137 * c))
box(76 * c, 1.6, 0.4, at=(x2, 8.4, 5.5), name="hood", color="#c9ccd2")
box(0.9, 0.9, 1.1, at=(x2 + 38 * c - 0.45, 9.1, 5.9), name="hood duct", color="#c9ccd2")

# window wall: dishwasher and sink
y = 2.0
base_unit(w=15, d=61, h=91, kind="doors", at=(xe, y, 0), turn=270)
y1 = y + 15 * c
base_unit(w=61, d=61, h=91, kind="dishwasher", at=(xe, y1, 0), turn=270)
y2 = y1 + 61 * c
base_unit(w=91, d=61, h=91, kind="sink", at=(xe, y2, 0), turn=270)
y3 = y2 + 91 * c
base_unit(w=15, d=61, h=91, kind="doors", at=(xe, y3, 0), turn=270)
y4 = y3 + 15 * c
box(15.83 - x4, 10 - y4, 87 * c, at=(x4, y4, 0), name="corner unit", color=CAB)
box(15.83 - x4, 10 - y4, 4 * c, at=(x4, y4, 87 * c), name="corner top", color=TOP)

# peninsula off the window wall, stopped 3 ft short of the partition
p3 = xe - 76 * c
p2 = p3 - 76 * c
p1 = p2 - 57 * c
base_unit(w=57, d=61, h=91, kind="doors", worktop=False, at=(p1, 0, 0), turn=180)
base_unit(w=76, d=61, h=91, kind="pan_drawers", worktop=False, at=(p2, 0, 0), turn=180)
base_unit(w=76, d=61, h=91, kind="drawers", worktop=False, at=(p3, 0, 0), turn=180)
box(15.83 - xe, 1.97, 87 * c, at=(xe, 0.03, 0), name="peninsula corner", color=CAB)
box(xe - 6.9, 3.33, 4 * c, at=(6.9, -1.25, 87 * c), name="peninsula top", color=TOP)
box(15.83 - xe, 3.25, 4 * c, at=(xe, -1.25, 87 * c), name="peninsula top, corner", color=TOP)
for sx in [8.0, 10.0, 12.0, 14.0]:
    bar_stool(w=40, h=65, at=(sx - 0.66, -2, 0))

# the clearances that were checked
dim((3.9, 0.9, 0), (6.9, 0.9, 0), offset=0)
dim((6.9, -2.7, 0), (15.83, -2.7, 0), offset=0)
dim((3.7, 3, 0), (3.7, 7.54, 0), offset=0)
dim((6.7, 2.08, 0), (6.7, 8, 0), offset=0)
label("second way in", at=(4.4, -3.6, 0), to=(5.4, 0.2, 0))
