Skip to content

Single place to convert your 2D floor plans to 3d model (no LLM)

Python

Finishes in the walkthrough: try a wall colour or a room's floor live (F)

23f2005639ebffc871401f
diff --git a/README.md b/README.md
index bec23f2..b967edc 100644
--- a/README.md
+++ b/README.md
@@ -92,6 +92,7 @@ python server.py
| **Top view** (T) | The house from above, one storey at a time |
| **Map** (M) | Room names, stairs, where you stand and look; the big map adds each room's size and area |
| **Measure** (N) | Click or tap two points on the house for the distance in metres and feet-inches (drag to look around meanwhile); works in top view too. The line and label are drawn in the 3D view, so screenshots and recordings show them |
+| **Finishes** (F) | Try another wall colour, or another floor for the room you stand in, straight away in the walkthrough. **Save for the next build** writes it into the plan; the light is baked for the old finish until you build again. Houses built before this feature can change only the wall colour |
| **Screenshot** (P) | PNG of about 4K size |
| **Record** (R) | Video of your walk as MP4 (browsers that record WebM are converted on the server; needs ffmpeg) |
| **Tour** (G) | Walks itself from the entrance through every room and up the stairs, looks around in each, and records it as one video. Any key or click stops it |
diff --git a/blender/gen.py b/blender/gen.py
index 66813af..d5224d5 100644
--- a/blender/gen.py
+++ b/blender/gen.py
@@ -1,7 +1,7 @@
"""plan JSON -> furnished 3D house -> baked lighting -> web model (house.glb + lightmaps + meta.json).
Run: blender -b --factory-startup -P planto3d/blender/gen.py -- plan.json OUTDIR [--quality draft|high] [--no-bake]
Progress lines: 'PROGRESS <0-100> <message>' on stdout (read by the server)."""
-import json, math, os, sys, time
+import json, math, os, shutil, sys, time
HERE = os.path.dirname(os.path.abspath(__file__))
sys.path[:0] = [HERE, os.path.join(HERE, "..")]
@@ -46,6 +46,7 @@ FLOOR_MAT = dict(dress="wood", bedroom="wood", toilet="bathtile", kitchen="marbl
garden="turf", open="pebbles", parking="pavers", yard="pavers", stair="stair", room="tile",
duct="concrete")
OPEN_SKY = {"open", "garden", "yard"} # no slab above these
+FINISHES = ("marble", "wood", "tile", "bathtile", "terracotta", "concrete") # as server.py FINISHES: the walkthrough can swap these
wall_hex = plan.get("wall_color") # "#rrggbb" picked on the review page (sRGB); absent = lib's warm white
if wall_hex: # Blender colour values are linear: undo the sRGB curve
MATS["wall"].node_tree.nodes["Principled BSDF"].inputs["Base Color"].default_value = (*[
@@ -484,13 +485,16 @@ for k, f in enumerate(floors):
frames += [(x0, x1, y0, y0 + t, 0, 7, "teak"), (x0, x1, y1 - t, y1, 0, 7, "teak"), (x0, x1, y0, y1, 7 - t, 7, "teak")]
mesh_from_boxes(f"door_frames_{k}", frames, bevel=0.004)
# floors per zone (none over the stairwell coming up from below)
- fl = {}
+ fl = []
well = [(*stair_box_prev, -9, 99)] if stair_box_prev else []
- for zn in f["rooms"]:
+ for i, zn in enumerate(f["rooms"]):
m = zn.get("floor") or FLOOR_MAT.get(zn["type"], "tile") # a finish chosen on the review page wins
- fl.setdefault(m, []).extend((*b[:4], -0.02, 0.0, m) for r in zn["rects"] for b in subtract_all([(*r, -0.02, 0.0)], well))
- for m, bs in fl.items():
- mesh_from_boxes(f"floor_{k}_{m}", bs)
+ if m in FINISHES: # the room's own copy, so the walkthrough can change this floor alone (it finds it by name)
+ MATS[f"floor_{k}_{i}"] = MATS[m].copy()
+ MATS[f"floor_{k}_{i}"].name = f"floor_{k}_{i}"
+ MATS[f"floor_{k}_{i}"]["finish"], m = m, f"floor_{k}_{i}"
+ fl += [(*b[:4], -0.02, 0.0, m) for r in zn["rects"] for b in subtract_all([(*r, -0.02, 0.0)], well)]
+ mesh_from_boxes(f"floor_{k}", fl)
# wall tiles to 7 ft in toilets
# (the room's cells stop a little short of the wall face, so door holes are widened across for the tiles,
# and edges shared by two slices of the same room are not walls)
@@ -553,8 +557,9 @@ for k, f in enumerate(floors):
name=f.get("name", f"Floor {k}"), z=round(z * F_, 3), height=round(H * F_, 3),
colliders=[m(b) for b in subtract_all([(*w[:4], 0, 1) for w in f["walls"]],
[(c[0], c[1], c[2], c[3], 0, 1) for c in cuts if c[4] < 1])],
- rooms=[dict(label=zn.get("label") or zn["type"].title(), type=zn["type"], rects=[m(r) for r in zn["rects"]])
- for zn in f["rooms"] if zn["type"] not in ("duct",)],
+ rooms=[dict(label=zn.get("label") or zn["type"].title(), type=zn["type"], rects=[m(r) for r in zn["rects"]], i=i,
+ **({"floor": MATS[f"floor_{k}_{i}"]["finish"]} if f"floor_{k}_{i}" in MATS else {}))
+ for i, zn in enumerate(f["rooms"]) if zn["type"] not in ("duct",)],
stairs=[dict(s, rect=m(s["rect"]), z0=round((z + s["z0"]) * F_, 3), z1=round((z + s["z1"]) * F_, 3),
**({"start": round(s["start"] * F_, 3)} if "start" in s else {})) for s in smeta],
))
@@ -630,8 +635,14 @@ import bake # noqa: E402
groups = {f"level_{k}": objs for k, objs in by_floor.items()}
groups["site"] = site
res = bake.bake_and_export(groups, unbaked=trees, out=JOB, quality=QUALITY, do_bake=BAKE, progress=progress)
+# the floor textures the walkthrough's Finishes panel can lay (tile = metres per repeat, as the UVs were made)
+os.makedirs(os.path.join(JOB, "finishes"), exist_ok=True)
+finishes = {}
+for n in FINISHES:
+ shutil.copy(os.path.join(ASSETS, "textures", MATS[n]["tex"], "diff.jpg"), os.path.join(JOB, "finishes", n + ".jpg"))
+ finishes[n] = dict(file=f"finishes/{n}.jpg", tile=MATS[n]["tile"])
meta = dict(version=1, floors=META_FLOORS, roof_z=round(top * lib.F, 3), eye=1.6,
- bounds=[round(v * lib.F, 3) for v in (X0, X1, Y0, Y1)], **res)
+ bounds=[round(v * lib.F, 3) for v in (X0, X1, Y0, Y1)], finishes=finishes, **res)
with open(os.path.join(JOB, "meta.json"), "w") as fh:
json.dump(meta, fh)
progress(100, "done")
diff --git a/blender/lib.py b/blender/lib.py
index 1285b70..9666d36 100644
--- a/blender/lib.py
+++ b/blender/lib.py
@@ -117,6 +117,8 @@ def mat(name, color=(0.8, 0.8, 0.8), rough=0.5, metal=0.0, tex=None, tile=1.0, a
p.inputs["Emission Color"].default_value = (*color, 1)
p.inputs["Emission Strength"].default_value = emit
m["tile"] = tile
+ if tex:
+ m["tex"] = tex
MATS[name] = m
return m
diff --git a/server.py b/server.py
index 15f3534..9dcd3b5 100644
--- a/server.py
+++ b/server.py
@@ -139,7 +139,8 @@ def export_site(jid):
with site_lock:
if not os.path.exists(out) or os.path.getmtime(out) < max(map(os.path.getmtime, srcs)): # a new build or a new viewer
meta = json.load(open(os.path.join(d, "meta.json")))
- house = ["meta.json", "house.glb"] + [os.path.basename(f) for f in (meta.get("lightmaps") or {}).values()]
+ house = (["meta.json", "house.glb"] + [os.path.basename(f) for f in (meta.get("lightmaps") or {}).values()]
+ + [f["file"] for f in (meta.get("finishes") or {}).values()])
# view.html with three.js next to it; view.js finds no ?job= and reads the house from ./house/
page = open(os.path.join(WEB, "view.html")).read().replace('"/three/', '"./three/')
with zipfile.ZipFile(out + ".part", "w", zipfile.ZIP_DEFLATED) as z:
diff --git a/tests/test_site.mjs b/tests/test_site.mjs
index 2d6d26d..902c8f5 100644
--- a/tests/test_site.mjs
+++ b/tests/test_site.mjs
@@ -1,9 +1,9 @@
// End-to-end check of the site in a real (headless) browser, against a running server:
// the upload page rejects a non-PDF and accepts a PDF; the review page's "Furniture" box, unticked, gives a draft build
-// whose saved plan has furnish=false, and the build box shows status words and the time left; in the walkthrough, P saves a 4K-size PNG, R records a video, M enlarges the map, N measures and T-T returns to walking.
+// whose saved plan has furnish=false, and the build box shows status words and the time left; in the walkthrough, P saves a 4K-size PNG, R records a video, M enlarges the map, N measures and T-T returns to walking; F changes a floor and the wall colour and saves them; the Website zip loads on its own.
// Takes about 2 min (one draft build); removes its own job.
// CHROME=/path/to/chromium node tests/test_site.mjs <plan.pdf> [http://127.0.0.1:8080]
-import { spawn } from 'node:child_process';
+import { spawn, spawnSync } from 'node:child_process';
import fs from 'node:fs';
import path from 'node:path';
import os from 'node:os';
@@ -111,7 +111,35 @@ try {
assert(ihdr.readUInt32BE(16) * ihdr.readUInt32BE(20) >= 0.95 * 3840 * 2160, 'screenshot should be about 4K');
assert(fs.statSync(path.join(dl, vid)).size > 100e3, 'recording should not be empty');
fs.rmSync(dl, { recursive: true });
- console.log('PASS upload page, furniture option, furniture models dialog, build box, screenshot, recording, map, measure and top view');
+ // finishes (F): standing in a room, change its floor and the wall colour; Save writes both into the plan
+ const room = meta.floors[0].rooms.find((r) => r.floor), [rx0, rx1, ry0, ry1] = room.rects[0];
+ await cdp('Page.navigate', { url: `${base}/web/view.html?job=${job}&pose=${(rx0 + rx1) / 2},${(ry0 + ry1) / 2},0,0,0` });
+ for (let i = 0; i < 300 && !(await ev('!!window.__ready')); i++) await sleep(200);
+ await key('KeyF', 70);
+ await sleep(300);
+ assert.equal(await ev(`!document.getElementById('fin').hidden && !document.getElementById('frow').hidden`), true, 'F should open Finishes with this room\'s floor');
+ const other = Object.keys(meta.finishes).find((n) => n !== room.floor);
+ await ev(`(() => { const s = document.getElementById('ffloor'), w = document.getElementById('fwall');
+ s.value = '${other}'; s.dispatchEvent(new Event('change')); w.value = '#c3cdb4'; w.dispatchEvent(new Event('input'));
+ document.getElementById('fsave').click(); })()`);
+ for (let i = 0; i < 50 && !/Saved/.test(await ev(`document.getElementById('fmsg').textContent`)); i++) await sleep(100);
+ const saved = await (await fetch(`${base}/jobs/${job}/plan.json`)).json();
+ assert.equal(saved.floors[0].rooms[room.i].floor, other, 'Save should put the chosen floor in the plan');
+ assert.equal(saved.wall_color, '#c3cdb4', 'Save should put the wall colour in the plan');
+ // the downloadable website: unzipped and served on its own, the walkthrough must load without this server
+ const zip = await (await fetch(`${base}/api/jobs/${job}/site`, { method: 'POST' })).json();
+ const sd = fs.mkdtempSync(path.join(os.tmpdir(), 'planto3d-site-'));
+ fs.writeFileSync(path.join(sd, 'site.zip'), Buffer.from(await (await fetch(base + zip.url)).arrayBuffer()));
+ spawnSync('python3', ['-m', 'zipfile', '-e', path.join(sd, 'site.zip'), sd]);
+ const sport = 9900 + Math.floor(Math.random() * 90);
+ const web = spawn('python3', ['-m', 'http.server', String(sport), '--bind', '127.0.0.1', '--directory', sd], { stdio: 'ignore' });
+ try {
+ await sleep(800);
+ await cdp('Page.navigate', { url: `http://127.0.0.1:${sport}/` });
+ for (let i = 0; i < 150 && !(await ev('!!window.__ready')); i++) await sleep(200);
+ assert.equal(await ev('!!window.__ready'), true, 'the downloaded website should load the walkthrough');
+ } finally { web.kill(); fs.rmSync(sd, { recursive: true }); }
+ console.log('PASS upload page, furniture option, furniture models dialog, build box, screenshot, recording, map, measure, top view, finishes and website');
} finally {
ch.kill();
if (job) fs.rmSync(new URL(`../jobs/${job}`, import.meta.url), { recursive: true, force: true }); // the test's own upload
diff --git a/web/view.html b/web/view.html
index f99e174..30a3494 100644
--- a/web/view.html
+++ b/web/view.html
@@ -31,6 +31,13 @@
.mapbig #room, .mapbig #cross { visibility: hidden; } /* the large map shows the room itself */
.measure canvas:not(#map) { cursor: crosshair; }
.measure #cross { visibility: hidden; } /* the mouse pointer aims instead */
+ #fin { position: fixed; left: 12px; bottom: 58px; width: 230px; padding: 10px 12px; border-radius: 10px; color: #eee; font-size: 13px;
+ background: rgba(14, 16, 20, .85); border: 1px solid rgba(255, 255, 255, .18); }
+ #fin .r { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
+ #fin select, #fin button { font: inherit; }
+ #fin [hidden] { display: none; }
+ #fin p { margin: 0; color: #aaa; font-size: 12px; }
+ #fwall { width: 40px; height: 26px; padding: 0; border: 0; background: none; }
@media (max-width: 600px) { #map:not(.big) { width: 130px; height: 130px; bottom: 100px; } }
@media (pointer: coarse) { .desk { display: none; } }
@media (pointer: fine) { .touch { display: none; } }
@@ -45,12 +52,18 @@
<h1>3D walkthrough</h1>
<p id="status">Loading…</p>
<p class="desk"><kbd>W A S D</kbd> walk · <kbd>Mouse</kbd> look · <kbd>Shift</kbd> run · <kbd>T</kbd> top view · <kbd>Esc</kbd> pause</p>
- <p class="desk"><kbd>P</kbd> screenshot · <kbd>R</kbd> start / stop recording · <kbd>M</kbd> map · <kbd>N</kbd> measure · <kbd>G</kbd> guided tour (recorded)</p>
+ <p class="desk"><kbd>P</kbd> screenshot · <kbd>R</kbd> start / stop recording · <kbd>M</kbd> map · <kbd>N</kbd> measure · <kbd>F</kbd> finishes · <kbd>G</kbd> guided tour (recorded)</p>
<p class="touch">Left thumb: move · right thumb: look</p>
</div>
<div id="room"></div>
<div id="cross"></div>
-<div id="bar"><button id="topbtn">Top view</button><span id="floors"></span><button id="measure" title="Measure a distance: click two points (N)">Measure</button><button id="shot" title="Save a picture of this view (P)">Screenshot</button><button id="rec" title="Record a video of your walk (R)">Record</button><button id="tour" title="Walk through every room by itself and record it as a video where this browser can record (G); any key or click stops">Tour</button><button id="blend" title="Download this house as a Blender file (.zip)">Blender file</button><button id="site" title="Download this walkthrough as a website for any web host (.zip)">Website</button><a href="/" id="newplan" style="color:#ccc;font-size:13px">Home</a><span id="fps"></span></div>
+<div id="bar"><button id="topbtn">Top view</button><span id="floors"></span><button id="measure" title="Measure a distance: click two points (N)">Measure</button><button id="finbtn" title="Try another wall colour, or another floor in this room (F)">Finishes</button><button id="shot" title="Save a picture of this view (P)">Screenshot</button><button id="rec" title="Record a video of your walk (R)">Record</button><button id="tour" title="Walk through every room by itself and record it as a video where this browser can record (G); any key or click stops">Tour</button><button id="blend" title="Download this house as a Blender file (.zip)">Blender file</button><button id="site" title="Download this walkthrough as a website for any web host (.zip)">Website</button><a href="/" id="newplan" style="color:#ccc;font-size:13px">Home</a><span id="fps"></span></div>
+<div id="fin" hidden>
+ <div class="r" id="fwrow"><span>Wall colour</span><input type="color" id="fwall"></div>
+ <div class="r" id="frow" hidden><span>Floor · <b id="froom"></b></span><select id="ffloor"></select></div>
+ <div class="r"><button id="fsave">Save for the next build</button></div>
+ <p id="fmsg">The light stays as built until the next build.</p>
+</div>
<script type="module" src="view.js"></script>
</body>
</html>
diff --git a/web/view.js b/web/view.js
index 12eba70..a1d5694 100644
--- a/web/view.js
+++ b/web/view.js
@@ -53,6 +53,7 @@ if (!baked) {
sun.position.set(-8, 14, 6);
scene.add(sun);
}
+const mats = {}; // material name -> its copies in the scene (the Finishes panel changes them)
const levels = []; // level index -> objects (hidden above the current level in top view)
gltf.scene.traverse((o) => {
if (!o.isMesh) return;
@@ -75,7 +76,8 @@ gltf.scene.traverse((o) => {
}
return new THREE.MeshLambertMaterial(opts);
};
- o.material = Array.isArray(o.material) ? o.material.map(conv) : conv(o.material);
+ const keep = (m) => { const c = conv(m); (mats[m.name] ||= []).push(c); return c; };
+ o.material = Array.isArray(o.material) ? o.material.map(keep) : keep(o.material);
const m = /^bake_level_(\d+)/.exec(root.name) || /_(\d+)$/.exec(root.name);
if (m && /^(bake_level|glass)/.test(root.name)) (levels[+m[1]] ||= []).push(o);
});
@@ -92,8 +94,9 @@ function roomAt(lv, x, y) {
// ---- player
const p = { ...walk.entrance(meta), z: floors[0].z, yaw: 0, pitch: 0 };
const keys = {};
-let locked = false, topView = false, measuring = false;
+let locked = false, topView = false, measuring = false, finishing = false;
addEventListener('keydown', (e) => {
+ if (e.target.closest?.('#fin')) return; // keys in the Finishes panel's fields are not for walking
if (tour) { if (!e.repeat) stopTour(); return; } // any key ends the tour (a held G only repeats)
keys[e.code] = true;
if (e.code === 'KeyG' && !e.repeat) startTour();
@@ -102,24 +105,26 @@ addEventListener('keydown', (e) => {
if (e.code === 'KeyR' && !e.repeat) toggleRec();
if (e.code === 'KeyM' && !e.repeat) toggleMap();
if (e.code === 'KeyN' && !e.repeat) setMeasure(!measuring);
+ if (e.code === 'KeyF' && !e.repeat) setFinish(!finishing);
if (e.code === 'Escape' && measuring) setMeasure(false);
+ if (e.code === 'Escape' && finishing) setFinish(false);
});
addEventListener('keyup', (e) => { keys[e.code] = false; });
addEventListener('blur', () => { for (const k in keys) keys[k] = false; }); // a key let go in another window never sends keyup here
const canvas = renderer.domElement;
// back to walking: capture the mouse again, or looking around stays dead with nothing to click
-const capture = () => { if (!matchMedia('(pointer: coarse)').matches) canvas.requestPointerLock()?.catch?.(() => { if (!topView && !measuring) $('overlay').style.display = 'flex'; }); };
+const capture = () => { if (!finishing && !matchMedia('(pointer: coarse)').matches) canvas.requestPointerLock()?.catch?.(() => { if (!topView && !measuring) $('overlay').style.display = 'flex'; }); };
$('overlay').addEventListener('click', () => {
if (matchMedia('(pointer: coarse)').matches) { $('overlay').style.display = 'none'; return; }
canvas.requestPointerLock();
});
document.addEventListener('pointerlockchange', () => {
locked = document.pointerLockElement === canvas;
- $('overlay').style.display = locked || topView || measuring || tour ? 'none' : 'flex';
+ $('overlay').style.display = locked || topView || measuring || finishing || tour ? 'none' : 'flex';
if (locked && tour) document.exitPointerLock(); // (a lock asked for by leaving the top view lands late)
});
// the browser refused to capture the mouse: show the start screen, whose click captures it
-document.addEventListener('pointerlockerror', () => { if (!topView && !measuring && !tour) $('overlay').style.display = 'flex'; });
+document.addEventListener('pointerlockerror', () => { if (!topView && !measuring && !finishing && !tour) $('overlay').style.display = 'flex'; });
addEventListener('mousemove', (e) => {
if (tour || (!locked && !(measuring && !topView && e.buttons))) return; // measuring frees the mouse: drag to look instead
p.yaw -= e.movementX * 0.0022;
@@ -317,6 +322,68 @@ function drawMap(lv) {
}
}
+// ---- finishes (F): another wall colour, or another floor for the room you stand in, tried on at once. The light stays
+// as it was baked for the old finish until the next build; Save puts the choice in the plan for that build.
+const FIN = { marble: 'Marble', wood: 'Wood', tile: 'Tiles', bathtile: 'Bathroom tiles', terracotta: 'Terracotta', concrete: 'Concrete' };
+const WALL0 = '#efe7da'; // edit.js WALL: the build's own white, saved as no wall_color
+const finTex = {}, chosen = { floors: {} }; // floors: '<level>_<room index in the plan>' -> finish
+let finRoom;
+const finLoad = (n) => (finTex[n] ||= texLoader.loadAsync(base + meta.finishes[n].file).then((t) => {
+ t.colorSpace = THREE.SRGBColorSpace;
+ t.flipY = false; // as glTF textures
+ t.wrapS = t.wrapT = THREE.RepeatWrapping;
+ return t;
+}));
+$('ffloor').innerHTML = Object.keys(meta.finishes || {}).map((n) => `<option value="${n}">${FIN[n] || n}</option>`).join('');
+$('fwrow').hidden = !mats.wall;
+if (mats.wall) $('fwall').value = '#' + mats.wall[0].color.getHexString();
+$('fsave').parentNode.hidden = site; // the downloaded website has no server to save to
+function setFinish(on) {
+ finishing = on;
+ $('fin').hidden = !on;
+ $('finbtn').classList.toggle('on', on);
+ finRoom = undefined;
+ if (on) { if (tour) stopTour(); document.exitPointerLock?.(); $('overlay').style.display = 'none'; }
+ else if (!topView && !measuring) capture();
+}
+function finUpdate(lv) { // the floor row follows you from room to room
+ const r = meta.finishes && floors[lv].rooms.find((q) => q.floor && q.rects.some((c) => walk.inRect(c, p.x, p.y)));
+ const key = r ? `${lv}_${r.i}` : null;
+ if (key === finRoom) return;
+ finRoom = key;
+ $('frow').hidden = !key;
+ if (key) { $('froom').textContent = roomName(r); $('ffloor').value = chosen.floors[key] || r.floor; }
+}
+$('finbtn').onclick = () => setFinish(!finishing);
+$('fwall').oninput = (e) => { chosen.wall = e.target.value; mats.wall?.forEach((m) => m.color.set(chosen.wall)); };
+$('ffloor').onchange = async (e) => {
+ const key = finRoom, n = e.target.value, [lv, i] = key.split('_').map(Number);
+ const built = floors[lv].rooms.find((q) => q.i === i).floor;
+ chosen.floors[key] = n;
+ const t = await finLoad(n);
+ if (chosen.floors[key] !== n) return; // a quicker later choice won
+ for (const m of mats[`floor_${key}`] || []) {
+ m.map = t.clone(); // its own repeat: the room's UVs count tiles of the finish it was built with
+ m.map.repeat.setScalar(meta.finishes[built].tile / meta.finishes[n].tile);
+ m.needsUpdate = true;
+ }
+};
+$('fsave').onclick = async () => {
+ try {
+ const plan = await fetch(`/jobs/${job}/plan.json`, { cache: 'no-store' }).then((r) => r.json());
+ for (const [key, n] of Object.entries(chosen.floors)) {
+ const [lv, i] = key.split('_').map(Number), z = plan.floors[lv]?.rooms?.[i];
+ if (z?.type !== floors[lv].rooms.find((q) => q.i === i).type) throw new Error('The plan was changed after this build: choose floors on the review page.');
+ z.floor = n;
+ }
+ if (chosen.wall === WALL0) delete plan.wall_color;
+ else if (chosen.wall) plan.wall_color = chosen.wall;
+ const r = await fetch(`/api/jobs/${job}/plan`, { method: 'POST', body: JSON.stringify(plan) }), j = await r.json();
+ if (!r.ok) throw new Error(j.error);
+ $('fmsg').textContent = 'Saved. Build again on the review page to bake the light for it.';
+ } catch (e) { $('fmsg').textContent = e.message || 'Could not save.'; }
+};
+
// ---- screenshot (P) and video recording (R): the 3D view only, without the buttons and labels
function save(blob, ext) {
const a = document.createElement('a');
@@ -499,6 +566,7 @@ renderer.setAnimationLoop(() => {
const lv = walk.levelOf(meta, p.z);
$('room').textContent = [floors[lv].name, roomAt(lv, p.x, p.y)].filter(Boolean).join(' · ');
drawMap(lv);
+ if (finishing) finUpdate(lv);
} else orbit.update();
renderer.render(scene, camera);
});