From 7936b9c008b3776e442e5c24882bb17d3a6ad3b6 Mon Sep 17 00:00:00 2001 From: Sagyam Thapa Date: Sat, 21 Nov 2026 08:43:20 +0545 Subject: [PATCH 1/2] Add O2, the realistic round glass tower A second office design, so downtown's office lots no longer all build O1. A twenty-sided drum 12 m across: tinted curtain wall with a mullion fin on every joint and a thin sunshade ring at each storey's head, a colonnaded double-height lobby drum under a cantilevered canopy that carries the name, a revolving door, a plant storey with a deep ring on tall towers, and a crown of fins ending in a ring that is lit at night. - o2_round.py: pieces ground, floor, plant, crown (6.5 k triangles) - real.ts: O2's def and stack; a "halo" role for the lit crown ring - models.ts: a paved plaza round the drum with trees and benches at the front corners - plan.rs: blueprint "Round glass tower", downtown, level 2, 1800 coins; an [o2] section in the office names Co-Authored-By: Claude Opus 5.5 --- crates/daemon/names/offices.txt | 8 + crates/daemon/src/plan.rs | 1 + docs/APP.md | 3 +- docs/ROADMAP.md | 8 +- ui/blender/real/build.py | 2 +- ui/blender/real/o2_round.py | 325 ++++++++++++++++++++++++++++++++ ui/src/city/models.ts | 14 ++ ui/src/city/plan.ts | 1 + ui/src/city/real.ts | 40 +++- ui/src/mockcity.ts | 2 + ui/src/proto/main.ts | 2 +- 11 files changed, 396 insertions(+), 10 deletions(-) create mode 100644 ui/blender/real/o2_round.py diff --git a/crates/daemon/names/offices.txt b/crates/daemon/names/offices.txt index ff4186e..3c6665c 100644 --- a/crates/daemon/names/offices.txt +++ b/crates/daemon/names/offices.txt @@ -20,3 +20,11 @@ Fulcrum Building Albion Place Cornerstone House Greyfriars Centre + +[o2] +The Rotunda +Compass House +Orbit House +The Lantern +Circle Point +Halo House diff --git a/crates/daemon/src/plan.rs b/crates/daemon/src/plan.rs index 8a50183..78602e1 100644 --- a/crates/daemon/src/plan.rs +++ b/crates/daemon/src/plan.rs @@ -518,6 +518,7 @@ pub const BLUEPRINTS: &[Blueprint] = &[ 2, 1500, ), + bp("o2", "Round glass tower", Office, &[Downtown], 2, 1800), bp("l1", "Art deco skyscraper", Tower, &[Downtown], 2, 3000), ]; diff --git a/docs/APP.md b/docs/APP.md index 194c956..6f9b40d 100644 --- a/docs/APP.md +++ b/docs/APP.md @@ -87,7 +87,8 @@ are blueprints and their prices. | A3 | Balcony block | apartment classic | `a3_balcony.py` | in | | A4-A6 | Art deco, Parisian, modern apartments | apartment | | | | O1 | Curtain-wall tower | office | `o1_tower.py` | in | -| O2, O3 | Round glass tower, brutalist office | office | | next | +| O2 | Round glass tower | office | `o2_round.py` | in | +| O3 | Brutalist office | office | | next | | O4, O5 | Stone office, modernist slab | office | | | | L1 | Art deco skyscraper | tower | `l1_deco.py` | in | | L2-L4 | Glass supertall, twisting tower, TV tower | tower | | | diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 8b80e92..13c9598 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -17,10 +17,10 @@ area, if anything a reader needs changed. 1. **Use it for real** and tune: coin prices, build hours, shiny odds, escalation stages, nudges. Add real `[[routines]]`. -2. **Models**: O2 or O3, then L2 (offices and towers are each one design, - so ~200 of the plan's ~350 h build O1 or L1 over and over), then a - second workshop (timber mill or brewery; S4 is the only one, so the - mayor never chooses) and a third downtown shop (only S1 and S2 fit). +2. **Models**: O3, then L2 (towers are one design, so much of the plan's + ~350 h builds L1 over and over), then a second workshop (timber mill or + brewery; S4 is the only one, so the mayor never chooses) and a third + downtown shop (only S1 and S2 fit). 3. **Landmark ground**: reserve half blocks in `layout.rs` for L5 city hall and the landmarks; then L6 town square and L12 city park replace the parks assembled from props. diff --git a/ui/blender/real/build.py b/ui/blender/real/build.py index 91c49cf..09e2033 100644 --- a/ui/blender/real/build.py +++ b/ui/blender/real/build.py @@ -15,7 +15,7 @@ import lib # noqa: E402 -MODELS = {"a1": "a1_apartment", "a2": "a2_brownstone", "c1": "c1_farmhouse", "c2": "c2_cottage", "c3": "c3_modern", "c4": "c4_aframe", "s1": "s1_shop", "s2": "s2_cafe", "s3": "s3_diner", "s4": "s4_factory", "o1": "o1_tower", "l1": "l1_deco", "a3": "a3_balcony", "cars": "vehicles", "trees": "trees", "street": "street", "bridge": "bridge", "civic": "civic", "p1": "p1_substation", "f1": "f1_fire", "e1": "e1_school", "h1": "h1_clinic", "l5": "l5_cityhall", "e2": "e2_police", "e3": "e3_library", "h2": "h2_hospital", "p2": "p2_power", "w2": "w2_pumping"} +MODELS = {"a1": "a1_apartment", "a2": "a2_brownstone", "c1": "c1_farmhouse", "c2": "c2_cottage", "c3": "c3_modern", "c4": "c4_aframe", "s1": "s1_shop", "s2": "s2_cafe", "s3": "s3_diner", "s4": "s4_factory", "o1": "o1_tower", "o2": "o2_round", "l1": "l1_deco", "a3": "a3_balcony", "cars": "vehicles", "trees": "trees", "street": "street", "bridge": "bridge", "civic": "civic", "p1": "p1_substation", "f1": "f1_fire", "e1": "e1_school", "h1": "h1_clinic", "l5": "l5_cityhall", "e2": "e2_police", "e3": "e3_library", "h2": "h2_hospital", "p2": "p2_power", "w2": "w2_pumping"} argv = sys.argv[sys.argv.index("--") + 1 :] if "--" in sys.argv else [] flags = {a for a in argv if a.startswith("--")} diff --git a/ui/blender/real/o2_round.py b/ui/blender/real/o2_round.py new file mode 100644 index 0000000..439b79b --- /dev/null +++ b/ui/blender/real/o2_round.py @@ -0,0 +1,325 @@ +# O2, round glass tower: a drum of an office tower on a twenty-sided plan, +# 12 m across. A stick-system curtain wall of tinted vision glass between +# spandrel bands, a mullion fin on every facet joint, and at every storey's +# head a thin aluminium sunshade ring standing out 0.65 m, so the tower +# reads as a stack of discs with a shadow line under each. The ground +# storey stands on a ring of ten granite columns round a double-height +# glass lobby drum, set back under the first floor's soffit; in front, a +# cantilevered steel canopy on tie rods carries the name, over a revolving +# door between swing doors. The back of the drum is granite with the +# service door. Tall towers have a plant storey part way up: louvres +# behind a deeper ring. On top a crown: the fins carry on up past the roof +# to a ring with a lit band, round a louvred plant drum, the stair head +# and a mast with an aircraft warning light. The app tints the glass and +# metalwork and picks the name, per building. +# +# The tower's centre is YC behind the footprint's: the canopy is in front. +# +# Pieces (base at the origin, stacked by the app): +# ground 6.0 m: columns, lobby drum, canopy with the name, revolving door +# floor 3.7 m: a typical storey +# plant 3.7 m: the plant storey, louvres behind a deep ring +# crown parapet, the fins' crown ring, the plant drum, stair head, mast +import math + +from lib import Side, Model, Z, new_id, pane + +ID = "o2" +N = 20 # facets +R = 6.0 # the curtain wall's corner radius +YC = 0.4 # the tower's centre, behind the footprint's +RL = 4.6 # the lobby drum +RC = 5.45 # the columns' centre line +G = 6.0 # ground storey +SOFFIT = G - 0.4 # under the first floor's edge band +FL = 3.7 # typical storeys +SILL, HEAD = 0.6, 3.2 # vision glass between, spandrel bands below and above +SHADE = 0.65 # how far the sunshade rings stand out +GLASS_W = -0.03 # the glass plane, just inside the facet line +PAR = 1.2 # parapet +CROWN = 5.0 # the crown ring's top above the roof slab +DOOR = 2.7 # the lobby doors' head +YF = -6.4 # the canopy's front, the footprint's front +CX = 4.0 # the canopy's half width +CZ0, CZ1 = 3.3, 3.85 # the canopy's underside and top + + +def build(out, bake=True): + M = Model(ID) + M.piece("ground") + ground(M.m) + M.piece("floor", (0, 0, G)) + storey(M.m, G) + # Each piece at its own height, as stacked, so none shares a vertex with another. + M.piece("plant", (0, 0, G + FL)) + storey(M.m, G + FL, plant=True) + M.piece("crown", (0, 0, G + 2 * FL)) + crown(M.m, G + 2 * FL) + M.export(out, bake) + + +# ---- the twenty-sided plan ------------------------------------------------------------ + + +def ang(i): + """Joint i's angle: joint 0 is at the front (-y), counting anticlockwise.""" + return -math.pi / 2 + i * math.tau / N + + +def at(r, a, z): + return (r * math.cos(a), YC + r * math.sin(a), z) + + +def facet(m, i, r): + """Facet i (joint i to joint i + 1) of the polygon with corner radius r, + as a facade: u runs from -h at joint i to h at joint i + 1.""" + a = ang(i) + math.pi / N + ap = r * math.cos(math.pi / N) + F = Side(m, (ap * math.cos(a), YC + ap * math.sin(a), 0), (-math.sin(a), math.cos(a), 0), (math.cos(a), math.sin(a), 0)) + return F, r * math.sin(math.pi / N) + + +def joint(m, i, r): + """A frame at joint i facing straight out, for mullions and fins.""" + a = ang(i) + x, y, _ = at(r, a, 0) + return Side(m, (x, y, 0), (-math.sin(a), math.cos(a), 0), (math.cos(a), math.sin(a), 0)) + + +def mid(i): + """Facet i's middle angle in degrees, -180..180.""" + d = math.degrees(ang(i) + math.pi / N) + return (d + 180) % 360 - 180 + + +def disc(m, role, r, z, out): + m.poly(role, [at(r, ang(i), z) for i in range(N)], out=(0, 0, out)) + + +def ring(m, role, r0, r1, z0, z1, edge=None, inner=False): + """A flat ring between corner radii r0 and r1, z0 to z1 thick: top, + underside, the outer edge (in `edge`'s role if given), the inner if asked.""" + for i in range(N): + a, b = ang(i), ang(i + 1) + c = ang(i) + math.pi / N + out = (math.cos(c), math.sin(c), 0) + m.poly(role, [at(r0, a, z1), at(r0, b, z1), at(r1, b, z1), at(r1, a, z1)], out=Z) + m.poly(role, [at(r0, a, z0), at(r0, b, z0), at(r1, b, z0), at(r1, a, z0)], out=-Z) + m.poly(edge or role, [at(r1, a, z0), at(r1, b, z0), at(r1, b, z1), at(r1, a, z1)], out=out) + if inner: + m.poly(role, [at(r0, a, z0), at(r0, b, z0), at(r0, b, z1), at(r0, a, z1)], out=(-out[0], -out[1], 0)) + + +# ---- storeys ----------------------------------------------------------------------------- + + +def mullion(m, i, z0, z1, fin=0.22): + J = joint(m, i, R) + J.box("mullion", -0.04, 0.04, z0, z1, GLASS_W - 0.05, 0.05) + J.box("mullion", -0.02, 0.02, z0, z1, 0.05, fin) + + +def storey(m, z, plant=False): + """A typical storey: spandrel at the slab, vision glass, spandrel to the + next slab, mullion fins, the sunshade ring at the head. The plant storey + has louvres instead of vision glass and a deep ring.""" + for i in range(N): + F, h = facet(m, i, R) + ga, gb = -h + 0.04, h - 0.04 + F.quad("spandrel", ga, gb, z, z + SILL - 0.03, GLASS_W) + F.quad("spandrel", ga, gb, z + HEAD + 0.03, z + FL, GLASS_W) + if plant: + # Louvres in a recess, the reveals in the mullions' metal. + F.quad("blades", ga, gb, z + SILL, z + HEAD, -0.25, uvs=[(0, 0), (gb - ga, 0), (gb - ga, HEAD - SILL), (0, HEAD - SILL)]) + F.box("mullion", ga, gb, z + SILL - 0.03, z + SILL, -0.25, GLASS_W, skip=("back", "bottom")) + F.box("mullion", ga, gb, z + HEAD, z + HEAD + 0.03, -0.25, GLASS_W, skip=("back", "top")) + else: + pane(F, "officeglass", ga, gb, z + SILL, z + HEAD, ga, gb, z + SILL + 0.03, z + HEAD - 0.03, GLASS_W - 0.01, new_id()) + for hh in (SILL, HEAD): + F.box("mullion", ga, gb, z + hh - 0.03, z + hh + 0.03, GLASS_W, 0.04) + # The stack joint at the slab, where one storey's units meet the next. + F.box("mullion", ga, gb, z, z + 0.025, GLASS_W, 0.02) + mullion(m, i, z, z + FL) + if plant: + ring(m, "mullion", R - 0.1, R + 1.1, z + HEAD - 0.05, z + HEAD + 0.25, edge="blades") + else: + ring(m, "mullion", R - 0.05, R + SHADE, z + HEAD, z + HEAD + 0.05) + # The slab's underside, seen only when the storey above is gone. + disc(m, "dark", R, z + FL - 0.02, -1) + + +# ---- ground storey ----------------------------------------------------------------- + + +def swing_door(F, a, b, c, e, wid): + """A frameless glass door with a stainless rail at the foot and a long pull.""" + pane(F, "doorglass", a, b, c, e, a + 0.02, b - 0.02, c + 0.12, e - 0.02, -0.03, wid) + F.box("stainless", a, b, c, c + 0.12, -0.05, 0.0) + u = b - 0.15 if a < 0 else a + 0.15 + F.box("stainless", u - 0.02, u + 0.02, c + 0.7, c + 2.0, 0.0, 0.06, skip=()) + + +def steel_door(F, a, b, c, e, d): + """A flush steel door in a frame, with a push bar.""" + F.quad("ac", a + 0.05, b - 0.05, c, e - 0.05, -d + 0.03) + F.box("mullion", a, a + 0.05, c, e, -d, -d + 0.06) + F.box("mullion", b - 0.05, b, c, e, -d, -d + 0.06) + F.box("mullion", a, b, e - 0.05, e, -d, -d + 0.06) + F.box("dark", a + 0.15, b - 0.15, c + 0.95, c + 1.0, -d + 0.03, -d + 0.07) + + +def ground(m): + c = 0.15 + # A granite podium a step up from the plaza. + disc(m, "granite", R + 0.4, c, 1) + for i in range(N): + F, h = facet(m, i, R + 0.4) + F.quad("granite", -h, h, 0, c) + # The columns, under every second joint, on stainless shoes. + for i in range(1, N, 2): + x, y, _ = at(RC, ang(i), 0) + m.cyl("granite", x, y, 0.32, c, SOFFIT, seg=12, top=False) + m.cyl("stainless", x, y, 0.335, c, c + 0.3, seg=12) + lobby(m, c) + # The soffit under the first floor, with downlights, and the floor's + # edge band round the outside. + for i in range(N): + a, b = ang(i), ang(i + 1) + m.poly("panel", [at(RL, a, SOFFIT), at(RL, b, SOFFIT), at(R, b, SOFFIT), at(R, a, SOFFIT)], out=-Z) + F, h = facet(m, i, R) + F.quad("mullion", -h, h, SOFFIT, G) + x, y, _ = at((RL + R) / 2 * math.cos(math.pi / N), ang(i) + math.pi / N, 0) + m.cyl("lamp", x, y, 0.08, SOFFIT - 0.02, SOFFIT, seg=10, top=False, bottom=True) + canopy(m) + revolving(m, 0, YC - RL - 1.1, c, DOOR) + disc(m, "dark", R, G - 0.02, -1) + + +def lobby(m, c): + """The lobby drum: tall glass between slim posts round the front and + sides, swing doors either side of the revolving door, granite round the + back with the service door and an intake louvre.""" + solid = [i for i in range(N) if 35 < mid(i) < 145] + for i in range(N): + F, h = facet(m, i, RL) + if i in solid: + if round(mid(i)) == 81: + F.wall("granite", -h, h, c, SOFFIT, [(-0.6, 0.6, c, c + 2.3)], depth=0.2) + steel_door(F, -0.6, 0.6, c, c + 2.3, 0.2) + F.box("lamp", -0.15, 0.15, c + 2.5, c + 2.62, 0, 0.12) + elif round(mid(i)) == 99: + F.wall("granite", -h, h, c, SOFFIT, [(-0.5, 0.5, 2.8, 4.0)], depth=0.12) + F.quad("blades", -0.5, 0.5, 2.8, 4.0, -0.12, uvs=[(0, 0), (1, 0), (1, 1.2), (0, 1.2)]) + else: + F.quad("granite", -h, h, c, SOFFIT) + F.box("granite", -h, h, c, c + 0.3, 0, 0.03, skip=("back", "left", "right")) + continue + wid = new_id() + if i in (1, N - 2): + # Swing doors under a transom light. + pane(F, "doorglass", -h, h, c, SOFFIT, -h + 0.03, h - 0.03, DOOR + 0.06, SOFFIT, -0.02, wid) + F.box("mullion", -h, h, DOOR, DOOR + 0.08, -0.04, 0.06) + swing_door(F, -h + 0.03, -0.01, c, DOOR, wid) + swing_door(F, 0.01, h - 0.03, c, DOOR, wid) + else: + pane(F, "doorglass", -h, h, c, SOFFIT, -h + 0.02, h - 0.02, c, SOFFIT, -0.02, wid) + F.box("mullion", -h, h, DOOR + 0.2, DOOR + 0.26, -0.03, 0.03, skip=()) + F.box("mullion", -h, h, c, c + 0.08, -0.02, 0.05) + for i in range(N): + if i in solid and (i - 1) % N in solid: + continue + J = joint(m, i, RL) + J.box("mullion", -0.03, 0.03, c, SOFFIT, -0.06, 0.06) + + +def canopy(m): + """A steel canopy over the entrance, cantilevered from the drum and hung + from the first floor on two tie rods; the name on its fascia.""" + xs = [-CX + k * CX / 4 for k in range(9)] + back = lambda x: YC - math.sqrt(RL * RL - x * x) + 0.1 # noqa: E731 + for x0, x1 in zip(xs, xs[1:]): + m.poly("mullion", [(x0, YF, CZ1), (x1, YF, CZ1), (x1, back(x1), CZ1), (x0, back(x0), CZ1)], out=Z) + m.poly("panel", [(x0, YF, CZ0), (x1, YF, CZ0), (x1, back(x1), CZ0), (x0, back(x0), CZ0)], out=-Z) + for x, out in ((-CX, (-1, 0, 0)), (CX, (1, 0, 0))): + m.poly("mullion", [(x, YF, CZ0), (x, back(x), CZ0), (x, back(x), CZ1), (x, YF, CZ1)], out=out) + F = Side(m, (0, YF, 0), (1, 0, 0), (0, -1, 0)) + F.quad("mullion", -CX, CX, CZ0, CZ1) + F.quad("towername", -CX + 0.2, CX - 0.2, CZ0 + 0.05, CZ1 - 0.05, 0.005, uvs=[(0, 0), (1, 0), (1, 1), (0, 1)]) + for x in (-2.4, -0.8, 0.8, 2.4): + m.cyl("lamp", x, YF + 1.0, 0.07, CZ0 - 0.02, CZ0, seg=10, top=False, bottom=True) + # The tie rods, from the canopy's front corners up to the first floor's edge. + for sx in (-1, 1): + x = sx * 2.6 + m.strut("stainless", (sx * (CX - 0.3), YF + 0.15, CZ1), (x, YC - math.sqrt(R * R - x * x) + 0.3, SOFFIT), 0.05) + + +def revolving(m, cx, cy, c, e): + """A four-wing revolving door in a glass drum, open to the street and the lobby.""" + r, seg = 1.05, 20 + for side in (0.0, math.pi): + pts = [side + (k / 6 - 0.5) * math.radians(110) for k in range(7)] + p = lambda a, z: (cx + math.cos(a) * r, cy + math.sin(a) * r, z) # noqa: E731 + for a0, a1 in zip(pts, pts[1:]): + m.poly("canopy", [p(a0, c), p(a1, c), p(a1, e), p(a0, e)], out=(math.cos((a0 + a1) / 2), math.sin((a0 + a1) / 2), 0)) + for a in (pts[0], pts[-1]): + x, y, _ = p(a, 0) + m.box("stainless", (x - 0.03, y - 0.03, c), (x + 0.03, y + 0.03, e)) + m.cyl("stainless", cx, cy, r + 0.05, e, e + 0.3, seg=seg, bottom=True) + m.cyl("stainless", cx, cy, r + 0.05, c, c + 0.03, seg=seg) + m.cyl("stainless", cx, cy, 0.06, c, e, seg=8, top=False) + for k in range(4): + a = math.radians(45 + 90 * k) + d = (math.cos(a), math.sin(a), 0) + n = (-math.sin(a), math.cos(a), 0) + W = Side(m, (cx, cy, 0), d, n) + W.quad("canopy", 0.08, r - 0.06, c + 0.12, e - 0.08, 0.0, out=n) + W.quad("canopy", 0.08, r - 0.06, c + 0.12, e - 0.08, 0.0, out=(-n[0], -n[1], 0)) + W.box("stainless", r - 0.06, r - 0.02, c + 0.02, e - 0.02, -0.02, 0.02, skip=()) + W.box("stainless", 0.06, r - 0.02, c + 0.02, c + 0.12, -0.02, 0.02, skip=()) + W.box("stainless", 0.06, r - 0.02, e - 0.08, e - 0.02, -0.02, 0.02, skip=()) + + +# ---- the crown ------------------------------------------------------------------------ + + +def crown(m, z): + for i in range(N): + F, h = facet(m, i, R) + ga, gb = -h + 0.04, h - 0.04 + # The parapet: spandrel glass carried on up, a panelled inside face, a coping. + F.quad("spandrel", ga, gb, z, z + PAR, GLASS_W) + F.quad("panel", -h, h, z + 0.12, z + PAR, -0.3, out=-F.n) + F.box("mullion", -h, h, z + PAR, z + PAR + 0.06, -0.32, 0.06, skip=("back",)) + # The fins carry on up to the crown ring. + J = joint(m, i, R) + J.box("mullion", -0.04, 0.04, z, z + PAR, GLASS_W - 0.05, 0.05) + J.box("mullion", -0.03, 0.03, z, z + CROWN - 0.4, 0.05, 0.3) + J.box("mullion", -0.03, 0.03, z + PAR + 0.06, z + CROWN - 0.4, -0.3, 0.05) + ring(m, "mullion", R - 0.35, R + 0.36, z + CROWN - 0.55, z + CROWN, edge="halo", inner=True) + ring(m, "mullion", R - 0.35, R + 0.36, z + PAR + 1.6, z + PAR + 1.7, inner=True) + disc(m, "roof", R - 0.3, z + 0.12, 1) + base = z + 0.12 + # The plant drum: louvres round the lift motor room and the air handlers, a metal lid. + py, pr, ph = YC + 0.8, 2.4, 4.2 + m.cyl("blades", 0, py, pr, base, base + ph, seg=N, top=False, uv=True) + m.cyl("mullion", 0, py, pr + 0.12, base + ph, base + ph + 0.2, seg=N, bottom=True) + # The stair head on its front, a door onto the roof and a lamp over it. + y0, y1 = py - pr - 0.9, py - pr + 0.6 + m.box("panel", (-0.95, y0, base), (0.95, y1, base + 2.7), skip=("z0",)) + S = Side(m, (0, y0, 0), (1, 0, 0), (0, -1, 0)) + steel_door(S, -0.5, 0.5, base, base + 2.2, -0.02) + m.box("lamp", (-0.15, y0 - 0.12, base + 2.35), (0.15, y0, base + 2.47)) + # Condensers either side, on steel frames. + for sx in (-1, 1): + x, y = sx * 3.3, YC - 1.3 + m.box("iron", (x - 0.8, y - 0.5, base), (x + 0.8, y + 0.5, base + 0.25), skip=("z0",)) + m.box("ac", (x - 0.75, y - 0.45, base + 0.25), (x + 0.75, y + 0.45, base + 1.05), skip=("z0",)) + m.cyl("dark", x, y, 0.3, base + 1.05, base + 1.06, seg=14) + # The mast on the plant drum's lid, with panel antennas and the warning light. + mz = base + ph + 0.2 + m.cyl("ac", 0, py + 0.6, 0.08, mz, mz + 7.0, seg=8) + for k in range(3): + a = k * math.tau / 3 + px, pq = math.cos(a) * 0.17, py + 0.6 + math.sin(a) * 0.17 + m.box("ac", (px - 0.09, pq - 0.09, mz + 4.2), (px + 0.09, pq + 0.09, mz + 5.6)) + m.cyl("beacon", 0, py + 0.6, 0.09, mz + 7.0, mz + 7.22, seg=8) diff --git a/ui/src/city/models.ts b/ui/src/city/models.ts index eca3fcd..4a3c3b1 100644 --- a/ui/src/city/models.ts +++ b/ui/src/city/models.ts @@ -456,6 +456,20 @@ function realYard(p: Parts, rp: Parts, s: Spec, def: RealDef, r: () => number) { for (let i = 0; i < 3; i++) p.box(bin, 1.2, 1.3, 1.0, -half + 1.0 + i * 1.3, KERB, back + 0.9); break; } + case "o2": { + // A plaza paved to the pavement round the drum: bollards before the + // canopy, a tree in a planter and a bench at each front corner where + // the round tower leaves room; the bins at a back corner. + p.box(paving, LOT - 0.4, KERB, LOT - 0.4, 0, 0, cz); + for (const sx of [-1, 1]) { + planter(p, sx * 5.9, front - 1.5, s.seed + (sx > 0 ? 1 : 2)); + furniture(p, "bench", sx * 5.9, KERB, front - 3.2, 0); + } + for (let i = 0; i < 6; i++) furniture(p, "bollard", -3.0 + i * 1.2, KERB, front - 0.45); + const bin = mat(0x2a3a4a, { roughness: 0.6 }); + for (let i = 0; i < 3; i++) p.box(bin, 1.2, 1.3, 1.0, half - 0.8 - i * 1.3, KERB, back + 0.7); + break; + } case "l1": { // Granite paving to the pavement, heritage lamps either side of the // portal; behind, the bins by the service door. diff --git a/ui/src/city/plan.ts b/ui/src/city/plan.ts index 53b8e9b..094d544 100644 --- a/ui/src/city/plan.ts +++ b/ui/src/city/plan.ts @@ -52,6 +52,7 @@ export const DESIGNS: Record = { a2: { kind: "apartment", style: "townhouse" }, a3: { kind: "apartment", style: "classic" }, o1: { kind: "office", style: "classic" }, + o2: { kind: "office", style: "classic" }, l1: { kind: "landmark", style: "deco" }, }; diff --git a/ui/src/city/real.ts b/ui/src/city/real.ts index ce0ba10..2e04eca 100644 --- a/ui/src/city/real.ts +++ b/ui/src/city/real.ts @@ -114,6 +114,10 @@ const O1_G = 5.4; const O1_FL = 3.6; /** Where O1 steps back: after about two thirds of its storeys, never at the top. */ const o1Lower = (total: number) => Math.min(total - 1, Math.max(2, Math.round(total * 0.68))); +const O2_G = 6.0; +const O2_FL = 3.7; +/** O2's crown ring above its roof slab; the mast reaches 11.6 m. */ +const O2_CROWN = 5.0; const L1_G = 6.0; const L1_FL = 3.5; /** L1's crown above its top storey: the lit stages to 12.8 m, the spire to 29.6 m. */ @@ -550,6 +554,31 @@ export const DEFS: Record = { height: (floors) => O1_G + (floors - 1) * O1_FL + 4.4, debris: 0x5a6a70, }, + o2: { + id: "o2", + kind: "office", + style: "classic", + // The podium's 12.8 m drum; the canopy in front is inside the footprint + // (o2_round.py sets the tower 0.4 m back to centre it). + w: 12.8, + d: 12.8, + front: 2.0, + floors: (plan) => Math.max(8, plan), + stack(floors, roof, _r, total) { + // The lobby, the storeys with a plant storey a little over halfway up + // a tall tower, the crown. + const n = Math.max(total, floors); + const plant = n >= 12 ? Math.round(n * 0.55) : -1; + const out = floors > 0 ? [{ piece: "ground", y: 0 }] : []; + for (let f = 1; f < floors; f++) out.push({ piece: f === plant ? "plant" : "floor", y: O2_G + (f - 1) * O2_FL }); + if (roof) out.push({ piece: "crown", y: O2_G + (floors - 1) * O2_FL }); + return out; + }, + top: (floors) => O2_G + (floors - 1) * O2_FL, + height: (floors) => O2_G + (floors - 1) * O2_FL + O2_CROWN, + debris: 0x5a6a70, + walls: [12, 12, 0, -0.4], + }, l1: { id: "l1", kind: "landmark", @@ -1279,9 +1308,9 @@ const STEELS = [0x1e2022, 0x2c4436, 0x5a5e62, 0x6a2a20, 0xd8d2c0, 0x34465a]; const WORKS_DOORS = [0x3a5a40, 0x6a2620, 0x5a3e2a, 0x2e4a66, 0x7a7c78]; /** Corrugated sheet: weathered galvanising (most), grey paint, oxide red, green, dark grey. */ const SHEETS = [0xe4e4e0, 0xd4d4d0, 0xc4c6c4, 0xc87860, 0x9ab49a, 0x8a8e92]; -/** O1's glass: blue-green, blue, bronze, neutral grey, green, silver-blue. */ +/** O1 and O2's glass: blue-green, blue, bronze, neutral grey, green, silver-blue. */ const OFFICE_GLASS = [0x7fb2aa, 0x7f9cc4, 0xb89a74, 0x949aa0, 0x86b48e, 0xb4c4d0]; -/** O1's metalwork: silver, dark bronze, black, champagne, white, mid grey. */ +/** O1 and O2's metalwork: silver, dark bronze, black, champagne, white, mid grey. */ const MULLIONS = [0xb8bcc0, 0x4a3e34, 0x1e2022, 0xc8b894, 0xe8e8e4, 0x7a8086]; /** L1's limestone: Indiana buff, pale grey, cream, warm pink, silver-grey, ivory. */ const LIMESTONES = [0xf4ead8, 0xdcdcd8, 0xfff4dc, 0xf0d4c4, 0xc8ccd0, 0xfffaf0]; @@ -1901,13 +1930,18 @@ export function realMat(id: string, role: string, paint: Paint, damage: number, m = sheen({ color: 0x1a2026, roughness: 0.1, emissive: 0xffd49a, emissiveIntensity: 0 }); if (damage < 2) m.userData.night = 1.6; break; + // O2's crown ring: pale metal by day, a lit band at night. + case "halo": + m = plain(0xdfe4e8, 0.35, 0.3, { emissive: 0xd8eaff, emissiveIntensity: 0 }); + if (damage < 2) m.userData.night = 1.4; + break; case "beacon": m = plain(0x8a1010, 0.3, 0, { emissive: 0xff1a10, emissiveIntensity: 0 }); if (damage < 2) m.userData.night = 4; break; case "glass": m = room(id === "e1" || id === "h1" || id === "h2" || id === "e2" ? "office" : "home"); break; case "shopglass": m = room("shop"); break; - case "doorglass": m = room(id === "o1" ? "atrium" : "lobby"); break; + case "doorglass": m = room(id === "o1" || id === "o2" ? "atrium" : "lobby"); break; case "decoglass": m = room("office"); break; case "dinerglass": m = room("diner"); break; case "worksglass": m = room("works"); break; diff --git a/ui/src/mockcity.ts b/ui/src/mockcity.ts index e852103..3a96dbe 100644 --- a/ui/src/mockcity.ts +++ b/ui/src/mockcity.ts @@ -83,6 +83,7 @@ const BLUEPRINTS: Omit[] = [ { id: "a2", name: "Brownstone row", kind: "apartment", districts: ["main_street", "downtown"], level: 1, price: 900 }, { id: "a3", name: "Balcony block", kind: "apartment", districts: ["main_street", "downtown"], level: 1, price: 900 }, { id: "o1", name: "Curtain-wall office tower", kind: "office", districts: ["downtown"], level: 2, price: 1500 }, + { id: "o2", name: "Round glass tower", kind: "office", districts: ["downtown"], level: 2, price: 1800 }, { id: "l1", name: "Art deco skyscraper", kind: "tower", districts: ["downtown"], level: 2, price: 3000 }, ]; @@ -114,6 +115,7 @@ const PILES: Record = { a2: ["Linden Row", "Chestnut Row", "Ardmore Court", "Belgrave Mansions", "Carlisle Court", "Danbury House"], a3: ["Ardmore Court", "Belgrave Mansions", "Carlisle Court", "Danbury House", "Edgewood Court", "Fairview Mansions"], o1: ["Meridian House", "One Harbour Place", "Carlton Tower", "Northbridge Centre", "The Exchange", "Atlas Building", "200 Park Row", "Sovereign House", "Pinnacle House", "Riverside Plaza", "The Foundry Building", "Quayside Centre"], + o2: ["The Rotunda", "Compass House", "Orbit House", "The Lantern", "Circle Point", "Halo House", "Meridian House", "One Harbour Place"], l1: ["The Orion Building", "Halcyon Tower", "Continental Life", "The Zenith Building"], }; diff --git a/ui/src/proto/main.ts b/ui/src/proto/main.ts index cdda3f5..3715de5 100644 --- a/ui/src/proto/main.ts +++ b/ui/src/proto/main.ts @@ -1,7 +1,7 @@ // Viewer for the realistic models (blender/real, `bun run models`): one // building on its lot, built by the app's own code (models.ts), on a street // corner. Open /proto.html in the dev server with -// ?model=a1|a2|a3|c1|c2|c3|c4|s1|s2|s3|s4|o1|l1|p1|f1|e1|h1|l5|e2|e3|h2|p2|w2 &floors=7 &seed=3 &damage=0|1|2|3 (3: the ruin) +// ?model=a1|a2|a3|c1|c2|c3|c4|s1|s2|s3|s4|o1|o2|l1|p1|f1|e1|h1|l5|e2|e3|h2|p2|w2 &floors=7 &seed=3 &damage=0|1|2|3 (3: the ruin) // &view=hero|city|detail|roof|back|street &hour=15 // &count=N is a stress test: N buildings on a grid, drawn instanced (or one // mesh each with &draw=separate). From 834f603b9f5e7c47515d92a08fcbf37408822752 Mon Sep 17 00:00:00 2001 From: Sagyam Thapa Date: Sat, 21 Nov 2026 08:49:54 +0545 Subject: [PATCH 2/2] Model pack models-67ed122f1a08e081 with O2; Settings > About shows the build The pack adds O2's glb and AO bake; every other file is unchanged. Settings has an About section with the app's CalVer, the commit it was built from, when that commit was made and when the app was built, so an old install is easy to tell from the latest. Vite defines __BUILD__ from the workspace Cargo.toml and git (DEEPWORK_COMMIT and SOURCE_DATE_EPOCH override). About lives in the app like Appearance: it shows without the daemon's settings. Co-Authored-By: Claude Opus 5.5 --- docs/APP.md | 2 +- ui/src-tauri/models.json | 20 ++++++++++++++++---- ui/src/env.d.ts | 3 +++ ui/src/settings.ts | 35 +++++++++++++++++++++++++++++++---- ui/src/style.css | 3 +++ ui/vite.config.ts | 23 ++++++++++++++++++++++- 6 files changed, 76 insertions(+), 10 deletions(-) diff --git a/docs/APP.md b/docs/APP.md index 6f9b40d..79ea746 100644 --- a/docs/APP.md +++ b/docs/APP.md @@ -26,7 +26,7 @@ this are in [DEVELOPMENT.md](DEVELOPMENT.md). | Letters (envelope) | The residents' letters, newest first, with a link to the building. An unread dot; what was read is kept in localStorage, and a first run starts with nothing unread | | Shop | Blueprints for sale with pictures (`city/thumbs.ts`); later levels as silhouettes | | Deed card | A building's memory, rename, paid repair or a repair kit; hover shows a tag. Picking tests lot rectangles, not meshes | -| Settings sheet (cog) | Every `config.toml` key: session, site lists per profile, routines and skips, inverted mode, DNS, appearance, backup. Save sends the whole config; loosening shows the 24 h notice | +| Settings sheet (cog) | Every `config.toml` key: session, site lists per profile, routines and skips, inverted mode, DNS, appearance, backup. Save sends the whole config; loosening shows the 24 h notice. About shows the build: CalVer, commit, commit and build times (`__BUILD__` from the Vite config) | | Progress sheet (chart) | Stats (`stats.ts`, pure, tested) and the session log | | Moments | Animated collapse, completion, damage, repair; fireworks and a card at level-up; near-miss "extend?" prompt; unseen events replayed on open; each with a sound (`sound.ts`, WebAudio, no files; mute by the menu) | diff --git a/ui/src-tauri/models.json b/ui/src-tauri/models.json index c89e9de..ed20930 100644 --- a/ui/src-tauri/models.json +++ b/ui/src-tauri/models.json @@ -1,6 +1,6 @@ { - "id": "dfdbd7d7b47c6ec4", - "url": "https://github.com/Sagyam/DeepWork/releases/download/models-dfdbd7d7b47c6ec4/", + "id": "67ed122f1a08e081", + "url": "https://github.com/Sagyam/DeepWork/releases/download/models-67ed122f1a08e081/", "files": [ { "path": "a1.glb", @@ -116,6 +116,12 @@ "sha256": "5816011c33101d81ac03eede5863065b79d572c5bb90acac5deece00a852f121", "asset": "o1.glb" }, + { + "path": "o2.glb", + "size": 152333, + "sha256": "d64f0e38ab6656d7d1cc8b280a3b16a8ac17b2b266cf8666177d8c0ef19bc4de", + "asset": "o2.glb" + }, { "path": "p1.glb", "size": 320520, @@ -172,8 +178,8 @@ }, { "path": "bc7.json", - "size": 1757, - "sha256": "d6ab1cd7b0ebcd615a5ae0a14d73e89df264d49a03566b902c850f35c73bd162", + "size": 1765, + "sha256": "2d2e595b6643592c2d5954003766ba93692011e905fe24c3c5f8953d82551abb", "asset": "bc7.json" }, { @@ -290,6 +296,12 @@ "sha256": "48250f6aeb725b7bd22d884bec0081c7096e8fbd18db022bef0ff9ade4493c57", "asset": "o1_ao.bc7" }, + { + "path": "o2_ao.bc7", + "size": 3115035, + "sha256": "310befb18391908d555b9fa3aec5bbd60c7d45bd2c7fea553356a4449104e62a", + "asset": "o2_ao.bc7" + }, { "path": "p1_ao.bc7", "size": 3626317, diff --git a/ui/src/env.d.ts b/ui/src/env.d.ts index 11f02fe..ad5b743 100644 --- a/ui/src/env.d.ts +++ b/ui/src/env.d.ts @@ -1 +1,4 @@ /// + +/** This build, from vite.config.ts: CalVer, commit, commit and build times (ISO 8601). */ +declare const __BUILD__: { version: string; commit: string; committed: string; built: string }; diff --git a/ui/src/settings.ts b/ui/src/settings.ts index 4b44792..91bd837 100644 --- a/ui/src/settings.ts +++ b/ui/src/settings.ts @@ -11,7 +11,10 @@ import { setThemePref, themePref, type ThemePref } from "./theme"; import { QUALITIES, qualityPref, setQualityPref, type Quality } from "./city/quality"; import type { Config, ListMode, PendingConfig, Profile, RuleAction, Status, Throttle } from "./proto"; -export type SettingsSection = "session" | "lists" | "routines" | "inverted" | "dns" | "backup" | "appearance"; +export type SettingsSection = "session" | "lists" | "routines" | "inverted" | "dns" | "backup" | "appearance" | "about"; + +/** Sections that live in the app, not in config.toml: they show without the daemon's settings. */ +const LOCAL = new Set(["appearance", "about"]); const SECTIONS: { key: SettingsSection; label: string; blurb: string }[] = [ { key: "session", label: "Session", blurb: "Timer defaults and nudges" }, @@ -21,6 +24,7 @@ const SECTIONS: { key: SettingsSection; label: string; blurb: string }[] = [ { key: "dns", label: "DNS", blurb: "Resolver and upstreams" }, { key: "backup", label: "Backup", blurb: "Export and import everything" }, { key: "appearance", label: "Appearance", blurb: "Theme and city quality" }, + { key: "about", label: "About", blurb: "Version and build" }, ]; const DAY_KEYS = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]; @@ -413,10 +417,30 @@ function appearanceSection(): string { )}`; } +/** A date and time in the viewer's locale, or "unknown". */ +function when(iso: string): string { + const d = new Date(iso); + return iso && !Number.isNaN(d.getTime()) ? d.toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" }) : "unknown"; +} + +/** What this window was built from, to tell an old install from the latest. */ +function aboutSection(): string { + const b = __BUILD__; + const row = (label: string, value: string) => `
${label}${value}
`; + return `${sheetTitle("About", `The build of this window. Compare it with the latest release at github.com/Sagyam/DeepWork/releases or the tip of main.`)} +
+ ${row("Version", escapeHtml(b.version))} + ${row("Commit", `${escapeHtml(b.commit)}`)} + ${row("Committed", escapeHtml(when(b.committed)))} + ${row("Built", escapeHtml(when(b.built)))} +
+

The version is the CalVer of the release this build belongs to (year, month, release in the month); the commit says exactly which code.

`; +} + /** Eyebrow, heading and blurb, then the pending banner on config sections. */ function sheetTitle(title: string, blurb: string): string { return `

Settings

${title}

-

${blurb}

${section === "appearance" ? "" : pendingBanner()}`; +

${blurb}

${LOCAL.has(section) ? "" : pendingBanner()}`; } function pendingBanner(): string { @@ -430,6 +454,7 @@ function pendingBanner(): string { function body(): string { if (section === "appearance") return appearanceSection(); + if (section === "about") return aboutSection(); if (!draft) return `

Loading settings…

`; return sectionBody(draft); } @@ -450,11 +475,13 @@ function sectionBody(c: Config): string { return backupSection(); case "appearance": return appearanceSection(); + case "about": + return aboutSection(); } } function render() { - if (!draft && section !== "appearance") return; + if (!draft && !LOCAL.has(section)) return; nav().innerHTML = SECTIONS.map( (s) => `