Turning Stair — an ArchLang floor plan example
A small house with a quarter-turn stair: one stair of flights and a landing, the same block on both floors.
Level 1 (Ground floor) compiles to 2 rooms, 30.4 m² of floor area and 2 windows; every room is reachable from the entrance.
This is a 2-level plan: a storey is a drawing, so the compiler produces one sheet per level and the drawing above is level 1. The command line writes one file per level, and the playground's preview has a storey switcher. Each storey measures:
- Level 1 (Ground floor) — 2 rooms, 30.4 m² of floor area, 2 windows.
- Level 2 (First floor) — 2 rooms, 30.4 m² of floor area, 2 windows.
What this plan uses
The parts of the language this plan's source writes, each linked to its section of the language reference.
- Paper and scale
- Walls from rooms
- Rooms
- Doors
- Windows
- Automatic dimension chains
- Stairs, elevators and escalators
- Roofs (the eaves line)
- Levels (storeys)
The source
This is the whole plan. The drawing above is what the compiler produced from it — nothing was drawn by hand.
# A small house with a quarter-turn stair: one `stair` of flights and a landing, not two stairs.
#
# THE BLOCK IS WRITTEN TWICE AND CHANGES ONE WORD. Pieces are in climbing order on every storey,
# so the upper level copies the block and says `dir down`: `dir up` boards the first flight's foot,
# `dir down` the last flight's head. Each flight's direction comes from what it touches, never from
# its long side, and the same id on both levels is one shaft, as it is for a straight stair.
#
# THE FLOOR IN THE NOTCH IS FLOOR. The box round the pieces holds the corner the hall is walked
# through, and nothing reads that box: the walk, the rooms and lint all read the pieces.
#
# THE HEIGHT DRAWS NOTHING. `height 2750` is 13 risers of 220 mm at most, so a straight flight owes
# 12 goings, 2640 mm. A flight ends on its landing as the top flight ends on the floor above, so this
# one owes 11 goings and a landing, 2420 mm of flights, and each flight must hold its goings whole.
# These two hold 6 goings each, because the lint profiles ask for more: 12 goings of 254 mm in
# `us-residential-advisory` is 3048 mm, and 1540 + 1530 is 3070. Cut both flights to 1210 and they
# still sum to 2420 mm, but hold 5 goings each, so `W_STAIR_TOO_STEEP` reports the whole stair, once.
# The first flight is 1540, not 1530, for the treads it draws (one per 280 mm, rounded): 6 + 5 are
# 13 risers of about 212 mm, where 5 + 5 were 12 of about 229 (`W_STAIR_RISER_TOO_HIGH`).
# `arch describe --json --facts clearances` prints the two figures, and `describe` reports the
# flights, the landing and the turn. These are arithmetic on the plan's own numbers, and no statement
# that it complies.
plan "Turning stair" {
units mm
grid 10
height 2750
paper A3 landscape
north up
dims auto all
level 1 "Ground floor" {
room id=hall at (0,0) size 3700x3800 label "Hall" at (1700,1900) uses hall
room id=living at (3700,0) size 4300x3800 label "Living" uses living
walls from rooms exterior 200 partition 100
door on hall.bottom at 1100 from start width 900 swing inward
door between hall and living at 3100 from start width 900 swing into living
window on living.right width 1600
window on hall.left width 900
stair id=s dir up width 1000 {
flight at (2630,1100) size 1000x1540
landing at (2630,100) size 1000x1000
flight at (1100,100) size 1530x1000
}
}
level 2 "First floor" {
room id=gallery at (0,0) size 3700x3800 label "Landing" at (1700,1900) uses hall
room id=bed at (3700,0) size 4300x3800 label "Bedroom" uses bedroom
walls from rooms exterior 200 partition 100
roof overhang 300
door between gallery and bed at 3100 from start width 900 swing into bed
window on bed.right width 1600
window on gallery.left width 900
stair id=s dir down width 1000 {
flight at (2630,1100) size 1000x1540
landing at (2630,100) size 1000x1000
flight at (1100,100) size 1530x1000
}
}
}
More in Homes
- Two-bed flat: A two-bedroom apartment with every room off a central corridor, its walls derived from the rooms — the plainest complete dwelling in the set.
- Attached (strip): A one-bedroom flat with no hand-computed coordinates: a strip of rooms, openings pinned along walls, furniture placed in rooms.
- Bungalow (site + doors): A single-storey bungalow whose whole layout follows one stated fact: the street is south and the garden north.
- Courtyard House: A 16.3 x 11.8 m house whose rooms ring an open courtyard — which is a hole in the building, not a room.
- Courtyard Family House: A family house round an open courtyard, furnished with pieces no other example draws: bunk beds and a crib, a hot tub and a fire pit.
- Townhouse (3 levels): A 5.5 x 11 m three-storey terrace house: one level block per storey, and one drawing per storey.
- Two-storey (2 levels): A compact two-storey house whose stair carries the same id on both floors, which is what declares one shaft.
- Furnished Flat: A two-bedroom flat furnished from the symbol catalogue: thirty-eight drawn fixture kinds across five domains.
- Issued Sheet (tags + notes): A small flat issued on A3 with a drawing number, general notes and a tag on every door and window, keyed to a schedule.
- Apartment Remodel: A flat drawn for its works: two demolished partitions dashed, one new wall, and rooms measured as they will be.
- Garden House (site plan): A family house on a 22 x 22 m lot drawn as a site plan: the lot line, nine ground materials, fences and a garden.