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,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/utils/fs.ts
|
|
4
|
+
import { readdirSync, statSync, existsSync, readFileSync, writeFileSync } from "fs";
|
|
5
|
+
import { join } from "path";
|
|
6
|
+
var ASSET_DIRS = /* @__PURE__ */ new Set(["mesh", "underlays"]);
|
|
7
|
+
function discoverLayout(dir) {
|
|
8
|
+
const globalDir = join(dir, "global");
|
|
9
|
+
const levelDirs = [];
|
|
10
|
+
if (existsSync(dir) && statSync(dir).isDirectory()) {
|
|
11
|
+
for (const entry of readdirSync(dir)) {
|
|
12
|
+
if (entry === "global" || ASSET_DIRS.has(entry) || entry.startsWith(".")) continue;
|
|
13
|
+
const full = join(dir, entry);
|
|
14
|
+
if (statSync(full).isDirectory()) {
|
|
15
|
+
levelDirs.push({ name: entry, path: full });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return { root: dir, globalDir, levelDirs };
|
|
20
|
+
}
|
|
21
|
+
function listFiles(dir) {
|
|
22
|
+
if (!existsSync(dir)) return [];
|
|
23
|
+
return readdirSync(dir).filter((f) => {
|
|
24
|
+
const full = join(dir, f);
|
|
25
|
+
return statSync(full).isFile();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function dirFiles(root) {
|
|
29
|
+
return {
|
|
30
|
+
read: (p) => {
|
|
31
|
+
const full = join(root, p);
|
|
32
|
+
return existsSync(full) ? readFileSync(full, "utf-8") : void 0;
|
|
33
|
+
},
|
|
34
|
+
write: (p, t) => writeFileSync(join(root, p), t, "utf-8")
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
ASSET_DIRS,
|
|
40
|
+
discoverLayout,
|
|
41
|
+
listFiles,
|
|
42
|
+
dirFiles
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=chunk-OBY3UYCO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/fs.ts"],"sourcesContent":["import { readdirSync, statSync, existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/** Top-level asset directories: mesh/ (GLB, mesh.mesh_file) and underlays/ (underlay.file). */\nexport const ASSET_DIRS = new Set(['mesh', 'underlays']);\n\nexport interface ProjectLayout {\n root: string;\n globalDir: string;\n levelDirs: { name: string; path: string }[];\n}\n\nexport function discoverLayout(dir: string): ProjectLayout {\n const globalDir = join(dir, 'global');\n const levelDirs: { name: string; path: string }[] = [];\n\n if (existsSync(dir) && statSync(dir).isDirectory()) {\n for (const entry of readdirSync(dir)) {\n // 'mesh' (GLB assets) and 'underlays' (tracing references) are asset\n // directories, not levels.\n if (entry === 'global' || ASSET_DIRS.has(entry) || entry.startsWith('.')) continue;\n const full = join(dir, entry);\n if (statSync(full).isDirectory()) {\n levelDirs.push({ name: entry, path: full });\n }\n }\n }\n\n return { root: dir, globalDir, levelDirs };\n}\n\nexport function listFiles(dir: string): string[] {\n if (!existsSync(dir)) return [];\n return readdirSync(dir).filter((f) => {\n const full = join(dir, f);\n return statSync(full).isFile();\n });\n}\n\n/** A project folder as project-relative text files (build/project-rooms.ts). */\nexport function dirFiles(root: string): { read(path: string): string | undefined; write(path: string, text: string): void } {\n return {\n read: (p) => {\n const full = join(root, p);\n return existsSync(full) ? readFileSync(full, 'utf-8') : undefined;\n },\n write: (p, t) => writeFileSync(join(root, p), t, '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ckDBInstance } from "@duckdb/node-api";
|
|
5
|
+
var instance = null;
|
|
6
|
+
var connection = null;
|
|
7
|
+
async function getConnection() {
|
|
8
|
+
if (connection) return connection;
|
|
9
|
+
instance = await DuckDBInstance.create(":memory:");
|
|
10
|
+
connection = await instance.connect();
|
|
11
|
+
return connection;
|
|
12
|
+
}
|
|
13
|
+
async function closeConnection() {
|
|
14
|
+
connection = null;
|
|
15
|
+
instance = null;
|
|
16
|
+
}
|
|
17
|
+
async function runQuery(conn, sql) {
|
|
18
|
+
const reader = await conn.runAndReadAll(sql);
|
|
19
|
+
const columns = reader.columnNames();
|
|
20
|
+
const rows = reader.getRowObjects();
|
|
21
|
+
return { columns, rows };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
getConnection,
|
|
26
|
+
closeConnection,
|
|
27
|
+
runQuery
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-XC6WHJRL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/duckdb/engine.ts"],"sourcesContent":["import { DuckDBInstance, DuckDBConnection } from '@duckdb/node-api';\n\nlet instance: DuckDBInstance | null = null;\nlet connection: DuckDBConnection | null = null;\n\nexport async function getConnection(): Promise<DuckDBConnection> {\n if (connection) return connection;\n instance = await DuckDBInstance.create(':memory:');\n connection = await instance.connect();\n return connection;\n}\n\nexport async function closeConnection(): Promise<void> {\n connection = null;\n instance = null;\n}\n\nexport interface QueryResult {\n columns: string[];\n rows: Record<string, unknown>[];\n}\n\nexport async function runQuery(conn: DuckDBConnection, sql: string): Promise<QueryResult> {\n const reader = await conn.runAndReadAll(sql);\n const columns = reader.columnNames();\n const rows = reader.getRowObjects();\n return { columns, rows };\n}\n"],"mappings":";;;AAAA,SAAS,sBAAwC;AAEjD,IAAI,WAAkC;AACtC,IAAI,aAAsC;AAE1C,eAAsB,gBAA2C;AAC/D,MAAI,WAAY,QAAO;AACvB,aAAW,MAAM,eAAe,OAAO,UAAU;AACjD,eAAa,MAAM,SAAS,QAAQ;AACpC,SAAO;AACT;AAEA,eAAsB,kBAAiC;AACrD,eAAa;AACb,aAAW;AACb;AAOA,eAAsB,SAAS,MAAwB,KAAmC;AACxF,QAAM,SAAS,MAAM,KAAK,cAAc,GAAG;AAC3C,QAAM,UAAU,OAAO,YAAY;AACnC,QAAM,OAAO,OAAO,cAAc;AAClC,SAAO,EAAE,SAAS,KAAK;AACzB;","names":[]}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
LAYERED_TYPE_TABLES,
|
|
4
|
+
TYPE_TABLES,
|
|
5
|
+
buildRegistry,
|
|
6
|
+
getSpecDir
|
|
7
|
+
} from "./chunk-4YHVOWS4.js";
|
|
8
|
+
import {
|
|
9
|
+
readCsv
|
|
10
|
+
} from "./chunk-JY6KWRDB.js";
|
|
11
|
+
import {
|
|
12
|
+
discoverLayout
|
|
13
|
+
} from "./chunk-OBY3UYCO.js";
|
|
14
|
+
|
|
15
|
+
// src/catalog/index.ts
|
|
16
|
+
import { existsSync, statSync } from "fs";
|
|
17
|
+
import { join } from "path";
|
|
18
|
+
var TYPE_META_FIELDS = /* @__PURE__ */ new Set(["id", "name", "description"]);
|
|
19
|
+
var EPS = 1e-6;
|
|
20
|
+
function round6(n) {
|
|
21
|
+
return Math.round(n * 1e6) / 1e6;
|
|
22
|
+
}
|
|
23
|
+
function sameValue(a, b) {
|
|
24
|
+
const sa = (a ?? "").trim();
|
|
25
|
+
const sb = (b ?? "").trim();
|
|
26
|
+
if (sa === sb) return true;
|
|
27
|
+
if (sa === "" || sb === "") return false;
|
|
28
|
+
const na = Number(sa);
|
|
29
|
+
const nb = Number(sb);
|
|
30
|
+
return Number.isFinite(na) && Number.isFinite(nb) && Math.abs(na - nb) < EPS;
|
|
31
|
+
}
|
|
32
|
+
function catalogFromRows(typeRows, layerRows) {
|
|
33
|
+
const types = /* @__PURE__ */ new Map();
|
|
34
|
+
for (const { table, rows } of typeRows) {
|
|
35
|
+
for (const row of rows) {
|
|
36
|
+
if (!row.id) continue;
|
|
37
|
+
types.set(row.id, { id: row.id, table, row, layers: [] });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
for (const row of layerRows) {
|
|
41
|
+
const t = types.get(row.type_id ?? "");
|
|
42
|
+
if (!t || !LAYERED_TYPE_TABLES.has(t.table)) continue;
|
|
43
|
+
const thickness = Number(row.thickness);
|
|
44
|
+
const conductivity = Number(row.conductivity);
|
|
45
|
+
t.layers.push({
|
|
46
|
+
id: row.id ?? "",
|
|
47
|
+
seq: Number(row.seq) || 0,
|
|
48
|
+
function: row.function ?? "",
|
|
49
|
+
material: row.material ?? "",
|
|
50
|
+
thickness: Number.isFinite(thickness) ? thickness : 0,
|
|
51
|
+
conductivity: row.conductivity && Number.isFinite(conductivity) ? conductivity : void 0,
|
|
52
|
+
name: row.name ?? ""
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
for (const t of types.values()) t.layers.sort((a, b) => a.seq - b.seq);
|
|
56
|
+
return { types };
|
|
57
|
+
}
|
|
58
|
+
var cache = /* @__PURE__ */ new Map();
|
|
59
|
+
function typeFilePaths(globalDir) {
|
|
60
|
+
return [...TYPE_TABLES, "type_layer"].map((table) => ({ table, path: join(globalDir, `${table}.csv`) }));
|
|
61
|
+
}
|
|
62
|
+
function loadCatalog(projectDir) {
|
|
63
|
+
const globalDir = join(projectDir, "global");
|
|
64
|
+
const files = typeFilePaths(globalDir).filter((f) => existsSync(f.path));
|
|
65
|
+
const sig = files.map((f) => {
|
|
66
|
+
const st = statSync(f.path);
|
|
67
|
+
return `${f.table}:${st.mtimeMs}:${st.size}`;
|
|
68
|
+
}).join("|");
|
|
69
|
+
const hit = cache.get(projectDir);
|
|
70
|
+
if (hit && hit.sig === sig) return hit.catalog;
|
|
71
|
+
const typeRows = [];
|
|
72
|
+
let layerRows = [];
|
|
73
|
+
for (const f of files) {
|
|
74
|
+
let rows;
|
|
75
|
+
try {
|
|
76
|
+
rows = readCsv(f.path).rows;
|
|
77
|
+
} catch {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (f.table === "type_layer") layerRows = rows;
|
|
81
|
+
else typeRows.push({ table: f.table, rows });
|
|
82
|
+
}
|
|
83
|
+
const catalog = catalogFromRows(typeRows, layerRows);
|
|
84
|
+
cache.set(projectDir, { sig, catalog });
|
|
85
|
+
return catalog;
|
|
86
|
+
}
|
|
87
|
+
function layerTotal(t) {
|
|
88
|
+
if (t.layers.length === 0) return void 0;
|
|
89
|
+
return round6(t.layers.reduce((s, l) => s + l.thickness, 0));
|
|
90
|
+
}
|
|
91
|
+
function typeValues(t) {
|
|
92
|
+
const out = {};
|
|
93
|
+
for (const [k, v] of Object.entries(t.row)) {
|
|
94
|
+
if (TYPE_META_FIELDS.has(k) || v === void 0 || v === "") continue;
|
|
95
|
+
out[k] = v;
|
|
96
|
+
}
|
|
97
|
+
if (!out.thickness) {
|
|
98
|
+
const total = layerTotal(t);
|
|
99
|
+
if (total !== void 0) out.thickness = String(total);
|
|
100
|
+
}
|
|
101
|
+
return out;
|
|
102
|
+
}
|
|
103
|
+
var paramFieldCache = /* @__PURE__ */ new Map();
|
|
104
|
+
function typeParamFields(instanceTable) {
|
|
105
|
+
const cached = paramFieldCache.get(instanceTable);
|
|
106
|
+
if (cached) return cached;
|
|
107
|
+
const registry = buildRegistry(getSpecDir());
|
|
108
|
+
const inst = registry.get(instanceTable);
|
|
109
|
+
const typeTable = inst?.typeTable ? registry.get(inst.typeTable) : void 0;
|
|
110
|
+
let fields = [];
|
|
111
|
+
if (inst && typeTable) {
|
|
112
|
+
const typeCols = new Set(typeTable.csvFields.map((f) => f.name));
|
|
113
|
+
fields = inst.csvFields.map((f) => f.name).filter((n) => typeCols.has(n) && !TYPE_META_FIELDS.has(n) && n !== "type_id");
|
|
114
|
+
}
|
|
115
|
+
paramFieldCache.set(instanceTable, fields);
|
|
116
|
+
return fields;
|
|
117
|
+
}
|
|
118
|
+
function typeOfRow(instanceTable, row, catalog) {
|
|
119
|
+
const id = row.type_id;
|
|
120
|
+
if (!id) return void 0;
|
|
121
|
+
const t = catalog.types.get(id);
|
|
122
|
+
if (!t) return void 0;
|
|
123
|
+
const registry = buildRegistry(getSpecDir());
|
|
124
|
+
return registry.get(instanceTable)?.typeTable === t.table ? t : void 0;
|
|
125
|
+
}
|
|
126
|
+
function effectiveRow(instanceTable, row, catalog) {
|
|
127
|
+
const t = typeOfRow(instanceTable, row, catalog);
|
|
128
|
+
if (!t) return row;
|
|
129
|
+
const values = typeValues(t);
|
|
130
|
+
const out = { ...row };
|
|
131
|
+
for (const f of typeParamFields(instanceTable)) {
|
|
132
|
+
if ((out[f] ?? "") === "" && values[f] !== void 0) out[f] = values[f];
|
|
133
|
+
}
|
|
134
|
+
return out;
|
|
135
|
+
}
|
|
136
|
+
function effectiveRows(projectDir, instanceTable, rows) {
|
|
137
|
+
if (!buildRegistry(getSpecDir()).get(instanceTable)?.typeTable) return rows;
|
|
138
|
+
const catalog = loadCatalog(projectDir);
|
|
139
|
+
if (catalog.types.size === 0) return rows;
|
|
140
|
+
return rows.map((r) => effectiveRow(instanceTable, r, catalog));
|
|
141
|
+
}
|
|
142
|
+
function forEachLayeredInstanceRow(projectDir, visit) {
|
|
143
|
+
const registry = buildRegistry(getSpecDir());
|
|
144
|
+
const layout = discoverLayout(projectDir);
|
|
145
|
+
for (const d of [{ name: "global", path: layout.globalDir }, ...layout.levelDirs]) {
|
|
146
|
+
for (const [table, def] of registry) {
|
|
147
|
+
if (!def.typeTable || !LAYERED_TYPE_TABLES.has(def.typeTable)) continue;
|
|
148
|
+
const p = join(d.path, `${table}.csv`);
|
|
149
|
+
if (!existsSync(p)) continue;
|
|
150
|
+
let rows;
|
|
151
|
+
try {
|
|
152
|
+
rows = readCsv(p).rows;
|
|
153
|
+
} catch {
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
rows.forEach((row, i) => visit(table, d.name, row, i));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function typeWarnings(projectDir) {
|
|
161
|
+
const catalog = loadCatalog(projectDir);
|
|
162
|
+
if (catalog.types.size === 0) return [];
|
|
163
|
+
const warnings = [];
|
|
164
|
+
forEachLayeredInstanceRow(projectDir, (table, dirName, row, i) => {
|
|
165
|
+
const t = typeOfRow(table, row, catalog);
|
|
166
|
+
if (!t || !row.thickness) return;
|
|
167
|
+
const total = layerTotal(t);
|
|
168
|
+
if (total === void 0 || sameValue(row.thickness, String(total))) return;
|
|
169
|
+
warnings.push(
|
|
170
|
+
`[warn] ${dirName}/${table}.csv:${i + 2} ${row.id} thickness=${row.thickness} overrides ${t.id} (layers total ${total}); its core layer absorbs the difference \u2014 clear thickness to follow the type`
|
|
171
|
+
);
|
|
172
|
+
});
|
|
173
|
+
return warnings;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export {
|
|
177
|
+
sameValue,
|
|
178
|
+
catalogFromRows,
|
|
179
|
+
loadCatalog,
|
|
180
|
+
layerTotal,
|
|
181
|
+
typeValues,
|
|
182
|
+
typeParamFields,
|
|
183
|
+
typeOfRow,
|
|
184
|
+
effectiveRows,
|
|
185
|
+
typeWarnings
|
|
186
|
+
};
|
|
187
|
+
//# sourceMappingURL=chunk-XQU52JKB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/catalog/index.ts"],"sourcesContent":["/**\n * Element types (Revit \"family types\"): global/<category>_type.csv rows that\n * instances reference through `type_id`, plus the ordered layers of layered\n * types in global/type_layer.csv.\n *\n * Resolution rule (spec readme, \"Element Types\"): a field shared by name between\n * a type table and its instance table is a type parameter. An empty instance\n * value inherits the type's value; a set value overrides it. A layered type's\n * thickness is the sum of its layers when the type leaves `thickness` empty.\n */\nimport { existsSync, statSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { readCsv } from '../utils/csv.js';\nimport { discoverLayout } from '../utils/fs.js';\nimport { buildRegistry, getSpecDir, TYPE_TABLES, LAYERED_TYPE_TABLES } from '../schema/registry.js';\n\nexport interface TypeLayer {\n id: string;\n seq: number;\n function: string;\n material: string;\n thickness: number;\n conductivity?: number;\n name: string;\n}\n\nexport interface ElementType {\n id: string;\n /** Type table, e.g. `wall_type`. */\n table: string;\n row: Record<string, string>;\n /** Layers sorted by `seq` (layered types only; empty otherwise). */\n layers: TypeLayer[];\n}\n\nexport interface TypeCatalog {\n types: Map<string, ElementType>;\n}\n\n/** A layer as it applies to one element: thickness adjusted to the element's\n * effective thickness and its offset from the exterior / top face. */\nexport interface ResolvedLayer extends TypeLayer {\n /** Distance from the exterior (wall) / top (slab, roof, ceiling) face to the layer's near side. */\n offset: number;\n}\n\n/** Columns of a type table that describe the type rather than parameterize instances. */\nconst TYPE_META_FIELDS = new Set(['id', 'name', 'description']);\n\nconst EPS = 1e-6;\n\nexport function round6(n: number): number {\n return Math.round(n * 1e6) / 1e6;\n}\n\n/** Equal as numbers when both parse, else as trimmed strings. */\nexport function sameValue(a: string | undefined, b: string | undefined): boolean {\n const sa = (a ?? '').trim();\n const sb = (b ?? '').trim();\n if (sa === sb) return true;\n if (sa === '' || sb === '') return false;\n const na = Number(sa);\n const nb = Number(sb);\n return Number.isFinite(na) && Number.isFinite(nb) && Math.abs(na - nb) < EPS;\n}\n\n/** Build a catalog from already-read rows (type tables + type_layer). */\nexport function catalogFromRows(\n typeRows: { table: string; rows: Record<string, string>[] }[],\n layerRows: Record<string, string>[],\n): TypeCatalog {\n const types = new Map<string, ElementType>();\n for (const { table, rows } of typeRows) {\n for (const row of rows) {\n if (!row.id) continue;\n types.set(row.id, { id: row.id, table, row, layers: [] });\n }\n }\n for (const row of layerRows) {\n const t = types.get(row.type_id ?? '');\n if (!t || !LAYERED_TYPE_TABLES.has(t.table)) continue;\n const thickness = Number(row.thickness);\n const conductivity = Number(row.conductivity);\n t.layers.push({\n id: row.id ?? '',\n seq: Number(row.seq) || 0,\n function: row.function ?? '',\n material: row.material ?? '',\n thickness: Number.isFinite(thickness) ? thickness : 0,\n conductivity: row.conductivity && Number.isFinite(conductivity) ? conductivity : undefined,\n name: row.name ?? '',\n });\n }\n for (const t of types.values()) t.layers.sort((a, b) => a.seq - b.seq);\n return { types };\n}\n\nconst cache = new Map<string, { sig: string; catalog: TypeCatalog }>();\n\nfunction typeFilePaths(globalDir: string): { table: string; path: string }[] {\n return [...TYPE_TABLES, 'type_layer'].map((table) => ({ table, path: join(globalDir, `${table}.csv`) }));\n}\n\n/** Load the project's type catalog from global/ (cached until a type file changes). */\nexport function loadCatalog(projectDir: string): TypeCatalog {\n const globalDir = join(projectDir, 'global');\n const files = typeFilePaths(globalDir).filter((f) => existsSync(f.path));\n const sig = files.map((f) => {\n const st = statSync(f.path);\n return `${f.table}:${st.mtimeMs}:${st.size}`;\n }).join('|');\n const hit = cache.get(projectDir);\n if (hit && hit.sig === sig) return hit.catalog;\n\n const typeRows: { table: string; rows: Record<string, string>[] }[] = [];\n let layerRows: Record<string, string>[] = [];\n for (const f of files) {\n let rows: Record<string, string>[];\n try { rows = readCsv(f.path).rows; } catch { continue; }\n if (f.table === 'type_layer') layerRows = rows;\n else typeRows.push({ table: f.table, rows });\n }\n const catalog = catalogFromRows(typeRows, layerRows);\n cache.set(projectDir, { sig, catalog });\n return catalog;\n}\n\n/** Sum of a type's layer thicknesses, or undefined when it has no layers. */\nexport function layerTotal(t: ElementType): number | undefined {\n if (t.layers.length === 0) return undefined;\n return round6(t.layers.reduce((s, l) => s + l.thickness, 0));\n}\n\n/** The type's parameter values (non-empty columns other than id/name/description),\n * with thickness derived from the layers when the type leaves it empty. */\nexport function typeValues(t: ElementType): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(t.row)) {\n if (TYPE_META_FIELDS.has(k) || v === undefined || v === '') continue;\n out[k] = v;\n }\n if (!out.thickness) {\n const total = layerTotal(t);\n if (total !== undefined) out.thickness = String(total);\n }\n return out;\n}\n\nconst paramFieldCache = new Map<string, string[]>();\n\n/** Field names an instance table inherits from its type table (shared by name). */\nexport function typeParamFields(instanceTable: string): string[] {\n const cached = paramFieldCache.get(instanceTable);\n if (cached) return cached;\n const registry = buildRegistry(getSpecDir());\n const inst = registry.get(instanceTable);\n const typeTable = inst?.typeTable ? registry.get(inst.typeTable) : undefined;\n let fields: string[] = [];\n if (inst && typeTable) {\n const typeCols = new Set(typeTable.csvFields.map((f) => f.name));\n fields = inst.csvFields\n .map((f) => f.name)\n .filter((n) => typeCols.has(n) && !TYPE_META_FIELDS.has(n) && n !== 'type_id');\n }\n paramFieldCache.set(instanceTable, fields);\n return fields;\n}\n\n/** The type an instance row points at, if it exists and belongs to the instance's type table. */\nexport function typeOfRow(\n instanceTable: string,\n row: Record<string, string>,\n catalog: TypeCatalog,\n): ElementType | undefined {\n const id = row.type_id;\n if (!id) return undefined;\n const t = catalog.types.get(id);\n if (!t) return undefined;\n const registry = buildRegistry(getSpecDir());\n return registry.get(instanceTable)?.typeTable === t.table ? t : undefined;\n}\n\n/** The row with every empty type parameter filled from its type. */\nexport function effectiveRow(\n instanceTable: string,\n row: Record<string, string>,\n catalog: TypeCatalog,\n): Record<string, string> {\n const t = typeOfRow(instanceTable, row, catalog);\n if (!t) return row;\n const values = typeValues(t);\n const out = { ...row };\n for (const f of typeParamFields(instanceTable)) {\n if ((out[f] ?? '') === '' && values[f] !== undefined) out[f] = values[f];\n }\n return out;\n}\n\n/** effectiveRow for every row, loading the catalog of `projectDir`. */\nexport function effectiveRows(\n projectDir: string,\n instanceTable: string,\n rows: Record<string, string>[],\n): Record<string, string>[] {\n if (!buildRegistry(getSpecDir()).get(instanceTable)?.typeTable) return rows;\n const catalog = loadCatalog(projectDir);\n if (catalog.types.size === 0) return rows;\n return rows.map((r) => effectiveRow(instanceTable, r, catalog));\n}\n\n/**\n * Layers of one element, exterior/top first. When the element overrides the\n * type's thickness the core layer (or, without one, the thickest layer) absorbs\n * the difference; if that would leave it non-positive the layers are scaled.\n * Returns null for untyped elements and types without layers.\n */\nexport function resolvedLayers(\n instanceTable: string,\n row: Record<string, string>,\n catalog: TypeCatalog,\n): ResolvedLayer[] | null {\n const t = typeOfRow(instanceTable, row, catalog);\n if (!t || t.layers.length === 0) return null;\n const layers = t.layers.map((l) => ({ ...l }));\n const total = layerTotal(t)!;\n const own = Number(row.thickness);\n if (row.thickness && Number.isFinite(own) && own > 0 && Math.abs(own - total) > EPS) {\n const diff = own - total;\n let target = layers.find((l) => l.function === 'core');\n if (!target) target = layers.reduce((a, b) => (b.thickness > a.thickness ? b : a));\n if (target.thickness + diff > EPS) {\n target.thickness = round6(target.thickness + diff);\n } else {\n const k = own / total;\n for (const l of layers) l.thickness = round6(l.thickness * k);\n }\n }\n let offset = 0;\n return layers.map((l) => {\n const r = { ...l, offset: round6(offset) };\n offset += l.thickness;\n return r;\n });\n}\n\n/** Rows of every instance table whose type is layered, per directory. */\nfunction forEachLayeredInstanceRow(\n projectDir: string,\n visit: (table: string, dirName: string, row: Record<string, string>, index: number) => void,\n): void {\n const registry = buildRegistry(getSpecDir());\n const layout = discoverLayout(projectDir);\n for (const d of [{ name: 'global', path: layout.globalDir }, ...layout.levelDirs]) {\n for (const [table, def] of registry) {\n if (!def.typeTable || !LAYERED_TYPE_TABLES.has(def.typeTable)) continue;\n const p = join(d.path, `${table}.csv`);\n if (!existsSync(p)) continue;\n let rows: Record<string, string>[];\n try { rows = readCsv(p).rows; } catch { continue; }\n rows.forEach((row, i) => visit(table, d.name, row, i));\n }\n }\n}\n\n/** Instance rows that override a layered type's thickness (build warnings). */\nexport function typeWarnings(projectDir: string): string[] {\n const catalog = loadCatalog(projectDir);\n if (catalog.types.size === 0) return [];\n const warnings: string[] = [];\n forEachLayeredInstanceRow(projectDir, (table, dirName, row, i) => {\n const t = typeOfRow(table, row, catalog);\n if (!t || !row.thickness) return;\n const total = layerTotal(t);\n if (total === undefined || sameValue(row.thickness, String(total))) return;\n warnings.push(\n `[warn] ${dirName}/${table}.csv:${i + 2} ${row.id} thickness=${row.thickness} overrides ${t.id} (layers total ${total}); its core layer absorbs the difference — clear thickness to follow the type`,\n );\n });\n return warnings;\n}\n\nexport interface ElementLayers {\n table: string;\n /** `global` or the level directory (lv-N). */\n level: string;\n id: string;\n typeId: string;\n layers: ResolvedLayer[];\n}\n\n/** Resolved layers of every typed element in the project (e.g. for IFC material layer sets). */\nexport function projectElementLayers(projectDir: string): ElementLayers[] {\n const catalog = loadCatalog(projectDir);\n if (catalog.types.size === 0) return [];\n const out: ElementLayers[] = [];\n forEachLayeredInstanceRow(projectDir, (table, dirName, row) => {\n const layers = resolvedLayers(table, row, catalog);\n if (layers) out.push({ table, level: dirName, id: row.id, typeId: row.type_id, layers });\n });\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAUA,SAAS,YAAY,gBAAgB;AACrC,SAAS,YAAY;AAoCrB,IAAM,mBAAmB,oBAAI,IAAI,CAAC,MAAM,QAAQ,aAAa,CAAC;AAE9D,IAAM,MAAM;AAEL,SAAS,OAAO,GAAmB;AACxC,SAAO,KAAK,MAAM,IAAI,GAAG,IAAI;AAC/B;AAGO,SAAS,UAAU,GAAuB,GAAgC;AAC/E,QAAM,MAAM,KAAK,IAAI,KAAK;AAC1B,QAAM,MAAM,KAAK,IAAI,KAAK;AAC1B,MAAI,OAAO,GAAI,QAAO;AACtB,MAAI,OAAO,MAAM,OAAO,GAAI,QAAO;AACnC,QAAM,KAAK,OAAO,EAAE;AACpB,QAAM,KAAK,OAAO,EAAE;AACpB,SAAO,OAAO,SAAS,EAAE,KAAK,OAAO,SAAS,EAAE,KAAK,KAAK,IAAI,KAAK,EAAE,IAAI;AAC3E;AAGO,SAAS,gBACd,UACA,WACa;AACb,QAAM,QAAQ,oBAAI,IAAyB;AAC3C,aAAW,EAAE,OAAO,KAAK,KAAK,UAAU;AACtC,eAAW,OAAO,MAAM;AACtB,UAAI,CAAC,IAAI,GAAI;AACb,YAAM,IAAI,IAAI,IAAI,EAAE,IAAI,IA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