bimdown-cli 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -3
- package/dist/chunk-4SKM4RHY.js +142 -0
- package/dist/chunk-4SKM4RHY.js.map +1 -0
- package/dist/chunk-4YHVOWS4.js +255 -0
- package/dist/chunk-4YHVOWS4.js.map +1 -0
- package/dist/chunk-AYAXRYGP.js +2129 -0
- package/dist/chunk-AYAXRYGP.js.map +1 -0
- package/dist/chunk-EC5MR5ZH.js +648 -0
- package/dist/chunk-EC5MR5ZH.js.map +1 -0
- package/dist/chunk-HS3PO2LB.js +487 -0
- package/dist/chunk-HS3PO2LB.js.map +1 -0
- package/dist/chunk-IQJA3EFO.js +179 -0
- package/dist/chunk-IQJA3EFO.js.map +1 -0
- package/dist/chunk-JY6KWRDB.js +80 -0
- package/dist/chunk-JY6KWRDB.js.map +1 -0
- package/dist/chunk-KWSGJUMZ.js +2501 -0
- package/dist/chunk-KWSGJUMZ.js.map +1 -0
- package/dist/chunk-LWYIPR64.js +35 -0
- package/dist/chunk-LWYIPR64.js.map +1 -0
- package/dist/chunk-OBY3UYCO.js +44 -0
- package/dist/chunk-OBY3UYCO.js.map +1 -0
- package/dist/chunk-XC6WHJRL.js +29 -0
- package/dist/chunk-XC6WHJRL.js.map +1 -0
- package/dist/chunk-XQU52JKB.js +187 -0
- package/dist/chunk-XQU52JKB.js.map +1 -0
- package/dist/clash-load-D3LNQR6G.js +941 -0
- package/dist/clash-load-D3LNQR6G.js.map +1 -0
- package/dist/cli.js +306 -3377
- package/dist/cli.js.map +1 -1
- package/dist/dehydrate-ZHAGOI7Q.js +90 -0
- package/dist/dehydrate-ZHAGOI7Q.js.map +1 -0
- package/dist/diff-T2KOK2WR.js +89 -0
- package/dist/diff-T2KOK2WR.js.map +1 -0
- package/dist/engine-2TPWJVEQ.js +12 -0
- package/dist/engine-2TPWJVEQ.js.map +1 -0
- package/dist/hydrate-V24H7IF3.js +673 -0
- package/dist/hydrate-V24H7IF3.js.map +1 -0
- package/dist/import-ifc-RCZSXDA6.js +5324 -0
- package/dist/import-ifc-RCZSXDA6.js.map +1 -0
- package/dist/info-QC7YXWNX.js +92 -0
- package/dist/info-QC7YXWNX.js.map +1 -0
- package/dist/init-VWDML3UC.js +112 -0
- package/dist/init-VWDML3UC.js.map +1 -0
- package/dist/lib.d.ts +427 -44
- package/dist/lib.js +6482 -225
- package/dist/lib.js.map +1 -1
- package/dist/mep-W4HJI363.js +25 -0
- package/dist/mep-W4HJI363.js.map +1 -0
- package/dist/merge-ESOPDSA5.js +413 -0
- package/dist/merge-ESOPDSA5.js.map +1 -0
- package/dist/publish-3TAXQCUV.js +80 -0
- package/dist/publish-3TAXQCUV.js.map +1 -0
- package/dist/render-UEWYHPN6.js +1807 -0
- package/dist/render-UEWYHPN6.js.map +1 -0
- package/dist/resolve-topology-AQ2RO3W3.js +338 -0
- package/dist/resolve-topology-AQ2RO3W3.js.map +1 -0
- package/dist/spec/csv-schema/annotation/dimension.yaml +77 -0
- package/dist/spec/csv-schema/annotation/tag.yaml +44 -0
- package/dist/spec/csv-schema/annotation/text_note.yaml +52 -0
- package/dist/spec/csv-schema/architecture/ceiling.yaml +8 -1
- package/dist/spec/csv-schema/architecture/column.yaml +5 -1
- package/dist/spec/csv-schema/architecture/curtain_wall.yaml +45 -5
- package/dist/spec/csv-schema/architecture/door.yaml +5 -0
- package/dist/spec/csv-schema/architecture/furniture.yaml +28 -0
- package/dist/spec/csv-schema/architecture/opening.yaml +27 -6
- package/dist/spec/csv-schema/architecture/railing.yaml +35 -0
- package/dist/spec/csv-schema/architecture/roof.yaml +34 -1
- package/dist/spec/csv-schema/architecture/slab.yaml +19 -0
- package/dist/spec/csv-schema/architecture/space.yaml +11 -1
- package/dist/spec/csv-schema/architecture/stair.yaml +49 -0
- package/dist/spec/csv-schema/architecture/stair_landing.yaml +36 -0
- package/dist/spec/csv-schema/architecture/stair_run.yaml +31 -0
- package/dist/spec/csv-schema/architecture/wall.yaml +14 -1
- package/dist/spec/csv-schema/architecture/window.yaml +19 -0
- package/dist/spec/csv-schema/base/element.yaml +20 -11
- package/dist/spec/csv-schema/base/furniture_params.yaml +60 -0
- package/dist/spec/csv-schema/base/hosted_element.yaml +10 -2
- package/dist/spec/csv-schema/base/mep_connectable.yaml +23 -0
- package/dist/spec/csv-schema/base/mep_design.yaml +24 -0
- package/dist/spec/csv-schema/base/mep_insulated.yaml +9 -0
- package/dist/spec/csv-schema/base/mep_system_tag.yaml +12 -0
- package/dist/spec/csv-schema/base/point_element.yaml +1 -0
- package/dist/spec/csv-schema/base/section_profile.yaml +5 -0
- package/dist/spec/csv-schema/base/spatial_line_element.yaml +4 -2
- package/dist/spec/csv-schema/base/structural_section_profile.yaml +50 -0
- package/dist/spec/csv-schema/base/vertical_span.yaml +5 -4
- package/dist/spec/csv-schema/base/wall_bounded.yaml +21 -0
- package/dist/spec/csv-schema/grid.yaml +5 -0
- package/dist/spec/csv-schema/mep/cable_tray.yaml +10 -3
- package/dist/spec/csv-schema/mep/circuit.yaml +70 -0
- package/dist/spec/csv-schema/mep/conduit.yaml +2 -2
- package/dist/spec/csv-schema/mep/connector.yaml +112 -0
- package/dist/spec/csv-schema/mep/duct.yaml +10 -3
- package/dist/spec/csv-schema/mep/equipment.yaml +18 -1
- package/dist/spec/csv-schema/mep/mep_node.yaml +91 -2
- package/dist/spec/csv-schema/mep/mep_system.yaml +21 -0
- package/dist/spec/csv-schema/mep/pipe.yaml +27 -3
- package/dist/spec/csv-schema/mep/terminal.yaml +22 -1
- package/dist/spec/csv-schema/model_group.yaml +40 -0
- package/dist/spec/csv-schema/sheet/sheet.yaml +50 -0
- package/dist/spec/csv-schema/sheet/sheet_viewport.yaml +86 -0
- package/dist/spec/csv-schema/structure/beam.yaml +29 -1
- package/dist/spec/csv-schema/structure/beam_system.yaml +29 -0
- package/dist/spec/csv-schema/structure/brace.yaml +24 -1
- package/dist/spec/csv-schema/structure/foundation.yaml +40 -7
- package/dist/spec/csv-schema/structure/structure_column.yaml +19 -1
- package/dist/spec/csv-schema/structure/structure_slab.yaml +32 -0
- package/dist/spec/csv-schema/structure/structure_wall.yaml +22 -0
- package/dist/spec/csv-schema/types/beam_type.yaml +11 -0
- package/dist/spec/csv-schema/types/ceiling_type.yaml +6 -0
- package/dist/spec/csv-schema/types/column_type.yaml +12 -0
- package/dist/spec/csv-schema/types/curtain_wall_type.yaml +32 -0
- package/dist/spec/csv-schema/types/door_type.yaml +27 -0
- package/dist/spec/csv-schema/types/element_type.yaml +21 -0
- package/dist/spec/csv-schema/types/fenestration.yaml +16 -0
- package/dist/spec/csv-schema/types/foundation_type.yaml +36 -0
- package/dist/spec/csv-schema/types/furniture_type.yaml +11 -0
- package/dist/spec/csv-schema/types/layered_type.yaml +13 -0
- package/dist/spec/csv-schema/types/railing_type.yaml +40 -0
- package/dist/spec/csv-schema/types/roof_type.yaml +7 -0
- package/dist/spec/csv-schema/types/slab_type.yaml +9 -0
- package/dist/spec/csv-schema/types/type_layer.yaml +47 -0
- package/dist/spec/csv-schema/types/wall_type.yaml +6 -0
- package/dist/spec/csv-schema/types/window_type.yaml +31 -0
- package/dist/spec/csv-schema/underlay.yaml +73 -0
- package/dist/spec/csv-schema/view.yaml +36 -0
- package/dist/spec/duckdb-strategy.md +4 -3
- package/dist/spec/geojson-schema/readme.md +380 -0
- package/dist/spec/mep-port-conventions.md +190 -0
- package/dist/spec/migration-guide.md +1 -1
- package/dist/spec/project_metadata.schema.yaml +52 -4
- package/dist/spec/readme.md +356 -97
- package/dist/spec/starter-types/global/beam_type.csv +5 -0
- package/dist/spec/starter-types/global/ceiling_type.csv +3 -0
- package/dist/spec/starter-types/global/column_type.csv +5 -0
- package/dist/spec/starter-types/global/curtain_wall_type.csv +2 -0
- package/dist/spec/starter-types/global/door_type.csv +6 -0
- package/dist/spec/starter-types/global/foundation_type.csv +7 -0
- package/dist/spec/starter-types/global/furniture_type.csv +11 -0
- package/dist/spec/starter-types/global/railing_type.csv +5 -0
- package/dist/spec/starter-types/global/roof_type.csv +3 -0
- package/dist/spec/starter-types/global/slab_type.csv +4 -0
- package/dist/spec/starter-types/global/type_layer.csv +40 -0
- package/dist/spec/starter-types/global/wall_type.csv +8 -0
- package/dist/spec/starter-types/global/window_type.csv +6 -0
- package/dist/spec/svg-schema/readme.md +47 -1
- package/package.json +6 -3
- package/dist/spec/csv-schema/base/mep_connected_segment.yaml +0 -17
- package/dist/spec/csv-schema/base/mep_system.yaml +0 -7
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
formatProblem,
|
|
4
|
+
mepReport
|
|
5
|
+
} from "./chunk-EC5MR5ZH.js";
|
|
6
|
+
import "./chunk-IQJA3EFO.js";
|
|
7
|
+
import {
|
|
8
|
+
extractLineGeometry,
|
|
9
|
+
extractPointGeometry,
|
|
10
|
+
parseGeoJsonFile,
|
|
11
|
+
stringifyFeatureCollection
|
|
12
|
+
} from "./chunk-4SKM4RHY.js";
|
|
13
|
+
import {
|
|
14
|
+
GEOJSON_FILE_NAMES,
|
|
15
|
+
ID_PREFIXES,
|
|
16
|
+
buildRegistry,
|
|
17
|
+
getSpecDir
|
|
18
|
+
} from "./chunk-4YHVOWS4.js";
|
|
19
|
+
import {
|
|
20
|
+
readCsv,
|
|
21
|
+
writeCsv
|
|
22
|
+
} from "./chunk-JY6KWRDB.js";
|
|
23
|
+
import {
|
|
24
|
+
discoverLayout,
|
|
25
|
+
listFiles
|
|
26
|
+
} from "./chunk-OBY3UYCO.js";
|
|
27
|
+
|
|
28
|
+
// src/commands/resolve-topology.ts
|
|
29
|
+
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
30
|
+
import { join } from "path";
|
|
31
|
+
var TOLERANCE = 0.01;
|
|
32
|
+
var CURVE_TABLES = ["duct", "pipe", "cable_tray", "conduit"];
|
|
33
|
+
var NODE_TABLES = ["equipment", "terminal", "mep_node"];
|
|
34
|
+
var DOMAIN_TABLES = {
|
|
35
|
+
hvac: ["duct"],
|
|
36
|
+
piping: ["pipe"],
|
|
37
|
+
electrical: ["conduit", "cable_tray"],
|
|
38
|
+
cable_tray_conduit: ["conduit", "cable_tray"]
|
|
39
|
+
};
|
|
40
|
+
function dist3d(a, b) {
|
|
41
|
+
const dx = a.x - b.x, dy = a.y - b.y, dz = a.z - b.z;
|
|
42
|
+
return Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
43
|
+
}
|
|
44
|
+
function near(a, b) {
|
|
45
|
+
return dist3d(a, b) <= TOLERANCE;
|
|
46
|
+
}
|
|
47
|
+
function toFloat(val, fallback = 0) {
|
|
48
|
+
const n = parseFloat(String(val ?? ""));
|
|
49
|
+
return Number.isFinite(n) ? n : fallback;
|
|
50
|
+
}
|
|
51
|
+
function systemsCompatible(a, b) {
|
|
52
|
+
return !a || !b || a === b;
|
|
53
|
+
}
|
|
54
|
+
function connectorWorldPos(node, row) {
|
|
55
|
+
const ox = toFloat(row.offset_x);
|
|
56
|
+
const oy = toFloat(row.offset_y);
|
|
57
|
+
const oz = toFloat(row.offset_z);
|
|
58
|
+
const theta = node.rotation * Math.PI / 180;
|
|
59
|
+
const c = Math.cos(theta);
|
|
60
|
+
const s = Math.sin(theta);
|
|
61
|
+
return {
|
|
62
|
+
x: node.pos.x + (ox * c - oy * s),
|
|
63
|
+
y: node.pos.y + (ox * s + oy * c),
|
|
64
|
+
z: node.pos.z + oz
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function projectOnSegment(p, a, b) {
|
|
68
|
+
const dx = b.x - a.x, dy = b.y - a.y, dz = b.z - a.z;
|
|
69
|
+
const len2 = dx * dx + dy * dy + dz * dz;
|
|
70
|
+
if (len2 < 1e-12) return { t: 0, d: dist3d(p, a), at: a };
|
|
71
|
+
const t = Math.max(0, Math.min(1, ((p.x - a.x) * dx + (p.y - a.y) * dy + (p.z - a.z) * dz) / len2));
|
|
72
|
+
const at = { x: a.x + dx * t, y: a.y + dy * t, z: a.z + dz * t };
|
|
73
|
+
return { t, d: dist3d(p, at), at };
|
|
74
|
+
}
|
|
75
|
+
var round3 = (n) => Number(n.toFixed(4));
|
|
76
|
+
function resolveTopology(dir) {
|
|
77
|
+
buildRegistry(getSpecDir());
|
|
78
|
+
const layout = discoverLayout(dir);
|
|
79
|
+
const allDirs = [{ name: "global", path: layout.globalDir }, ...layout.levelDirs];
|
|
80
|
+
const dirPath = (name) => name === "global" ? layout.globalDir : join(dir, name);
|
|
81
|
+
const files = /* @__PURE__ */ new Map();
|
|
82
|
+
const openTable = (d, table) => {
|
|
83
|
+
const key = `${d}/${table}`;
|
|
84
|
+
let f = files.get(key);
|
|
85
|
+
if (f) return f;
|
|
86
|
+
const p = dirPath(d);
|
|
87
|
+
const csvPath = join(p, `${table}.csv`);
|
|
88
|
+
const geomPath = join(p, `${GEOJSON_FILE_NAMES[table]}.geojson`);
|
|
89
|
+
let csv = existsSync(csvPath) ? readCsv(csvPath) : { headers: ["id", "number", "system_type"], rows: [] };
|
|
90
|
+
let fc = { type: "FeatureCollection", features: [] };
|
|
91
|
+
if (existsSync(geomPath)) {
|
|
92
|
+
try {
|
|
93
|
+
fc = parseGeoJsonFile(geomPath);
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (!csv.headers.includes("id")) csv = { ...csv, headers: ["id", ...csv.headers] };
|
|
98
|
+
f = { csv, csvPath, fc, geomPath, dirty: false };
|
|
99
|
+
files.set(key, f);
|
|
100
|
+
return f;
|
|
101
|
+
};
|
|
102
|
+
const curves = [];
|
|
103
|
+
const usedIds = /* @__PURE__ */ new Set();
|
|
104
|
+
for (const d of allDirs) {
|
|
105
|
+
if (!existsSync(d.path)) continue;
|
|
106
|
+
const present = listFiles(d.path);
|
|
107
|
+
for (const f of present) {
|
|
108
|
+
if (!f.endsWith(".csv")) continue;
|
|
109
|
+
for (const r of readCsv(join(d.path, f)).rows) {
|
|
110
|
+
if (r.id) usedIds.add(r.id);
|
|
111
|
+
for (const ref of [r.from, r.to]) {
|
|
112
|
+
const h = (ref ?? "").split(":")[0];
|
|
113
|
+
if (h) usedIds.add(h);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
for (const table of CURVE_TABLES) {
|
|
118
|
+
if (!present.includes(`${table}.csv`) || !present.includes(`${GEOJSON_FILE_NAMES[table]}.geojson`)) continue;
|
|
119
|
+
const tf = openTable(d.name, table);
|
|
120
|
+
const geoById = /* @__PURE__ */ new Map();
|
|
121
|
+
for (const feat of tf.fc.features) {
|
|
122
|
+
const id = String(feat.properties?.id ?? "");
|
|
123
|
+
if (id) geoById.set(id, feat);
|
|
124
|
+
}
|
|
125
|
+
for (const row of tf.csv.rows) {
|
|
126
|
+
const feat = geoById.get(row.id);
|
|
127
|
+
if (!feat || feat.geometry.type !== "LineString") continue;
|
|
128
|
+
const lg = extractLineGeometry(feat);
|
|
129
|
+
curves.push({
|
|
130
|
+
id: row.id,
|
|
131
|
+
table,
|
|
132
|
+
dir: d.name,
|
|
133
|
+
row,
|
|
134
|
+
feat,
|
|
135
|
+
a: { x: lg.start_x, y: lg.start_y, z: lg.start_z ?? 0 },
|
|
136
|
+
b: { x: lg.end_x, y: lg.end_y, z: lg.end_z ?? 0 }
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const totalCurves = curves.length;
|
|
142
|
+
let alreadyResolved = 0;
|
|
143
|
+
for (const c of curves) {
|
|
144
|
+
if (c.row.from) alreadyResolved++;
|
|
145
|
+
if (c.row.to) alreadyResolved++;
|
|
146
|
+
}
|
|
147
|
+
const nodes = [];
|
|
148
|
+
for (const d of allDirs) {
|
|
149
|
+
if (!existsSync(d.path)) continue;
|
|
150
|
+
const present = listFiles(d.path);
|
|
151
|
+
for (const tableName of NODE_TABLES) {
|
|
152
|
+
if (!present.includes(`${tableName}.csv`) || !present.includes(`${GEOJSON_FILE_NAMES[tableName]}.geojson`)) continue;
|
|
153
|
+
const csv = readCsv(join(d.path, `${tableName}.csv`));
|
|
154
|
+
let fc;
|
|
155
|
+
try {
|
|
156
|
+
fc = parseGeoJsonFile(join(d.path, `${GEOJSON_FILE_NAMES[tableName]}.geojson`));
|
|
157
|
+
} catch {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const posById = /* @__PURE__ */ new Map();
|
|
161
|
+
for (const f of fc.features) {
|
|
162
|
+
if (f.geometry.type !== "Point") continue;
|
|
163
|
+
const id = String(f.properties?.id ?? "");
|
|
164
|
+
if (!id) continue;
|
|
165
|
+
const pg = extractPointGeometry(f);
|
|
166
|
+
posById.set(id, { pos: { x: pg.x, y: pg.y, z: pg.z ?? 0 }, rotation: toFloat(f.properties?.rotation) });
|
|
167
|
+
}
|
|
168
|
+
for (const row of csv.rows) {
|
|
169
|
+
const p = posById.get(row.id);
|
|
170
|
+
if (!p) continue;
|
|
171
|
+
nodes.push({ levelDir: d.name, tableName, id: row.id, pos: p.pos, rotation: p.rotation, system: row.system_type ?? "" });
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const nodeByKey = new Map(nodes.map((n) => [`${n.levelDir}/${n.id}`, n]));
|
|
176
|
+
const connectors = [];
|
|
177
|
+
for (const d of allDirs) {
|
|
178
|
+
if (!existsSync(d.path) || !listFiles(d.path).includes("connector.csv")) continue;
|
|
179
|
+
for (const row of readCsv(join(d.path, "connector.csv")).rows) {
|
|
180
|
+
const host = nodeByKey.get(`${d.name}/${row.host_id ?? ""}`) ?? nodeByKey.get(`global/${row.host_id ?? ""}`);
|
|
181
|
+
if (!host || !row.name) continue;
|
|
182
|
+
connectors.push({
|
|
183
|
+
hostId: row.host_id,
|
|
184
|
+
name: row.name,
|
|
185
|
+
systemType: row.system_type ?? "",
|
|
186
|
+
domain: row.domain ?? "",
|
|
187
|
+
worldPos: connectorWorldPos(host, row)
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const nextId = (table) => {
|
|
192
|
+
const prefix = ID_PREFIXES[table];
|
|
193
|
+
let n = 1;
|
|
194
|
+
while (usedIds.has(`${prefix}-${n}`)) n++;
|
|
195
|
+
const id = `${prefix}-${n}`;
|
|
196
|
+
usedIds.add(id);
|
|
197
|
+
return id;
|
|
198
|
+
};
|
|
199
|
+
const newNodes = [];
|
|
200
|
+
const addNode = (d, pos, system) => {
|
|
201
|
+
const id = nextId("mep_node");
|
|
202
|
+
newNodes.push({ id, dir: d, pos, system });
|
|
203
|
+
nodes.push({ levelDir: d, tableName: "mep_node", id, pos, rotation: 0, system });
|
|
204
|
+
return id;
|
|
205
|
+
};
|
|
206
|
+
const setRef = (c, side, ref) => {
|
|
207
|
+
if (!openTable(c.dir, c.table).csv.headers.includes(side)) openTable(c.dir, c.table).csv.headers.push(side);
|
|
208
|
+
c.row[side] = ref;
|
|
209
|
+
openTable(c.dir, c.table).dirty = true;
|
|
210
|
+
};
|
|
211
|
+
let portMatches = 0, nodeMatches = 0, tees = 0;
|
|
212
|
+
const stillFree = [];
|
|
213
|
+
for (let ci = 0; ci < curves.length; ci++) {
|
|
214
|
+
const c = curves[ci];
|
|
215
|
+
for (const side of ["from", "to"]) {
|
|
216
|
+
if (c.row[side]) continue;
|
|
217
|
+
const p = side === "from" ? c.a : c.b;
|
|
218
|
+
const sys = c.row.system_type ?? "";
|
|
219
|
+
let best = null;
|
|
220
|
+
let bestD = Infinity;
|
|
221
|
+
for (const cn of connectors) {
|
|
222
|
+
const allowed = DOMAIN_TABLES[cn.domain];
|
|
223
|
+
if (allowed && !allowed.includes(c.table)) continue;
|
|
224
|
+
const d = dist3d(p, cn.worldPos);
|
|
225
|
+
if (d > TOLERANCE) continue;
|
|
226
|
+
const better = d < bestD - 1e-9 || sys && cn.systemType === sys && best?.systemType !== sys;
|
|
227
|
+
if (!best || better) {
|
|
228
|
+
best = cn;
|
|
229
|
+
bestD = d;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (best) {
|
|
233
|
+
setRef(c, side, `${best.hostId}:${best.name}`);
|
|
234
|
+
portMatches++;
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
const node = nodes.find((n) => near(p, n.pos) && (n.tableName !== "mep_node" || systemsCompatible(n.system, sys)));
|
|
238
|
+
if (node) {
|
|
239
|
+
setRef(c, side, node.id);
|
|
240
|
+
nodeMatches++;
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
let hit = null;
|
|
244
|
+
for (const other of curves) {
|
|
245
|
+
if (other === c || other.table !== c.table || other.feat.properties?.arc) continue;
|
|
246
|
+
if (!systemsCompatible(other.row.system_type ?? "", sys)) continue;
|
|
247
|
+
const pr = projectOnSegment(p, other.a, other.b);
|
|
248
|
+
if (pr.d > TOLERANCE) continue;
|
|
249
|
+
if (dist3d(pr.at, other.a) <= TOLERANCE || dist3d(pr.at, other.b) <= TOLERANCE) continue;
|
|
250
|
+
hit = { other, at: pr.at };
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
if (hit) {
|
|
254
|
+
const { other, at } = hit;
|
|
255
|
+
const nodeId = addNode(other.dir, at, other.row.system_type || sys);
|
|
256
|
+
const tf = openTable(other.dir, other.table);
|
|
257
|
+
const newId = nextId(other.table);
|
|
258
|
+
const newRow = { ...other.row, id: newId, from: nodeId, to: other.row.to ?? "" };
|
|
259
|
+
for (const h of ["from", "to"]) if (!tf.csv.headers.includes(h)) tf.csv.headers.push(h);
|
|
260
|
+
tf.csv.rows.push(newRow);
|
|
261
|
+
other.row.to = nodeId;
|
|
262
|
+
const coords = other.feat.geometry.coordinates;
|
|
263
|
+
const end = coords[coords.length - 1];
|
|
264
|
+
const mid = [round3(at.x), round3(at.y), round3(at.z)];
|
|
265
|
+
other.feat.geometry.coordinates = [coords[0], mid];
|
|
266
|
+
const newFeat = {
|
|
267
|
+
type: "Feature",
|
|
268
|
+
properties: { ...other.feat.properties, id: newId },
|
|
269
|
+
geometry: { type: "LineString", coordinates: [mid, end] }
|
|
270
|
+
};
|
|
271
|
+
tf.fc.features.push(newFeat);
|
|
272
|
+
tf.dirty = true;
|
|
273
|
+
curves.push({ id: newId, table: other.table, dir: other.dir, row: newRow, feat: newFeat, a: { ...at }, b: { ...other.b } });
|
|
274
|
+
other.b = { ...at };
|
|
275
|
+
setRef(c, side, nodeId);
|
|
276
|
+
tees++;
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
stillFree.push({ c, side });
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
const junctions = [];
|
|
283
|
+
for (const ep of stillFree) {
|
|
284
|
+
if (ep.c.row[ep.side]) continue;
|
|
285
|
+
const p = ep.side === "from" ? ep.c.a : ep.c.b;
|
|
286
|
+
const sys = ep.c.row.system_type ?? "";
|
|
287
|
+
const j = junctions.find((j2) => near(p, j2.point) && j2.ends[0].c.table === ep.c.table && systemsCompatible(j2.ends[0].c.row.system_type ?? "", sys));
|
|
288
|
+
if (j) j.ends.push(ep);
|
|
289
|
+
else junctions.push({ point: p, ends: [ep] });
|
|
290
|
+
}
|
|
291
|
+
let created = tees;
|
|
292
|
+
for (const j of junctions) {
|
|
293
|
+
if (j.ends.length < 2) continue;
|
|
294
|
+
const sys = j.ends.map((e) => e.c.row.system_type).find(Boolean) ?? "";
|
|
295
|
+
const nodeId = addNode(j.ends[0].c.dir, j.point, sys);
|
|
296
|
+
for (const e of j.ends) setRef(e.c, e.side, nodeId);
|
|
297
|
+
created++;
|
|
298
|
+
}
|
|
299
|
+
for (const n of newNodes) {
|
|
300
|
+
const d = dirPath(n.dir);
|
|
301
|
+
if (!existsSync(d)) mkdirSync(d, { recursive: true });
|
|
302
|
+
const tf = openTable(n.dir, "mep_node");
|
|
303
|
+
for (const h of ["id", "number", "system_type"]) if (!tf.csv.headers.includes(h)) tf.csv.headers.push(h);
|
|
304
|
+
tf.csv.rows.push({ id: n.id, number: "", system_type: n.system });
|
|
305
|
+
tf.fc.features.push({
|
|
306
|
+
type: "Feature",
|
|
307
|
+
properties: { id: n.id },
|
|
308
|
+
geometry: { type: "Point", coordinates: [round3(n.pos.x), round3(n.pos.y), round3(n.pos.z)] }
|
|
309
|
+
});
|
|
310
|
+
tf.dirty = true;
|
|
311
|
+
}
|
|
312
|
+
let written = 0;
|
|
313
|
+
for (const tf of files.values()) {
|
|
314
|
+
if (!tf.dirty) continue;
|
|
315
|
+
writeCsv(tf.csvPath, tf.csv);
|
|
316
|
+
writeFileSync(tf.geomPath, stringifyFeatureCollection(tf.fc), "utf-8");
|
|
317
|
+
written++;
|
|
318
|
+
}
|
|
319
|
+
console.log(`Scanned ${totalCurves} MEP curves (${totalCurves * 2} endpoints)`);
|
|
320
|
+
console.log(` Already connected: ${alreadyResolved}`);
|
|
321
|
+
console.log(` Connected to ports: ${portMatches}, to existing nodes: ${nodeMatches}`);
|
|
322
|
+
console.log(` Tees from ends on a curve body: ${tees} (curves split)`);
|
|
323
|
+
console.log(` New mep_nodes created: ${created}`);
|
|
324
|
+
if (written > 0) console.log(`Updated ${written} file(s)`);
|
|
325
|
+
const problems = mepReport(dir).problems.filter((p) => p.severity === "warning");
|
|
326
|
+
if (problems.length === 0) {
|
|
327
|
+
console.log("MEP connectivity: no problems.");
|
|
328
|
+
} else {
|
|
329
|
+
console.log(`
|
|
330
|
+
${problems.length} connectivity problem(s):`);
|
|
331
|
+
for (const p of problems.slice(0, 30)) console.log(` ${formatProblem(p)}`);
|
|
332
|
+
if (problems.length > 30) console.log(` ... ${problems.length - 30} more (bimdown mep-check <dir>)`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
export {
|
|
336
|
+
resolveTopology
|
|
337
|
+
};
|
|
338
|
+
//# sourceMappingURL=resolve-topology-AQ2RO3W3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/resolve-topology.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { readCsv, writeCsv, type CsvData } from '../utils/csv.js';\nimport {\n parseGeoJsonFile,\n stringifyFeatureCollection,\n extractLineGeometry,\n extractPointGeometry,\n type BimDownFeature,\n type BimDownFeatureCollection,\n} from '../utils/geojson.js';\nimport { discoverLayout, listFiles } from '../utils/fs.js';\nimport { buildRegistry, getSpecDir, GEOJSON_FILE_NAMES, ID_PREFIXES } from '../schema/registry.js';\nimport { mepReport, formatProblem } from '../mep/index.js';\n\nconst TOLERANCE = 0.01; // 1cm in meters\n\nconst CURVE_TABLES = ['duct', 'pipe', 'cable_tray', 'conduit'];\nconst NODE_TABLES = ['equipment', 'terminal', 'mep_node'];\n\n/** Which curve tables a connector domain accepts. */\nconst DOMAIN_TABLES: Record<string, string[]> = {\n hvac: ['duct'],\n piping: ['pipe'],\n electrical: ['conduit', 'cable_tray'],\n cable_tray_conduit: ['conduit', 'cable_tray'],\n};\n\ninterface Point3D { x: number; y: number; z: number }\n\ninterface Curve {\n id: string;\n table: string;\n dir: string;\n row: Record<string, string>;\n feat: BimDownFeature;\n a: Point3D;\n b: Point3D;\n}\n\ninterface NodeEntry {\n levelDir: string;\n tableName: string;\n id: string;\n pos: Point3D;\n rotation: number;\n system: string;\n}\n\ninterface ConnectorEntry {\n hostId: string;\n name: string;\n systemType: string;\n domain: string;\n worldPos: Point3D;\n}\n\ninterface TableFiles {\n csv: CsvData;\n csvPath: string;\n fc: BimDownFeatureCollection;\n geomPath: string;\n dirty: boolean;\n}\n\nfunction dist3d(a: Point3D, b: Point3D): number {\n const dx = a.x - b.x, dy = a.y - b.y, dz = a.z - b.z;\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n}\n\nfunction near(a: Point3D, b: Point3D): boolean {\n return dist3d(a, b) <= TOLERANCE;\n}\n\nfunction toFloat(val: unknown, fallback = 0): number {\n const n = parseFloat(String(val ?? ''));\n return Number.isFinite(n) ? n : fallback;\n}\n\nfunction systemsCompatible(a: string, b: string): boolean {\n return !a || !b || a === b;\n}\n\n/** Resolve a connector row to its world position given its host node's pos + rotation. */\nfunction connectorWorldPos(node: NodeEntry, row: Record<string, string>): Point3D {\n const ox = toFloat(row.offset_x);\n const oy = toFloat(row.offset_y);\n const oz = toFloat(row.offset_z);\n const theta = (node.rotation * Math.PI) / 180;\n const c = Math.cos(theta);\n const s = Math.sin(theta);\n return {\n x: node.pos.x + (ox * c - oy * s),\n y: node.pos.y + (ox * s + oy * c),\n z: node.pos.z + oz,\n };\n}\n\n/** Parameter + distance of `p` projected on segment a→b (3D). */\nfunction projectOnSegment(p: Point3D, a: Point3D, b: Point3D): { t: number; d: number; at: Point3D } {\n const dx = b.x - a.x, dy = b.y - a.y, dz = b.z - a.z;\n const len2 = dx * dx + dy * dy + dz * dz;\n if (len2 < 1e-12) return { t: 0, d: dist3d(p, a), at: a };\n const t = Math.max(0, Math.min(1, ((p.x - a.x) * dx + (p.y - a.y) * dy + (p.z - a.z) * dz) / len2));\n const at = { x: a.x + dx * t, y: a.y + dy * t, z: a.z + dz * t };\n return { t, d: dist3d(p, at), at };\n}\n\nconst round3 = (n: number) => Number(n.toFixed(4));\n\n/**\n * Connect MEP curves whose ends meet: an end on a connector port becomes\n * `host:port`, an end on an existing node references it, an end on another\n * curve's body splits that curve and adds a tee node, and ends that meet each\n * other get a new passive node. Lone ends stay open (reported afterwards).\n * Only same-table curves join (a duct never joins a pipe), and only when\n * their system types agree (or one is empty).\n */\nexport function resolveTopology(dir: string): void {\n buildRegistry(getSpecDir());\n const layout = discoverLayout(dir);\n const allDirs = [{ name: 'global', path: layout.globalDir }, ...layout.levelDirs];\n const dirPath = (name: string) => (name === 'global' ? layout.globalDir : join(dir, name));\n\n const files = new Map<string, TableFiles>(); // `${dir}/${table}`\n const openTable = (d: string, table: string): TableFiles => {\n const key = `${d}/${table}`;\n let f = files.get(key);\n if (f) return f;\n const p = dirPath(d);\n const csvPath = join(p, `${table}.csv`);\n const geomPath = join(p, `${GEOJSON_FILE_NAMES[table]}.geojson`);\n let csv: CsvData = existsSync(csvPath) ? readCsv(csvPath) : { headers: ['id', 'number', 'system_type'], rows: [] };\n let fc: BimDownFeatureCollection = { type: 'FeatureCollection', features: [] };\n if (existsSync(geomPath)) {\n try { fc = parseGeoJsonFile(geomPath); } catch { /* keep empty */ }\n }\n if (!csv.headers.includes('id')) csv = { ...csv, headers: ['id', ...csv.headers] };\n f = { csv, csvPath, fc, geomPath, dirty: false };\n files.set(key, f);\n return f;\n };\n\n // ─── Phase 1: load curves ─────────────────────────────────\n const curves: Curve[] = [];\n const usedIds = new Set<string>();\n for (const d of allDirs) {\n if (!existsSync(d.path)) continue;\n const present = listFiles(d.path);\n // New ids avoid every id and every host a from / to names (a ref to a node\n // on another level must not be captured by a new node here).\n for (const f of present) {\n if (!f.endsWith('.csv')) continue;\n for (const r of readCsv(join(d.path, f)).rows) {\n if (r.id) usedIds.add(r.id);\n for (const ref of [r.from, r.to]) { const h = (ref ?? '').split(':')[0]; if (h) usedIds.add(h); }\n }\n }\n for (const table of CURVE_TABLES) {\n if (!present.includes(`${table}.csv`) || !present.includes(`${GEOJSON_FILE_NAMES[table]}.geojson`)) continue;\n const tf = openTable(d.name, table);\n const geoById = new Map<string, BimDownFeature>();\n for (const feat of tf.fc.features) {\n const id = String(feat.properties?.id ?? '');\n if (id) geoById.set(id, feat);\n }\n for (const row of tf.csv.rows) {\n const feat = geoById.get(row.id);\n if (!feat || feat.geometry.type !== 'LineString') continue;\n const lg = extractLineGeometry(feat);\n curves.push({\n id: row.id, table, dir: d.name, row, feat,\n a: { x: lg.start_x, y: lg.start_y, z: lg.start_z ?? 0 },\n b: { x: lg.end_x, y: lg.end_y, z: lg.end_z ?? 0 },\n });\n }\n }\n }\n const totalCurves = curves.length;\n let alreadyResolved = 0;\n for (const c of curves) {\n if (c.row.from) alreadyResolved++;\n if (c.row.to) alreadyResolved++;\n }\n\n // ─── Phase 2: load nodes and connectors ───────────────────\n const nodes: NodeEntry[] = [];\n for (const d of allDirs) {\n if (!existsSync(d.path)) continue;\n const present = listFiles(d.path);\n for (const tableName of NODE_TABLES) {\n if (!present.includes(`${tableName}.csv`) || !present.includes(`${GEOJSON_FILE_NAMES[tableName]}.geojson`)) continue;\n const csv = readCsv(join(d.path, `${tableName}.csv`));\n let fc;\n try { fc = parseGeoJsonFile(join(d.path, `${GEOJSON_FILE_NAMES[tableName]}.geojson`)); }\n catch { continue; }\n const posById = new Map<string, { pos: Point3D; rotation: number }>();\n for (const f of fc.features) {\n if (f.geometry.type !== 'Point') continue;\n const id = String(f.properties?.id ?? '');\n if (!id) continue;\n const pg = extractPointGeometry(f);\n posById.set(id, { pos: { x: pg.x, y: pg.y, z: pg.z ?? 0 }, rotation: toFloat(f.properties?.rotation) });\n }\n for (const row of csv.rows) {\n const p = posById.get(row.id);\n if (!p) continue;\n nodes.push({ levelDir: d.name, tableName, id: row.id, pos: p.pos, rotation: p.rotation, system: row.system_type ?? '' });\n }\n }\n }\n // Ids are unique per level: a connector's host is in its own directory (or global/).\n const nodeByKey = new Map(nodes.map(n => [`${n.levelDir}/${n.id}`, n]));\n const connectors: ConnectorEntry[] = [];\n for (const d of allDirs) {\n if (!existsSync(d.path) || !listFiles(d.path).includes('connector.csv')) continue;\n for (const row of readCsv(join(d.path, 'connector.csv')).rows) {\n const host = nodeByKey.get(`${d.name}/${row.host_id ?? ''}`) ?? nodeByKey.get(`global/${row.host_id ?? ''}`);\n if (!host || !row.name) continue;\n connectors.push({\n hostId: row.host_id, name: row.name, systemType: row.system_type ?? '',\n domain: row.domain ?? '', worldPos: connectorWorldPos(host, row),\n });\n }\n }\n\n const nextId = (table: string): string => {\n const prefix = ID_PREFIXES[table];\n let n = 1;\n while (usedIds.has(`${prefix}-${n}`)) n++;\n const id = `${prefix}-${n}`;\n usedIds.add(id);\n return id;\n };\n\n const newNodes: { id: string; dir: string; pos: Point3D; system: string }[] = [];\n const addNode = (d: string, pos: Point3D, system: string): string => {\n const id = nextId('mep_node');\n newNodes.push({ id, dir: d, pos, system });\n nodes.push({ levelDir: d, tableName: 'mep_node', id, pos, rotation: 0, system });\n return id;\n };\n const setRef = (c: Curve, side: 'from' | 'to', ref: string) => {\n if (!openTable(c.dir, c.table).csv.headers.includes(side)) openTable(c.dir, c.table).csv.headers.push(side);\n c.row[side] = ref;\n openTable(c.dir, c.table).dirty = true;\n };\n\n // ─── Phase 3: each free end → port, node, or another curve's body ──\n let portMatches = 0, nodeMatches = 0, tees = 0;\n const stillFree: { c: Curve; side: 'from' | 'to' }[] = [];\n for (let ci = 0; ci < curves.length; ci++) {\n const c = curves[ci];\n for (const side of ['from', 'to'] as const) {\n if (c.row[side]) continue;\n const p = side === 'from' ? c.a : c.b;\n const sys = c.row.system_type ?? '';\n\n // a. Connector port (prefer the same system when several coincide).\n let best: ConnectorEntry | null = null;\n let bestD = Infinity;\n for (const cn of connectors) {\n const allowed = DOMAIN_TABLES[cn.domain];\n if (allowed && !allowed.includes(c.table)) continue;\n const d = dist3d(p, cn.worldPos);\n if (d > TOLERANCE) continue;\n const better = d < bestD - 1e-9 || (sys && cn.systemType === sys && best?.systemType !== sys);\n if (!best || better) { best = cn; bestD = d; }\n }\n if (best) { setRef(c, side, `${best.hostId}:${best.name}`); portMatches++; continue; }\n\n // b. Existing node at the end.\n const node = nodes.find(n => near(p, n.pos) && (n.tableName !== 'mep_node' || systemsCompatible(n.system, sys)));\n if (node) { setRef(c, side, node.id); nodeMatches++; continue; }\n\n // c. End on another curve's body (same table and system): split it, add a tee.\n let hit: { other: Curve; at: Point3D } | null = null;\n for (const other of curves) {\n if (other === c || other.table !== c.table || other.feat.properties?.arc) continue;\n if (!systemsCompatible(other.row.system_type ?? '', sys)) continue;\n const pr = projectOnSegment(p, other.a, other.b);\n if (pr.d > TOLERANCE) continue;\n if (dist3d(pr.at, other.a) <= TOLERANCE || dist3d(pr.at, other.b) <= TOLERANCE) continue;\n hit = { other, at: pr.at };\n break;\n }\n if (hit) {\n const { other, at } = hit;\n const nodeId = addNode(other.dir, at, other.row.system_type || sys);\n const tf = openTable(other.dir, other.table);\n const newId = nextId(other.table);\n const newRow: Record<string, string> = { ...other.row, id: newId, from: nodeId, to: other.row.to ?? '' };\n for (const h of ['from', 'to']) if (!tf.csv.headers.includes(h)) tf.csv.headers.push(h);\n tf.csv.rows.push(newRow);\n other.row.to = nodeId;\n const coords = (other.feat.geometry as { coordinates: number[][] }).coordinates;\n const end = coords[coords.length - 1];\n const mid = [round3(at.x), round3(at.y), round3(at.z)];\n (other.feat.geometry as { coordinates: number[][] }).coordinates = [coords[0], mid];\n const newFeat: BimDownFeature = {\n type: 'Feature',\n properties: { ...other.feat.properties, id: newId },\n geometry: { type: 'LineString', coordinates: [mid, end] },\n } as BimDownFeature;\n tf.fc.features.push(newFeat);\n tf.dirty = true;\n curves.push({ id: newId, table: other.table, dir: other.dir, row: newRow, feat: newFeat, a: { ...at }, b: { ...other.b } });\n other.b = { ...at };\n setRef(c, side, nodeId);\n tees++;\n continue;\n }\n stillFree.push({ c, side });\n }\n }\n\n // ─── Phase 4: ends that meet each other → one passive node ──\n interface Junction { point: Point3D; ends: { c: Curve; side: 'from' | 'to' }[] }\n const junctions: Junction[] = [];\n for (const ep of stillFree) {\n if (ep.c.row[ep.side]) continue;\n const p = ep.side === 'from' ? ep.c.a : ep.c.b;\n const sys = ep.c.row.system_type ?? '';\n const j = junctions.find(j => near(p, j.point) && j.ends[0].c.table === ep.c.table\n && systemsCompatible(j.ends[0].c.row.system_type ?? '', sys));\n if (j) j.ends.push(ep);\n else junctions.push({ point: p, ends: [ep] });\n }\n let created = tees;\n for (const j of junctions) {\n if (j.ends.length < 2) continue; // a lone end stays open — the check reports it\n const sys = j.ends.map(e => e.c.row.system_type).find(Boolean) ?? '';\n const nodeId = addNode(j.ends[0].c.dir, j.point, sys);\n for (const e of j.ends) setRef(e.c, e.side, nodeId);\n created++;\n }\n\n // ─── Phase 5: write new mep_node rows + split curves ──────\n for (const n of newNodes) {\n const d = dirPath(n.dir);\n if (!existsSync(d)) mkdirSync(d, { recursive: true });\n const tf = openTable(n.dir, 'mep_node');\n for (const h of ['id', 'number', 'system_type']) if (!tf.csv.headers.includes(h)) tf.csv.headers.push(h);\n tf.csv.rows.push({ id: n.id, number: '', system_type: n.system });\n tf.fc.features.push({\n type: 'Feature',\n properties: { id: n.id },\n geometry: { type: 'Point', coordinates: [round3(n.pos.x), round3(n.pos.y), round3(n.pos.z)] },\n } as BimDownFeature);\n tf.dirty = true;\n }\n let written = 0;\n for (const tf of files.values()) {\n if (!tf.dirty) continue;\n writeCsv(tf.csvPath, tf.csv);\n writeFileSync(tf.geomPath, stringifyFeatureCollection(tf.fc), 'utf-8');\n written++;\n }\n\n console.log(`Scanned ${totalCurves} MEP curves (${totalCurves * 2} endpoints)`);\n console.log(` Already connected: ${alreadyResolved}`);\n console.log(` Connected to ports: ${portMatches}, to existing nodes: ${nodeMatches}`);\n console.log(` Tees from ends on a curve body: ${tees} (curves split)`);\n console.log(` New mep_nodes created: ${created}`);\n if (written > 0) console.log(`Updated ${written} file(s)`);\n\n const problems = mepReport(dir).problems.filter(p => p.severity === 'warning');\n if (problems.length === 0) {\n console.log('MEP connectivity: no problems.');\n } else {\n console.log(`\\n${problems.length} connectivity problem(s):`);\n for (const p of problems.slice(0, 30)) console.log(` ${formatProblem(p)}`);\n if (problems.length > 30) console.log(` ... ${problems.length - 30} more (bimdown mep-check <dir>)`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,WAAW,qBAAqB;AACrD,SAAS,YAAY;AAcrB,IAAM,YAAY;AAElB,IAAM,eAAe,CAAC,QAAQ,QAAQ,cAAc,SAAS;AAC7D,IAAM,cAAc,CAAC,aAAa,YAAY,UAAU;AAGxD,IAAM,gBAA0C;AAAA,EAC9C,MAAM,CAAC,MAAM;AAAA,EACb,QAAQ,CAAC,MAAM;AAAA,EACf,YAAY,CAAC,WAAW,YAAY;AAAA,EACpC,oBAAoB,CAAC,WAAW,YAAY;AAC9C;AAuCA,SAAS,OA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/B,QAAI,CAAC,GAAG,MAAO;AACf,aAAS,GAAG,SAAS,GAAG,GAAG;AAC3B,kBAAc,GAAG,UAAU,2BAA2B,GAAG,EAAE,GAAG,OAAO;AACrE;AAAA,EACF;AAEA,UAAQ,IAAI,WAAW,WAAW,gBAAgB,cAAc,CAAC,aAAa;AAC9E,UAAQ,IAAI,wBAAwB,eAAe,EAAE;AACrD,UAAQ,IAAI,yBAAyB,WAAW,wBAAwB,WAAW,EAAE;AACrF,UAAQ,IAAI,qCAAqC,IAAI,iBAAiB;AACtE,UAAQ,IAAI,4BAA4B,OAAO,EAAE;AACjD,MAAI,UAAU,EAAG,SAAQ,IAAI,WAAW,OAAO,UAAU;AAEzD,QAAM,WAAW,UAAU,GAAG,EAAE,SAAS,OAAO,OAAK,EAAE,aAAa,SAAS;AAC7E,MAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,IAAI,gCAAgC;AAAA,EAC9C,OAAO;AACL,YAAQ,IAAI;AAAA,EAAK,SAAS,MAAM,2BAA2B;AAC3D,eAAW,KAAK,SAAS,MAAM,GAAG,EAAE,EAAG,SAAQ,IAAI,KAAK,cAAc,CAAC,CAAC,EAAE;AAC1E,QAAI,SAAS,SAAS,GAAI,SAAQ,IAAI,SAAS,SAAS,SAAS,EAAE,iCAAiC;AAAA,EACtG;AACF;","names":["j"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: dimension
|
|
2
|
+
description: >
|
|
3
|
+
Linear dimension on a level plan (level directories) or on a section /
|
|
4
|
+
elevation view (global/, with view_id). CSV only. Measures
|
|
5
|
+
the distance between two points along a direction and draws the dimension
|
|
6
|
+
line `offset` away from them. Each end may reference an element
|
|
7
|
+
(`start_ref` / `end_ref`) so the dimension follows it when it moves; the
|
|
8
|
+
stored coordinates are then the last resolved points (and the fallback when
|
|
9
|
+
the reference is empty). Chain dimensions are several rows sharing one
|
|
10
|
+
direction and offset. Text, ticks and gaps are paper sizes (2.2 mm text),
|
|
11
|
+
drawn at the scale of the view or sheet viewport. View dimensions (view_id)
|
|
12
|
+
use fixed points only (no references).
|
|
13
|
+
|
|
14
|
+
fields:
|
|
15
|
+
- name: id
|
|
16
|
+
type: string
|
|
17
|
+
required: true
|
|
18
|
+
|
|
19
|
+
- name: start_x
|
|
20
|
+
type: float
|
|
21
|
+
required: true
|
|
22
|
+
description: Measured start point X.
|
|
23
|
+
|
|
24
|
+
- name: start_y
|
|
25
|
+
type: float
|
|
26
|
+
required: true
|
|
27
|
+
description: Measured start point Y.
|
|
28
|
+
|
|
29
|
+
- name: end_x
|
|
30
|
+
type: float
|
|
31
|
+
required: true
|
|
32
|
+
description: Measured end point X.
|
|
33
|
+
|
|
34
|
+
- name: end_y
|
|
35
|
+
type: float
|
|
36
|
+
required: true
|
|
37
|
+
description: Measured end point Y.
|
|
38
|
+
|
|
39
|
+
- name: start_ref
|
|
40
|
+
type: string
|
|
41
|
+
description: >
|
|
42
|
+
Element the start point sticks to. "<id>" = the element's location line
|
|
43
|
+
(wall/grid/beam centre line: the stored point projected onto it) or its
|
|
44
|
+
centre (columns, equipment, rooms, doors); "<id>:start" / "<id>:end" =
|
|
45
|
+
line end points (door/window: the opening edges); "<id>:left" /
|
|
46
|
+
"<id>:right" = wall face left/right of its start→end direction;
|
|
47
|
+
"<id>:center" = centre. Empty = fixed point.
|
|
48
|
+
|
|
49
|
+
- name: end_ref
|
|
50
|
+
type: string
|
|
51
|
+
description: Element the end point sticks to (same syntax as start_ref).
|
|
52
|
+
|
|
53
|
+
- name: direction
|
|
54
|
+
type: float
|
|
55
|
+
description: >
|
|
56
|
+
Measurement direction in degrees CCW from +X (0 = horizontal, 90 =
|
|
57
|
+
vertical). Empty = aligned with start→end.
|
|
58
|
+
|
|
59
|
+
- name: offset
|
|
60
|
+
type: float
|
|
61
|
+
default: 0
|
|
62
|
+
description: >
|
|
63
|
+
Distance from the start point to the dimension line along the left
|
|
64
|
+
normal of the measurement direction (negative = right side).
|
|
65
|
+
|
|
66
|
+
- name: text
|
|
67
|
+
type: string
|
|
68
|
+
description: Text shown instead of the measured value (e.g. "EQ"). Empty = the value.
|
|
69
|
+
|
|
70
|
+
- name: view_id
|
|
71
|
+
type: string
|
|
72
|
+
description: >
|
|
73
|
+
View the annotation is drawn in instead of a level plan: a section id of
|
|
74
|
+
global/view.csv, or north / south / east / west for the derived
|
|
75
|
+
elevations. Rows with a view_id live in global/{table}.csv and their
|
|
76
|
+
coordinates are view coordinates: x along the view (left to right as
|
|
77
|
+
seen), y = absolute elevation. Empty = a plan annotation (level directory).
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: tag
|
|
2
|
+
description: >
|
|
3
|
+
Label of one element on a level plan (CSV only, level directories only):
|
|
4
|
+
door/window marks, room name + number + area, element number/type/name.
|
|
5
|
+
The text is read from the host element, so it never goes stale. A room
|
|
6
|
+
with a tag shows the tag instead of its plain label.
|
|
7
|
+
|
|
8
|
+
fields:
|
|
9
|
+
- name: id
|
|
10
|
+
type: string
|
|
11
|
+
required: true
|
|
12
|
+
|
|
13
|
+
- name: host_id
|
|
14
|
+
type: reference
|
|
15
|
+
reference: element
|
|
16
|
+
required: true
|
|
17
|
+
description: Tagged element (on the same level or in global/).
|
|
18
|
+
|
|
19
|
+
- name: x
|
|
20
|
+
type: float
|
|
21
|
+
description: >
|
|
22
|
+
Tag centre X. Empty x and y = default spot at the host (room seed, beside
|
|
23
|
+
a door/window, element centre) that follows it. Set = pinned; a leader
|
|
24
|
+
line is drawn when the tag is away from the host.
|
|
25
|
+
|
|
26
|
+
- name: y
|
|
27
|
+
type: float
|
|
28
|
+
description: Tag centre Y (see x).
|
|
29
|
+
|
|
30
|
+
- name: content
|
|
31
|
+
type: enum
|
|
32
|
+
default: auto
|
|
33
|
+
description: >
|
|
34
|
+
What the tag shows. auto = rooms: name, number and area; others: number
|
|
35
|
+
(doors/windows fall back to size, others to name). type = the host's type
|
|
36
|
+
name (else size); size = width×height (doors/windows), thickness (walls)
|
|
37
|
+
or section size; area = room area.
|
|
38
|
+
values:
|
|
39
|
+
- auto
|
|
40
|
+
- number
|
|
41
|
+
- name
|
|
42
|
+
- type
|
|
43
|
+
- size
|
|
44
|
+
- area
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: text_note
|
|
2
|
+
description: >
|
|
3
|
+
Free text on a level plan (level directories) or on a section / elevation
|
|
4
|
+
view (global/, with view_id). CSV only.
|
|
5
|
+
|
|
6
|
+
fields:
|
|
7
|
+
- name: id
|
|
8
|
+
type: string
|
|
9
|
+
required: true
|
|
10
|
+
|
|
11
|
+
- name: x
|
|
12
|
+
type: float
|
|
13
|
+
required: true
|
|
14
|
+
description: Insertion point X (centre of the text).
|
|
15
|
+
|
|
16
|
+
- name: y
|
|
17
|
+
type: float
|
|
18
|
+
required: true
|
|
19
|
+
description: Insertion point Y (centre of the text).
|
|
20
|
+
|
|
21
|
+
- name: text
|
|
22
|
+
type: string
|
|
23
|
+
required: true
|
|
24
|
+
description: Text content. A literal "\n" starts a new line.
|
|
25
|
+
|
|
26
|
+
- name: size
|
|
27
|
+
type: float
|
|
28
|
+
description: >
|
|
29
|
+
Legacy fixed text height in project units (same model size at every
|
|
30
|
+
scale). Used only when paper_size is empty.
|
|
31
|
+
|
|
32
|
+
- name: paper_size
|
|
33
|
+
type: float
|
|
34
|
+
description: >
|
|
35
|
+
Text height on paper in mm. The model height is paper_size × scale / 1000
|
|
36
|
+
metres at the scale of the view or sheet viewport (2.5 mm = 0.25 m at
|
|
37
|
+
1:100, 0.5 m at 1:200), so the note reads the same on every sheet. Wins
|
|
38
|
+
over size; both empty = 2.5 mm.
|
|
39
|
+
|
|
40
|
+
- name: rotation
|
|
41
|
+
type: float
|
|
42
|
+
default: 0
|
|
43
|
+
description: Rotation in degrees CCW.
|
|
44
|
+
|
|
45
|
+
- name: view_id
|
|
46
|
+
type: string
|
|
47
|
+
description: >
|
|
48
|
+
View the annotation is drawn in instead of a level plan: a section id of
|
|
49
|
+
global/view.csv, or north / south / east / west for the derived
|
|
50
|
+
elevations. Rows with a view_id live in global/{table}.csv and their
|
|
51
|
+
coordinates are view coordinates: x along the view (left to right as
|
|
52
|
+
seen), y = absolute elevation. Empty = a plan annotation (level directory).
|
|
@@ -2,8 +2,15 @@ name: ceiling
|
|
|
2
2
|
bases:
|
|
3
3
|
- polygon_element
|
|
4
4
|
- materialized
|
|
5
|
+
- wall_bounded
|
|
5
6
|
|
|
6
7
|
fields:
|
|
7
8
|
- name: height_offset
|
|
8
9
|
type: float
|
|
9
|
-
|
|
10
|
+
storage: geojson_property
|
|
11
|
+
description: Offset below level elevation (e.g. -0.3 for 30cm dropped ceiling). Stored in GeoJSON Feature properties.
|
|
12
|
+
|
|
13
|
+
- name: type_id
|
|
14
|
+
type: reference
|
|
15
|
+
reference: ceiling_type
|
|
16
|
+
description: Optional ceiling_type id. Empty type parameters (material) inherit the type's value; a set value overrides it for this element.
|
|
@@ -5,4 +5,8 @@ bases:
|
|
|
5
5
|
- materialized
|
|
6
6
|
- section_profile
|
|
7
7
|
|
|
8
|
-
fields:
|
|
8
|
+
fields:
|
|
9
|
+
- name: type_id
|
|
10
|
+
type: reference
|
|
11
|
+
reference: column_type
|
|
12
|
+
description: Optional column_type id. Empty type parameters (shape, size_x, size_y, material) inherit the type's value; a set value overrides it for this element.
|
|
@@ -7,19 +7,50 @@ bases:
|
|
|
7
7
|
fields:
|
|
8
8
|
- name: u_grid_count
|
|
9
9
|
type: integer
|
|
10
|
-
description:
|
|
10
|
+
description: Uniform grid, number of panel rows (cells stacked between horizontal U grid lines). Ignored when u_grids is set; empty → derived from u_spacing, else 3.
|
|
11
11
|
|
|
12
12
|
- name: v_grid_count
|
|
13
13
|
type: integer
|
|
14
|
-
description:
|
|
14
|
+
description: Uniform grid, number of panel columns along the wall (cells between vertical V grid lines). Ignored when v_grids is set; empty → derived from v_spacing, else 3.
|
|
15
15
|
|
|
16
16
|
- name: u_spacing
|
|
17
17
|
type: float
|
|
18
|
-
description: Uniform U grid spacing in meters (
|
|
18
|
+
description: Uniform U grid spacing in meters, used when u_grid_count is empty (a line every u_spacing up from the base).
|
|
19
19
|
|
|
20
20
|
- name: v_spacing
|
|
21
21
|
type: float
|
|
22
|
-
description: Uniform V grid spacing in meters (
|
|
22
|
+
description: Uniform V grid spacing in meters, used when v_grid_count is empty (a line every v_spacing from the start).
|
|
23
|
+
|
|
24
|
+
- name: u_grids
|
|
25
|
+
type: string
|
|
26
|
+
description: "Explicit horizontal grid lines: heights above the wall base, semicolon-separated (e.g. `0.9;2.4`). Overrides u_grid_count / u_spacing."
|
|
27
|
+
|
|
28
|
+
- name: v_grids
|
|
29
|
+
type: string
|
|
30
|
+
description: "Explicit vertical grid lines: distances from the wall start, semicolon-separated (e.g. `1.2;2.4;3.9`). Overrides v_grid_count / v_spacing."
|
|
31
|
+
|
|
32
|
+
- name: panels
|
|
33
|
+
type: string
|
|
34
|
+
description: "Panel overrides, semicolon-separated `col:row=kind` (0-based; col counted from the wall start, row from the bottom; `*` = every col or row; later entries win). Kinds: glass, solid, door, double_door, empty. Unlisted cells are glass."
|
|
35
|
+
|
|
36
|
+
- name: door_numbers
|
|
37
|
+
type: string
|
|
38
|
+
description: "Marks of the door / double_door panels, semicolon-separated, in cell order (column from the wall start, then row from the bottom), e.g. `D105;D106`. Numbered with the doors (unique project-wide); listed in door schedules and as the IfcDoor name."
|
|
39
|
+
|
|
40
|
+
- name: mullion_width
|
|
41
|
+
type: float
|
|
42
|
+
description: Mullion face width along the wall in meters (round profile → diameter). Default 0.05.
|
|
43
|
+
|
|
44
|
+
- name: mullion_depth
|
|
45
|
+
type: float
|
|
46
|
+
description: Mullion depth across the wall in meters. Default 0.05.
|
|
47
|
+
|
|
48
|
+
- name: mullion_profile
|
|
49
|
+
type: enum
|
|
50
|
+
values:
|
|
51
|
+
- rect
|
|
52
|
+
- round
|
|
53
|
+
description: Interior mullion / transom section (default rect). Border mullions are always rect.
|
|
23
54
|
|
|
24
55
|
- name: panel_count
|
|
25
56
|
type: integer
|
|
@@ -28,4 +59,13 @@ fields:
|
|
|
28
59
|
|
|
29
60
|
- name: panel_material
|
|
30
61
|
type: string
|
|
31
|
-
description:
|
|
62
|
+
description: Glass panel material name
|
|
63
|
+
|
|
64
|
+
- name: solid_material
|
|
65
|
+
type: string
|
|
66
|
+
description: Material of `solid` (opaque spandrel) panels. Default aluminum.
|
|
67
|
+
|
|
68
|
+
- name: type_id
|
|
69
|
+
type: reference
|
|
70
|
+
reference: curtain_wall_type
|
|
71
|
+
description: Optional curtain_wall_type id. Empty type parameters (u_spacing, v_spacing, panel_material, solid_material, mullion_width, mullion_depth, mullion_profile, material) inherit the type's value; a set value overrides it for this element.
|