feat: add 3D hydronic manifolds buffer tanks and fresh water stations

This commit is contained in:
jhartworks committed 2026-11-12 14:28:30 +01:00
1 parent 93c015ec77
commit 173d02e3cc
37 files changed
+3253 -1815

No files matched your search

@@ -25,6 +25,7 @@ import {
type Vec2,
} from "../../../model.ts";
import { furnitureSize } from "../../../packs.ts";
import { defaultHydronic, isHydronic } from "../../../hydronic-model.ts";
const thousandths = (v: number) => Math.round(v * 1000) / 1000;
const quarterTurns = (degrees: number, by: number) => (((degrees + by) % 360) + 360) % 360;
@@ -74,6 +75,7 @@ export function newFurniture(type: string, doc: Building, floor: Floor, at: Vec2
const above = doc.floors.filter((f) => f.elevation > floor.elevation).sort((p, q) => p.elevation - q.elevation)[0];
const h = type === "stairs" ? thousandths(above ? above.elevation - floor.elevation : floor.height + 0.25) : height;
const item: Furniture = { id: uid("furniture"), type, x: thousandths(at[0]), z: thousandths(at[1]), rotation: 0, w, d, h, variant: null };
if (isHydronic(type)) item.hydronic = defaultHydronic(type);
// new stairs are shaped stairs: shape, turn and steps are set in the form, and they open only the floor they need
if (type === "stairs") item.stair = { ...DEFAULT_STAIR };
return item;