brepjs-bim 0.26.0 → 0.27.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/dist/bcf/bcfTypes.d.ts +27 -0
- package/dist/bcf/bcfWrite.d.ts +1 -0
- package/dist/bcf/index.d.ts +1 -1
- package/dist/brepjs-bim.cjs +282 -296
- package/dist/brepjs-bim.js +281 -294
- package/dist/index.d.ts +1 -1
- package/package.json +3 -3
package/dist/brepjs-bim.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GeometryCleanupError, addHoles, applyMatrix, autoHeal, box, castShape, clone, composeTransforms, convexHull, createSolid, cut, err, extrude, fuse, fuseAll, getBounds, getKernel, getSolids, isClosedWire, isOk, isPlanarWire, isSolid, isValid, isValidSolid, locate, measureVolume, mesh, ok, outerWire, polygon, revolve, rotate, translate, validSolid } from "brepjs";
|
|
2
2
|
import * as WebIFC from "web-ifc";
|
|
3
3
|
import { Handle, IFCROOT, IfcAPI } from "web-ifc";
|
|
4
|
-
|
|
4
|
+
// src/identity/ifcGuid.ts
|
|
5
5
|
var IFC_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$";
|
|
6
6
|
function newIfcGuid() {
|
|
7
7
|
const bytes = crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
|
|
@@ -30,8 +30,7 @@ function encodeIfcGuid(bytes) {
|
|
|
30
30
|
if (bits > 0) result += IFC_CHARS[acc << 6 - bits & 63] ?? "";
|
|
31
31
|
return result;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
//#region src/identity/guidDerivation.ts
|
|
33
|
+
// src/identity/guidDerivation.ts
|
|
35
34
|
var NAMESPACE = "brepjs-bim:v1";
|
|
36
35
|
var FNV_OFFSET = 2166136261;
|
|
37
36
|
var FNV_PRIME = 16777619;
|
|
@@ -92,8 +91,7 @@ function makeRelKey(modelScope, kind, localId) {
|
|
|
92
91
|
function makeLineKey(modelScope, expressId) {
|
|
93
92
|
return `line:${modelScope}:${expressId}`;
|
|
94
93
|
}
|
|
95
|
-
|
|
96
|
-
//#region src/identity/localId.ts
|
|
94
|
+
// src/identity/localId.ts
|
|
97
95
|
function makeLocalIdCounter(start = 1) {
|
|
98
96
|
let n = start;
|
|
99
97
|
return {
|
|
@@ -101,8 +99,7 @@ function makeLocalIdCounter(start = 1) {
|
|
|
101
99
|
current: () => n - 1
|
|
102
100
|
};
|
|
103
101
|
}
|
|
104
|
-
|
|
105
|
-
//#region src/errors/bimError.ts
|
|
102
|
+
// src/errors/bimError.ts
|
|
106
103
|
function specError(code, message, cause) {
|
|
107
104
|
return {
|
|
108
105
|
kind: "BIM_SPEC",
|
|
@@ -183,8 +180,7 @@ function fromBrepError(inner, code, message) {
|
|
|
183
180
|
cause: inner
|
|
184
181
|
};
|
|
185
182
|
}
|
|
186
|
-
|
|
187
|
-
//#region ../../node_modules/zod/v4/core/util.js
|
|
183
|
+
// ../../node_modules/zod/v4/core/util.js
|
|
188
184
|
function getEnumValues(entries) {
|
|
189
185
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
190
186
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -491,6 +487,17 @@ function prefixIssues(path, issues) {
|
|
|
491
487
|
function unwrapMessage(message) {
|
|
492
488
|
return typeof message === "string" ? message : message?.message;
|
|
493
489
|
}
|
|
490
|
+
/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
|
|
491
|
+
function sizeCaps(defChecks) {
|
|
492
|
+
const caps = [];
|
|
493
|
+
for (const ch of defChecks ?? []) {
|
|
494
|
+
const d = ch._zod.def;
|
|
495
|
+
if (!/_(length|size)$|_equals$/.test(d.check)) break;
|
|
496
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
497
|
+
if (max >= 0) caps.push([max, ch]);
|
|
498
|
+
}
|
|
499
|
+
return caps;
|
|
500
|
+
}
|
|
494
501
|
function attachSchema(issues, start, inst) {
|
|
495
502
|
var _a;
|
|
496
503
|
for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
|
|
@@ -583,6 +590,7 @@ function hide(inst, key, value) {
|
|
|
583
590
|
return own(inst, key, value, false);
|
|
584
591
|
}
|
|
585
592
|
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
|
|
593
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
586
594
|
function derived(computes, table) {
|
|
587
595
|
for (const key in computes) {
|
|
588
596
|
const compute = computes[key];
|
|
@@ -706,8 +714,7 @@ function constantCatch(value) {
|
|
|
706
714
|
fn[CONSTANT_CATCH] = true;
|
|
707
715
|
return fn;
|
|
708
716
|
}
|
|
709
|
-
|
|
710
|
-
//#region ../../node_modules/zod/v4/core/core.js
|
|
717
|
+
// ../../node_modules/zod/v4/core/core.js
|
|
711
718
|
var _a$1;
|
|
712
719
|
var _zodDesc = {
|
|
713
720
|
value: void 0,
|
|
@@ -734,6 +741,7 @@ function newError(Definition) {
|
|
|
734
741
|
}
|
|
735
742
|
return new Definition();
|
|
736
743
|
}
|
|
744
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
737
745
|
function $constructor(name, initializer, proto, params) {
|
|
738
746
|
const zodProto = {};
|
|
739
747
|
function Internals(def) {
|
|
@@ -812,8 +820,7 @@ function config(newConfig) {
|
|
|
812
820
|
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
813
821
|
return globalConfig;
|
|
814
822
|
}
|
|
815
|
-
|
|
816
|
-
//#region ../../node_modules/zod/v4/core/errors.js
|
|
823
|
+
// ../../node_modules/zod/v4/core/errors.js
|
|
817
824
|
function _getMessage() {
|
|
818
825
|
const internals = this._zod;
|
|
819
826
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -864,8 +871,7 @@ var initializer$1 = (inst, def) => {
|
|
|
864
871
|
});
|
|
865
872
|
}
|
|
866
873
|
};
|
|
867
|
-
var $ZodError = $constructor("$ZodError", initializer$1);
|
|
868
|
-
$constructor("$ZodError", initializer$1, void 0, { Parent: Error });
|
|
874
|
+
var $ZodError = /* @__PURE__ */ $constructor("$ZodError", initializer$1);
|
|
869
875
|
/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
|
|
870
876
|
* ("toString", "constructor") would otherwise read through to the prototype, and assigning
|
|
871
877
|
* "__proto__" would hit the setter instead of creating a key. */
|
|
@@ -928,8 +934,7 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
928
934
|
processError(error);
|
|
929
935
|
return fieldErrors;
|
|
930
936
|
}
|
|
931
|
-
|
|
932
|
-
//#region ../../node_modules/zod/v4/core/parse.js
|
|
937
|
+
// ../../node_modules/zod/v4/core/parse.js
|
|
933
938
|
function finalizeParams(callee, params) {
|
|
934
939
|
return {
|
|
935
940
|
callee: params?.callee ?? callee,
|
|
@@ -1131,8 +1136,7 @@ var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1131
1136
|
var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1132
1137
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1133
1138
|
};
|
|
1134
|
-
|
|
1135
|
-
//#region ../../node_modules/zod/v4/core/regexes.js
|
|
1139
|
+
// ../../node_modules/zod/v4/core/regexes.js
|
|
1136
1140
|
/**
|
|
1137
1141
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
1138
1142
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -1203,8 +1207,7 @@ var number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
|
1203
1207
|
var boolean$1 = /^(?:true|false)$/i;
|
|
1204
1208
|
var lowercase = /^[^A-Z]*$/;
|
|
1205
1209
|
var uppercase = /^[^a-z]*$/;
|
|
1206
|
-
|
|
1207
|
-
//#region ../../node_modules/zod/v4/core/checks.js
|
|
1210
|
+
// ../../node_modules/zod/v4/core/checks.js
|
|
1208
1211
|
var $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
1209
1212
|
var _a;
|
|
1210
1213
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1499,8 +1502,7 @@ var $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst,
|
|
|
1499
1502
|
payload.value = def.tx(payload.value);
|
|
1500
1503
|
};
|
|
1501
1504
|
});
|
|
1502
|
-
|
|
1503
|
-
//#region ../../node_modules/zod/v4/core/doc.js
|
|
1505
|
+
// ../../node_modules/zod/v4/core/doc.js
|
|
1504
1506
|
var Doc = class {
|
|
1505
1507
|
constructor(args = [], closed = {}) {
|
|
1506
1508
|
this.content = [];
|
|
@@ -1533,15 +1535,13 @@ var Doc = class {
|
|
|
1533
1535
|
return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
|
|
1534
1536
|
}
|
|
1535
1537
|
};
|
|
1536
|
-
|
|
1537
|
-
//#region ../../node_modules/zod/v4/core/versions.js
|
|
1538
|
+
// ../../node_modules/zod/v4/core/versions.js
|
|
1538
1539
|
var version = {
|
|
1539
1540
|
major: 4,
|
|
1540
1541
|
minor: 6,
|
|
1541
|
-
patch:
|
|
1542
|
+
patch: 7
|
|
1542
1543
|
};
|
|
1543
|
-
|
|
1544
|
-
//#region ../../node_modules/zod/v4/core/schemas.js
|
|
1544
|
+
// ../../node_modules/zod/v4/core/schemas.js
|
|
1545
1545
|
var $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1546
1546
|
var _a;
|
|
1547
1547
|
inst ?? (inst = {});
|
|
@@ -2038,6 +2038,26 @@ var $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
|
|
|
2038
2038
|
return payload;
|
|
2039
2039
|
};
|
|
2040
2040
|
});
|
|
2041
|
+
function capSize(inst, size) {
|
|
2042
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
2043
|
+
if (!caps.length) return;
|
|
2044
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
2045
|
+
const parse = inst._zod.parse;
|
|
2046
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2047
|
+
const n = size(payload.value);
|
|
2048
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
2049
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
|
|
2050
|
+
const start = payload.issues.length;
|
|
2051
|
+
ch._zod.check(payload);
|
|
2052
|
+
payload.issues[start].continue = false;
|
|
2053
|
+
attachSchema(payload.issues, start, inst);
|
|
2054
|
+
return payload;
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
return parse(payload, ctx);
|
|
2058
|
+
};
|
|
2059
|
+
}
|
|
2060
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
2041
2061
|
function handleArrayResult(result, final, index) {
|
|
2042
2062
|
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
2043
2063
|
final.value[index] = result.value;
|
|
@@ -2075,6 +2095,7 @@ var $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
|
|
|
2075
2095
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
2076
2096
|
return payload;
|
|
2077
2097
|
};
|
|
2098
|
+
capSize(inst, arraySize);
|
|
2078
2099
|
});
|
|
2079
2100
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
2080
2101
|
const isPresent = key in input;
|
|
@@ -2183,7 +2204,7 @@ var $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
|
2183
2204
|
}
|
|
2184
2205
|
return propValues;
|
|
2185
2206
|
});
|
|
2186
|
-
const isObject$
|
|
2207
|
+
const isObject$1 = isObject;
|
|
2187
2208
|
const catchall = def.catchall;
|
|
2188
2209
|
let value;
|
|
2189
2210
|
const memo = globalConfig.memoizer;
|
|
@@ -2191,7 +2212,7 @@ var $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
|
2191
2212
|
inst._zod.parse = (payload, ctx) => {
|
|
2192
2213
|
value ?? (value = _normalized.value);
|
|
2193
2214
|
const input = payload.value;
|
|
2194
|
-
if (!isObject$
|
|
2215
|
+
if (!isObject$1(input)) {
|
|
2195
2216
|
payload.issues.push({
|
|
2196
2217
|
expected: "object",
|
|
2197
2218
|
code: "invalid_type",
|
|
@@ -2321,7 +2342,7 @@ var $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
|
2321
2342
|
return doc.compile();
|
|
2322
2343
|
};
|
|
2323
2344
|
let fastpass;
|
|
2324
|
-
const isObject$
|
|
2345
|
+
const isObject$2 = isObject;
|
|
2325
2346
|
const jit = !globalConfig.jitless;
|
|
2326
2347
|
const fastEnabled = jit && allowsEval.value;
|
|
2327
2348
|
const catchall = def.catchall;
|
|
@@ -2329,7 +2350,7 @@ var $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
|
2329
2350
|
inst._zod.parse = (payload, ctx) => {
|
|
2330
2351
|
value ?? (value = _normalized.value);
|
|
2331
2352
|
const input = payload.value;
|
|
2332
|
-
if (!isObject$
|
|
2353
|
+
if (!isObject$2(input)) {
|
|
2333
2354
|
payload.issues.push({
|
|
2334
2355
|
expected: "object",
|
|
2335
2356
|
code: "invalid_type",
|
|
@@ -3082,8 +3103,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
3082
3103
|
payload.issues.push(issue$1(_iss));
|
|
3083
3104
|
}
|
|
3084
3105
|
}
|
|
3085
|
-
|
|
3086
|
-
//#region ../../node_modules/zod/v4/core/memoizer.js
|
|
3106
|
+
// ../../node_modules/zod/v4/core/memoizer.js
|
|
3087
3107
|
var $ZodCyclicError = class extends Error {
|
|
3088
3108
|
constructor() {
|
|
3089
3109
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3335,8 +3355,7 @@ function isBackEdge(ctx, value) {
|
|
|
3335
3355
|
const backEdges = ctx[STATE]?.backEdges;
|
|
3336
3356
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3337
3357
|
}
|
|
3338
|
-
|
|
3339
|
-
//#region ../../node_modules/zod/v4/locales/en.js
|
|
3358
|
+
// ../../node_modules/zod/v4/locales/en.js
|
|
3340
3359
|
var error = () => {
|
|
3341
3360
|
const Sizable = {
|
|
3342
3361
|
string: {
|
|
@@ -3443,8 +3462,7 @@ var error = () => {
|
|
|
3443
3462
|
function en_default() {
|
|
3444
3463
|
return { localeError: error() };
|
|
3445
3464
|
}
|
|
3446
|
-
|
|
3447
|
-
//#region ../../node_modules/zod/v4/core/registries.js
|
|
3465
|
+
// ../../node_modules/zod/v4/core/registries.js
|
|
3448
3466
|
var _a;
|
|
3449
3467
|
var $ZodRegistry = class {
|
|
3450
3468
|
constructor() {
|
|
@@ -3490,8 +3508,7 @@ function registry() {
|
|
|
3490
3508
|
}
|
|
3491
3509
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
3492
3510
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
3493
|
-
|
|
3494
|
-
//#region ../../node_modules/zod/v4/core/api.js
|
|
3511
|
+
// ../../node_modules/zod/v4/core/api.js
|
|
3495
3512
|
function snapshotChecks(def) {
|
|
3496
3513
|
if (def.checks) def.checks = [...def.checks];
|
|
3497
3514
|
return def;
|
|
@@ -4010,8 +4027,7 @@ function _check(fn, params) {
|
|
|
4010
4027
|
ch._zod.check = fn;
|
|
4011
4028
|
return ch;
|
|
4012
4029
|
}
|
|
4013
|
-
|
|
4014
|
-
//#region ../../node_modules/zod/v4/core/to-json-schema.js
|
|
4030
|
+
// ../../node_modules/zod/v4/core/to-json-schema.js
|
|
4015
4031
|
function assignProps(target, ...sources) {
|
|
4016
4032
|
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
4017
4033
|
return target;
|
|
@@ -4454,8 +4470,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
4454
4470
|
extractDefs(ctx, schema);
|
|
4455
4471
|
return finalize$1(ctx, schema);
|
|
4456
4472
|
};
|
|
4457
|
-
|
|
4458
|
-
//#region ../../node_modules/zod/v4/core/json-schema-processors.js
|
|
4473
|
+
// ../../node_modules/zod/v4/core/json-schema-processors.js
|
|
4459
4474
|
var narrowMin = (agg, key, value) => {
|
|
4460
4475
|
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
4461
4476
|
};
|
|
@@ -4954,8 +4969,7 @@ var optionalProcessor = (schema, ctx, _json, params) => {
|
|
|
4954
4969
|
const seen = ctx.seen.get(schema);
|
|
4955
4970
|
seen.ref = def.innerType;
|
|
4956
4971
|
};
|
|
4957
|
-
|
|
4958
|
-
//#region ../../node_modules/zod/v4/classic/errors.js
|
|
4972
|
+
// ../../node_modules/zod/v4/classic/errors.js
|
|
4959
4973
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
4960
4974
|
function _lazyMethod(proto, key, make) {
|
|
4961
4975
|
Object.defineProperty(proto, key, {
|
|
@@ -5004,8 +5018,7 @@ var initializer = (inst, issues) => {
|
|
|
5004
5018
|
});
|
|
5005
5019
|
};
|
|
5006
5020
|
var ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
5007
|
-
|
|
5008
|
-
//#region ../../node_modules/zod/v4/classic/parse.js
|
|
5021
|
+
// ../../node_modules/zod/v4/classic/parse.js
|
|
5009
5022
|
var parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
5010
5023
|
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5011
5024
|
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -5018,8 +5031,7 @@ var safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
|
5018
5031
|
var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
5019
5032
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5020
5033
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5021
|
-
|
|
5022
|
-
//#region ../../node_modules/zod/v4/classic/schemas.js
|
|
5034
|
+
// ../../node_modules/zod/v4/classic/schemas.js
|
|
5023
5035
|
function _ensureDefaultLocale() {
|
|
5024
5036
|
if (!globalConfig.localeError) config(en_default());
|
|
5025
5037
|
}
|
|
@@ -5934,8 +5946,7 @@ function refine(fn, _params = {}) {
|
|
|
5934
5946
|
function superRefine(fn, params) {
|
|
5935
5947
|
return /* @__PURE__ */ _superRefine(fn, params);
|
|
5936
5948
|
}
|
|
5937
|
-
|
|
5938
|
-
//#region src/geometryCleanupDiagnostics.ts
|
|
5949
|
+
// src/geometryCleanupDiagnostics.ts
|
|
5939
5950
|
var diagnosticSchema = object({
|
|
5940
5951
|
operation: string(),
|
|
5941
5952
|
itemIndex: number().int().nonnegative(),
|
|
@@ -6036,8 +6047,7 @@ function reportedGeometryCleanup(error, operation, context = {}) {
|
|
|
6036
6047
|
visit(error);
|
|
6037
6048
|
return diagnostics;
|
|
6038
6049
|
}
|
|
6039
|
-
|
|
6040
|
-
//#region src/placementFrame.ts
|
|
6050
|
+
// src/placementFrame.ts
|
|
6041
6051
|
/** Numeric, column-major rigid frames. Translation is in millimetres. */
|
|
6042
6052
|
/** Construction is private; every exposed matrix is an immutable snapshot. */
|
|
6043
6053
|
var RigidFrame = class RigidFrame {
|
|
@@ -6346,8 +6356,7 @@ function isFiniteNumbers(value) {
|
|
|
6346
6356
|
function within(value, target, tolerance) {
|
|
6347
6357
|
return value >= target - tolerance && value <= target + tolerance;
|
|
6348
6358
|
}
|
|
6349
|
-
|
|
6350
|
-
//#region src/rigidPlacement.ts
|
|
6359
|
+
// src/rigidPlacement.ts
|
|
6351
6360
|
var RAD_TO_DEG = 180 / Math.PI;
|
|
6352
6361
|
var ROTATION_EPSILON = 1e-12;
|
|
6353
6362
|
/** Applies a rigid placement as a location so the source BRep is not rebuilt. */
|
|
@@ -6418,8 +6427,7 @@ function rotationOp(matrix) {
|
|
|
6418
6427
|
axis
|
|
6419
6428
|
};
|
|
6420
6429
|
}
|
|
6421
|
-
|
|
6422
|
-
//#region src/productBodyCleanup.ts
|
|
6430
|
+
// src/productBodyCleanup.ts
|
|
6423
6431
|
var COMPLETE_CLEANUP = Object.freeze({ kind: "COMPLETE" });
|
|
6424
6432
|
function cleanupReport(diagnostics) {
|
|
6425
6433
|
const [first, ...rest] = diagnostics;
|
|
@@ -6477,14 +6485,12 @@ function cleanupOwnedResources(items, context) {
|
|
|
6477
6485
|
}
|
|
6478
6486
|
return cleanupReport(diagnostics);
|
|
6479
6487
|
}
|
|
6480
|
-
|
|
6481
|
-
//#region src/productBodyTestHooks.ts
|
|
6488
|
+
// src/productBodyTestHooks.ts
|
|
6482
6489
|
var hooks = null;
|
|
6483
6490
|
function productBodyTestHooks() {
|
|
6484
6491
|
return hooks;
|
|
6485
6492
|
}
|
|
6486
|
-
|
|
6487
|
-
//#region src/types/productBody.ts
|
|
6493
|
+
// src/types/productBody.ts
|
|
6488
6494
|
var descriptorSchema = object({
|
|
6489
6495
|
kind: _enum(["PARAMETRIC", "AUTHORITATIVE"]),
|
|
6490
6496
|
solids: custom((value) => Array.isArray(value)).refine((value) => value.length > 0)
|
|
@@ -6775,8 +6781,7 @@ function validateBoundsItems(input) {
|
|
|
6775
6781
|
operation: "productBodyBounds"
|
|
6776
6782
|
});
|
|
6777
6783
|
}
|
|
6778
|
-
|
|
6779
|
-
//#region src/geometryGeneration.ts
|
|
6784
|
+
// src/geometryGeneration.ts
|
|
6780
6785
|
var uncertainGeneration = /* @__PURE__ */ new WeakMap();
|
|
6781
6786
|
/** Already-attempted resources, with identities captured before any release. Never retry them. */
|
|
6782
6787
|
function uncertainGeneratedResources(error) {
|
|
@@ -6844,8 +6849,7 @@ function generateGeometry(context, build) {
|
|
|
6844
6849
|
metadata: { cleanup: cleanupReport(diagnostics) }
|
|
6845
6850
|
}, uncertain);
|
|
6846
6851
|
}
|
|
6847
|
-
|
|
6848
|
-
//#region src/elementFns/validateGeneratedSolid.ts
|
|
6852
|
+
// src/elementFns/validateGeneratedSolid.ts
|
|
6849
6853
|
/** Validate a candidate already owned by the surrounding generation scope. */
|
|
6850
6854
|
function validateGeneratedSolid(solid, context) {
|
|
6851
6855
|
let cause;
|
|
@@ -6856,8 +6860,7 @@ function validateGeneratedSolid(solid, context) {
|
|
|
6856
6860
|
}
|
|
6857
6861
|
return err(geometryError(context.code, context.message, cause));
|
|
6858
6862
|
}
|
|
6859
|
-
|
|
6860
|
-
//#region src/elementFns/wallFns.ts
|
|
6863
|
+
// src/elementFns/wallFns.ts
|
|
6861
6864
|
function wallToSolid(spec) {
|
|
6862
6865
|
return generateGeometry({
|
|
6863
6866
|
operation: "wallToSolid",
|
|
@@ -6903,8 +6906,7 @@ function wallToSolid(spec) {
|
|
|
6903
6906
|
});
|
|
6904
6907
|
});
|
|
6905
6908
|
}
|
|
6906
|
-
|
|
6907
|
-
//#region src/elementFns/slabFns.ts
|
|
6909
|
+
// src/elementFns/slabFns.ts
|
|
6908
6910
|
function slabToSolid(spec) {
|
|
6909
6911
|
return generateGeometry({
|
|
6910
6912
|
operation: "slabToSolid",
|
|
@@ -6950,8 +6952,7 @@ function slabToSolid(spec) {
|
|
|
6950
6952
|
});
|
|
6951
6953
|
});
|
|
6952
6954
|
}
|
|
6953
|
-
|
|
6954
|
-
//#region src/specs/profilesExtended.ts
|
|
6955
|
+
// src/specs/profilesExtended.ts
|
|
6955
6956
|
var ELLIPSE_SEGMENTS = 48;
|
|
6956
6957
|
function extendedProfileArea(profile) {
|
|
6957
6958
|
switch (profile.kind) {
|
|
@@ -7230,8 +7231,7 @@ function extendedProfileToFace(profile) {
|
|
|
7230
7231
|
return ok(faceWithHoles);
|
|
7231
7232
|
});
|
|
7232
7233
|
}
|
|
7233
|
-
|
|
7234
|
-
//#region src/specs/profile.ts
|
|
7234
|
+
// src/specs/profile.ts
|
|
7235
7235
|
var EXTENDED_PROFILE_KIND_SET = /* @__PURE__ */ new Set([
|
|
7236
7236
|
"L_SHAPE",
|
|
7237
7237
|
"T_SHAPE",
|
|
@@ -7406,8 +7406,7 @@ function parseProfile(input) {
|
|
|
7406
7406
|
}
|
|
7407
7407
|
return ok(profile);
|
|
7408
7408
|
}
|
|
7409
|
-
|
|
7410
|
-
//#region src/elementFns/profileFns.ts
|
|
7409
|
+
// src/elementFns/profileFns.ts
|
|
7411
7410
|
function profileCrossSectionArea(profile) {
|
|
7412
7411
|
if (isExtendedProfile(profile)) return extendedProfileArea(profile);
|
|
7413
7412
|
switch (profile.kind) {
|
|
@@ -7545,8 +7544,7 @@ function profileToPolygon(profile, circleSegments = 32) {
|
|
|
7545
7544
|
}
|
|
7546
7545
|
}
|
|
7547
7546
|
}
|
|
7548
|
-
|
|
7549
|
-
//#region src/elementFns/beamFns.ts
|
|
7547
|
+
// src/elementFns/beamFns.ts
|
|
7550
7548
|
function beamToSolid(spec) {
|
|
7551
7549
|
return generateGeometry({
|
|
7552
7550
|
operation: "beamToSolid",
|
|
@@ -7595,8 +7593,7 @@ function beamToSolid(spec) {
|
|
|
7595
7593
|
});
|
|
7596
7594
|
});
|
|
7597
7595
|
}
|
|
7598
|
-
|
|
7599
|
-
//#region src/elementFns/columnFns.ts
|
|
7596
|
+
// src/elementFns/columnFns.ts
|
|
7600
7597
|
function columnToSolid(spec) {
|
|
7601
7598
|
return generateGeometry({
|
|
7602
7599
|
operation: "columnToSolid",
|
|
@@ -7636,8 +7633,7 @@ function columnToSolid(spec) {
|
|
|
7636
7633
|
});
|
|
7637
7634
|
});
|
|
7638
7635
|
}
|
|
7639
|
-
|
|
7640
|
-
//#region src/elementFns/openingFns.ts
|
|
7636
|
+
// src/elementFns/openingFns.ts
|
|
7641
7637
|
var EPSILON_MM = 1;
|
|
7642
7638
|
function openingToSolid(spec, wallThickness) {
|
|
7643
7639
|
return generateGeometry({
|
|
@@ -7688,8 +7684,7 @@ function openingToSolid(spec, wallThickness) {
|
|
|
7688
7684
|
});
|
|
7689
7685
|
});
|
|
7690
7686
|
}
|
|
7691
|
-
|
|
7692
|
-
//#region src/elementFns/slabOpeningFns.ts
|
|
7687
|
+
// src/elementFns/slabOpeningFns.ts
|
|
7693
7688
|
function slabOpeningToSolid(spec, slabThickness) {
|
|
7694
7689
|
return generateGeometry({
|
|
7695
7690
|
operation: "slabOpeningToSolid",
|
|
@@ -7739,8 +7734,7 @@ function slabOpeningToSolid(spec, slabThickness) {
|
|
|
7739
7734
|
});
|
|
7740
7735
|
});
|
|
7741
7736
|
}
|
|
7742
|
-
|
|
7743
|
-
//#region src/ownedSolidChildren.ts
|
|
7737
|
+
// src/ownedSolidChildren.ts
|
|
7744
7738
|
/** Register every eager iterator allocation before wrapping any child. */
|
|
7745
7739
|
function ownSolidChildren(parent, own) {
|
|
7746
7740
|
const kernel = getKernel();
|
|
@@ -7766,8 +7760,7 @@ function ownSolidChildren(parent, own) {
|
|
|
7766
7760
|
children.forEach(({ resource }, itemIndex) => own(resource, itemIndex));
|
|
7767
7761
|
return children.map(({ wrap }) => wrap());
|
|
7768
7762
|
}
|
|
7769
|
-
|
|
7770
|
-
//#region src/elementFns/cutOpeningSolid.ts
|
|
7763
|
+
// src/elementFns/cutOpeningSolid.ts
|
|
7771
7764
|
/** Borrow the host; retain one independent solid only after all temporary cleanup succeeds. */
|
|
7772
7765
|
function cutOpeningSolid(input) {
|
|
7773
7766
|
const prefix = `${input.hostKind}_OPENING`;
|
|
@@ -7791,8 +7784,7 @@ function cutOpeningSolid(input) {
|
|
|
7791
7784
|
});
|
|
7792
7785
|
});
|
|
7793
7786
|
}
|
|
7794
|
-
|
|
7795
|
-
//#region src/elementFns/spaceFns.ts
|
|
7787
|
+
// src/elementFns/spaceFns.ts
|
|
7796
7788
|
function spaceToSolid(spec) {
|
|
7797
7789
|
return generateGeometry({
|
|
7798
7790
|
operation: "spaceToSolid",
|
|
@@ -7838,8 +7830,7 @@ function spaceToSolid(spec) {
|
|
|
7838
7830
|
});
|
|
7839
7831
|
});
|
|
7840
7832
|
}
|
|
7841
|
-
|
|
7842
|
-
//#region src/elementFns/roofFns.ts
|
|
7833
|
+
// src/elementFns/roofFns.ts
|
|
7843
7834
|
var DEG2RAD = Math.PI / 180;
|
|
7844
7835
|
function gate(solid, code, own) {
|
|
7845
7836
|
return validateGeneratedSolid(own(solid), {
|
|
@@ -8061,8 +8052,7 @@ function roofToSolid(spec) {
|
|
|
8061
8052
|
}
|
|
8062
8053
|
});
|
|
8063
8054
|
}
|
|
8064
|
-
|
|
8065
|
-
//#region src/elementFns/curtainWallFns.ts
|
|
8055
|
+
// src/elementFns/curtainWallFns.ts
|
|
8066
8056
|
function registerResource(owned, resource, itemIndex) {
|
|
8067
8057
|
const item = {
|
|
8068
8058
|
resource,
|
|
@@ -8228,8 +8218,7 @@ function curtainWallToGrid(spec) {
|
|
|
8228
8218
|
}
|
|
8229
8219
|
}, uncertain);
|
|
8230
8220
|
}
|
|
8231
|
-
|
|
8232
|
-
//#region src/elementFns/foundationFns.ts
|
|
8221
|
+
// src/elementFns/foundationFns.ts
|
|
8233
8222
|
function footingToSolid(spec) {
|
|
8234
8223
|
return generateGeometry({
|
|
8235
8224
|
operation: "footingToSolid",
|
|
@@ -8314,8 +8303,7 @@ function pileToSolid(spec) {
|
|
|
8314
8303
|
});
|
|
8315
8304
|
});
|
|
8316
8305
|
}
|
|
8317
|
-
|
|
8318
|
-
//#region src/elementFns/railingFns.ts
|
|
8306
|
+
// src/elementFns/railingFns.ts
|
|
8319
8307
|
function panelRailing(spec) {
|
|
8320
8308
|
return generateGeometry({
|
|
8321
8309
|
operation: "railingToSolid",
|
|
@@ -8415,8 +8403,7 @@ function railingToSolid(spec) {
|
|
|
8415
8403
|
if (spec.thickness <= 0) return err(specError("RAILING_ZERO_THICKNESS", "Railing thickness must be positive"));
|
|
8416
8404
|
return spec.infill === "POSTED" ? postedRailing(spec) : panelRailing(spec);
|
|
8417
8405
|
}
|
|
8418
|
-
|
|
8419
|
-
//#region src/elementFns/coveringFns.ts
|
|
8406
|
+
// src/elementFns/coveringFns.ts
|
|
8420
8407
|
function coveringToSolid(spec) {
|
|
8421
8408
|
return generateGeometry({
|
|
8422
8409
|
operation: "coveringToSolid",
|
|
@@ -8462,8 +8449,7 @@ function coveringToSolid(spec) {
|
|
|
8462
8449
|
});
|
|
8463
8450
|
});
|
|
8464
8451
|
}
|
|
8465
|
-
|
|
8466
|
-
//#region src/model/modelGeometry.ts
|
|
8452
|
+
// src/model/modelGeometry.ts
|
|
8467
8453
|
/** Transitional enumeration of current record storage. Step 2 converges these forms. */
|
|
8468
8454
|
function retainedSolids(element) {
|
|
8469
8455
|
switch (element.category) {
|
|
@@ -8522,8 +8508,7 @@ function protectElement(element) {
|
|
|
8522
8508
|
}));
|
|
8523
8509
|
return ok(Object.freeze(element));
|
|
8524
8510
|
}
|
|
8525
|
-
|
|
8526
|
-
//#region src/model/bimModel.ts
|
|
8511
|
+
// src/model/bimModel.ts
|
|
8527
8512
|
var RejectedModelCommand = class extends Error {
|
|
8528
8513
|
error;
|
|
8529
8514
|
constructor(error) {
|
|
@@ -9799,8 +9784,7 @@ var BimModel = class {
|
|
|
9799
9784
|
return localId;
|
|
9800
9785
|
}
|
|
9801
9786
|
};
|
|
9802
|
-
|
|
9803
|
-
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/usingCtx.js
|
|
9787
|
+
// \0@oxc-project+runtime@0.155.0/helpers/esm/usingCtx.js
|
|
9804
9788
|
function _usingCtx() {
|
|
9805
9789
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
9806
9790
|
var n = Error();
|
|
@@ -9855,8 +9839,7 @@ function _usingCtx() {
|
|
|
9855
9839
|
}
|
|
9856
9840
|
};
|
|
9857
9841
|
}
|
|
9858
|
-
|
|
9859
|
-
//#region src/elementFns/stairFns.ts
|
|
9842
|
+
// src/elementFns/stairFns.ts
|
|
9860
9843
|
function buildSilhouette$1(numberOfRisers, riserHeight, treadLength) {
|
|
9861
9844
|
const pts = [];
|
|
9862
9845
|
pts.push([
|
|
@@ -9919,8 +9902,7 @@ function stairFlightToSolid(spec) {
|
|
|
9919
9902
|
_usingCtx$7.d();
|
|
9920
9903
|
}
|
|
9921
9904
|
}
|
|
9922
|
-
|
|
9923
|
-
//#region src/elementFns/rampFns.ts
|
|
9905
|
+
// src/elementFns/rampFns.ts
|
|
9924
9906
|
function buildSilhouette(length, rise, thickness) {
|
|
9925
9907
|
return [
|
|
9926
9908
|
[
|
|
@@ -9978,8 +9960,7 @@ function rampFlightToSolid(spec) {
|
|
|
9978
9960
|
_usingCtx$6.d();
|
|
9979
9961
|
}
|
|
9980
9962
|
}
|
|
9981
|
-
|
|
9982
|
-
//#region src/elementFns/placedGeometry.ts
|
|
9963
|
+
// src/elementFns/placedGeometry.ts
|
|
9983
9964
|
function place(solid, frame) {
|
|
9984
9965
|
try {
|
|
9985
9966
|
return ok(locateShapeInFrame(solid, frame));
|
|
@@ -10177,8 +10158,7 @@ function validatePlacements(el, parent) {
|
|
|
10177
10158
|
}
|
|
10178
10159
|
return ok(void 0);
|
|
10179
10160
|
}
|
|
10180
|
-
|
|
10181
|
-
//#region src/ifc-writer/schemaVersion.ts
|
|
10161
|
+
// src/ifc-writer/schemaVersion.ts
|
|
10182
10162
|
/**
|
|
10183
10163
|
* IFC schema-version abstraction for the writer.
|
|
10184
10164
|
*
|
|
@@ -10240,8 +10220,7 @@ function schemaSupports(schema, entityName) {
|
|
|
10240
10220
|
if (IFC4X3_ONLY_ENTITIES.has(entityName)) return schema === "IFC4X3";
|
|
10241
10221
|
return true;
|
|
10242
10222
|
}
|
|
10243
|
-
|
|
10244
|
-
//#region src/ifcRuntime.ts
|
|
10223
|
+
// src/ifcRuntime.ts
|
|
10245
10224
|
var wasmLocateFile;
|
|
10246
10225
|
/**
|
|
10247
10226
|
* Override how web-ifc finds its `.wasm` file. Applied by every web-ifc entry
|
|
@@ -10266,8 +10245,7 @@ function setIfcWasmLocateFile(locate) {
|
|
|
10266
10245
|
async function initIfcApi(api) {
|
|
10267
10246
|
await api.Init(wasmLocateFile, true);
|
|
10268
10247
|
}
|
|
10269
|
-
|
|
10270
|
-
//#region src/ifc-writer/ifcWriter.ts
|
|
10248
|
+
// src/ifc-writer/ifcWriter.ts
|
|
10271
10249
|
var testHooks$3 = null;
|
|
10272
10250
|
/** Default MVD ViewDefinition declared in the STEP FILE_DESCRIPTION header. */
|
|
10273
10251
|
var DEFAULT_MVD_VIEW_DEFINITION = "ReferenceView_v1.2";
|
|
@@ -10383,8 +10361,7 @@ var IfcWriter = class IfcWriter {
|
|
|
10383
10361
|
return out;
|
|
10384
10362
|
}
|
|
10385
10363
|
};
|
|
10386
|
-
|
|
10387
|
-
//#region src/ifc-writer/ownerHistoryWriter.ts
|
|
10364
|
+
// src/ifc-writer/ownerHistoryWriter.ts
|
|
10388
10365
|
/**
|
|
10389
10366
|
* Writes the IfcPerson → IfcOrganization → IfcPersonAndOrganization →
|
|
10390
10367
|
* IfcApplication → IfcOwnerHistory chain from the supplied metadata and returns
|
|
@@ -10488,8 +10465,7 @@ function optionalLabel(w, value) {
|
|
|
10488
10465
|
if (value === void 0 || value.length === 0) return null;
|
|
10489
10466
|
return w.mkType(WebIFC.IFCLABEL, value);
|
|
10490
10467
|
}
|
|
10491
|
-
|
|
10492
|
-
//#region src/ifc-writer/headerWriter.ts
|
|
10468
|
+
// src/ifc-writer/headerWriter.ts
|
|
10493
10469
|
function writeHeader(w, meta) {
|
|
10494
10470
|
const ownerHistoryId = writeOwnerHistory(w, {
|
|
10495
10471
|
author: meta.author ?? {},
|
|
@@ -10670,8 +10646,7 @@ function writeDirection(w, dir) {
|
|
|
10670
10646
|
});
|
|
10671
10647
|
return id;
|
|
10672
10648
|
}
|
|
10673
|
-
|
|
10674
|
-
//#region src/units/units.ts
|
|
10649
|
+
// src/units/units.ts
|
|
10675
10650
|
var DEFAULT_UNITS = { length: "mm" };
|
|
10676
10651
|
function toLengthMm(value, unit) {
|
|
10677
10652
|
switch (unit) {
|
|
@@ -10684,8 +10659,7 @@ function toLengthMm(value, unit) {
|
|
|
10684
10659
|
function toIfcLengthM(mm) {
|
|
10685
10660
|
return mm / 1e3;
|
|
10686
10661
|
}
|
|
10687
|
-
|
|
10688
|
-
//#region src/ifc-writer/entityWriter.ts
|
|
10662
|
+
// src/ifc-writer/entityWriter.ts
|
|
10689
10663
|
function writeProject$1(w, guid, name, ownerHistoryId, unitAssignmentId, geomContextId) {
|
|
10690
10664
|
const id = w.nextId();
|
|
10691
10665
|
w.writeLine({
|
|
@@ -10903,8 +10877,7 @@ function writeColumnEntity(w, guid, name, _predefinedType, ownerHistoryId, local
|
|
|
10903
10877
|
});
|
|
10904
10878
|
return id;
|
|
10905
10879
|
}
|
|
10906
|
-
|
|
10907
|
-
//#region src/ifc-writer/tessellationWriter.ts
|
|
10880
|
+
// src/ifc-writer/tessellationWriter.ts
|
|
10908
10881
|
var IFC_MESH_TOLERANCE_MM = 5;
|
|
10909
10882
|
var IFC_MESH_ANGULAR_TOLERANCE_RAD = .3;
|
|
10910
10883
|
function prepareTessellation(solid, toleranceMm = IFC_MESH_TOLERANCE_MM) {
|
|
@@ -11126,8 +11099,7 @@ function writeFacetedBrepFallback(w, geomSubContextId, reason) {
|
|
|
11126
11099
|
fallbackReason: reason
|
|
11127
11100
|
};
|
|
11128
11101
|
}
|
|
11129
|
-
|
|
11130
|
-
//#region src/ifc-writer/profileDefWriter.ts
|
|
11102
|
+
// src/ifc-writer/profileDefWriter.ts
|
|
11131
11103
|
var AREA_PROFILE = {
|
|
11132
11104
|
type: 3,
|
|
11133
11105
|
value: "AREA"
|
|
@@ -11374,8 +11346,7 @@ function writePolyline(w, points) {
|
|
|
11374
11346
|
});
|
|
11375
11347
|
return id;
|
|
11376
11348
|
}
|
|
11377
|
-
|
|
11378
|
-
//#region src/ifc-writer/geometryWriter.ts
|
|
11349
|
+
// src/ifc-writer/geometryWriter.ts
|
|
11379
11350
|
function writeSlabGeometry(w, spec, geomSubContextId, parentPlacementId) {
|
|
11380
11351
|
const placement3DId = writeAxis2Placement3D(w, spec.origin.map(toIfcLengthM), spec.axisZ, spec.axisX);
|
|
11381
11352
|
const localPlacementId = w.nextId();
|
|
@@ -11677,8 +11648,7 @@ function writeBeamGeometry(w, spec, geomSubContextId, parentPlacementId) {
|
|
|
11677
11648
|
function writeColumnGeometry(w, spec, geomSubContextId, parentPlacementId) {
|
|
11678
11649
|
return writeLinearExtrusion(w, spec.profile, spec.origin, spec.axisZ, spec.axisX, toIfcLengthM(spec.height), geomSubContextId, parentPlacementId);
|
|
11679
11650
|
}
|
|
11680
|
-
|
|
11681
|
-
//#region src/ifc-writer/spaceWriter.ts
|
|
11651
|
+
// src/ifc-writer/spaceWriter.ts
|
|
11682
11652
|
function writeSpaceGeometry(w, spec, geomSubContextId, parentPlacementId) {
|
|
11683
11653
|
const placement3DId = writeAxis2Placement3D(w, spec.origin.map(toIfcLengthM), spec.axisZ, spec.axisX);
|
|
11684
11654
|
const localPlacementId = w.nextId();
|
|
@@ -11801,8 +11771,7 @@ function writeRelSpaceBoundary(w, guid, ownerHistoryId, spaceExpressId, elementE
|
|
|
11801
11771
|
}
|
|
11802
11772
|
});
|
|
11803
11773
|
}
|
|
11804
|
-
|
|
11805
|
-
//#region src/ifc-writer/roofWriter.ts
|
|
11774
|
+
// src/ifc-writer/roofWriter.ts
|
|
11806
11775
|
/**
|
|
11807
11776
|
* Writes an IfcRoof occurrence. `localPlacementId` and `productDefinitionShapeId`
|
|
11808
11777
|
* are the IfcLocalPlacement and IfcProductDefinitionShape express IDs produced by
|
|
@@ -11863,8 +11832,7 @@ function writeRoofType(w, ownerHistoryId, typeGuid, relGuid, predefinedType, occ
|
|
|
11863
11832
|
})
|
|
11864
11833
|
};
|
|
11865
11834
|
}
|
|
11866
|
-
|
|
11867
|
-
//#region src/ifc-writer/curtainWallWriter.ts
|
|
11835
|
+
// src/ifc-writer/curtainWallWriter.ts
|
|
11868
11836
|
function writeComponentGeometry(w, component, geomSubContextId, parentPlacementId) {
|
|
11869
11837
|
const placement3DId = writeAxis2Placement3D(w, component.origin.map(toIfcLengthM));
|
|
11870
11838
|
const localPlacementId = w.nextId();
|
|
@@ -12051,8 +12019,7 @@ function writeCurtainWall(w, spec, grid, stableKey, name, ownerHistoryId, geomSu
|
|
|
12051
12019
|
aggregatesId
|
|
12052
12020
|
};
|
|
12053
12021
|
}
|
|
12054
|
-
|
|
12055
|
-
//#region src/ifc-writer/foundationWriter.ts
|
|
12022
|
+
// src/ifc-writer/foundationWriter.ts
|
|
12056
12023
|
function writeFootingGeometry(w, spec, geomSubContextId, parentPlacementId) {
|
|
12057
12024
|
const placement3DId = writeAxis2Placement3D(w, spec.origin.map(toIfcLengthM), spec.axisZ, spec.axisX);
|
|
12058
12025
|
const localPlacementId = w.nextId();
|
|
@@ -12204,8 +12171,7 @@ function writePileEntity(w, guid, name, _predefinedType, constructionType, owner
|
|
|
12204
12171
|
});
|
|
12205
12172
|
return id;
|
|
12206
12173
|
}
|
|
12207
|
-
|
|
12208
|
-
//#region src/ifc-writer/relWriter.ts
|
|
12174
|
+
// src/ifc-writer/relWriter.ts
|
|
12209
12175
|
function writeRelAggregates(w, guid, ownerHistoryId, relatingObjectId, relatedObjectIds) {
|
|
12210
12176
|
w.writeLine({
|
|
12211
12177
|
expressID: w.nextId(),
|
|
@@ -12230,8 +12196,7 @@ function writeRelContainedInSpatialStructure(w, guid, ownerHistoryId, relatingSt
|
|
|
12230
12196
|
RelatingStructure: w.ref(relatingStructureId)
|
|
12231
12197
|
});
|
|
12232
12198
|
}
|
|
12233
|
-
|
|
12234
|
-
//#region src/ifc-writer/stairWriter.ts
|
|
12199
|
+
// src/ifc-writer/stairWriter.ts
|
|
12235
12200
|
function writeLocalPlacement(w, origin, axisZ, axisX, parentPlacementId) {
|
|
12236
12201
|
const placement3DId = writeAxis2Placement3D(w, origin.map(toIfcLengthM), axisZ, axisX);
|
|
12237
12202
|
const localPlacementId = w.nextId();
|
|
@@ -12516,8 +12481,7 @@ function writeRampAssembly(w, spec, rampKey, assemblyGuid, ownerHistoryId, geomS
|
|
|
12516
12481
|
}
|
|
12517
12482
|
};
|
|
12518
12483
|
}
|
|
12519
|
-
|
|
12520
|
-
//#region src/ifc-writer/railingWriter.ts
|
|
12484
|
+
// src/ifc-writer/railingWriter.ts
|
|
12521
12485
|
function writeRailingEntity(w, guid, name, _predefinedType, ownerHistoryId, localPlacementId, productDefinitionShapeId) {
|
|
12522
12486
|
const id = w.nextId();
|
|
12523
12487
|
w.writeLine({
|
|
@@ -12535,8 +12499,7 @@ function writeRailingEntity(w, guid, name, _predefinedType, ownerHistoryId, loca
|
|
|
12535
12499
|
});
|
|
12536
12500
|
return id;
|
|
12537
12501
|
}
|
|
12538
|
-
|
|
12539
|
-
//#region src/ifc-writer/coveringWriter.ts
|
|
12502
|
+
// src/ifc-writer/coveringWriter.ts
|
|
12540
12503
|
function writeCoveringGeometry(w, spec, geomSubContextId, parentPlacementId) {
|
|
12541
12504
|
const placement3DId = writeAxis2Placement3D(w, spec.origin.map(toIfcLengthM), spec.axisZ, spec.axisX);
|
|
12542
12505
|
const localPlacementId = w.nextId();
|
|
@@ -12648,8 +12611,7 @@ function writeRelCoversBldgElements(w, guid, ownerHistoryId, relatingBuildingEle
|
|
|
12648
12611
|
});
|
|
12649
12612
|
return id;
|
|
12650
12613
|
}
|
|
12651
|
-
|
|
12652
|
-
//#region src/ifc-writer/assemblyWriter.ts
|
|
12614
|
+
// src/ifc-writer/assemblyWriter.ts
|
|
12653
12615
|
/**
|
|
12654
12616
|
* Emits an IfcElementAssembly grouping container. The assembly itself carries no
|
|
12655
12617
|
* own geometry by default — parts contribute geometry and are linked via
|
|
@@ -12717,8 +12679,7 @@ function writeRelNests(w, guid, ownerHistoryId, relatingObjectId, relatedObjectI
|
|
|
12717
12679
|
RelatedObjects: relatedObjectIds.map((id) => w.ref(id))
|
|
12718
12680
|
});
|
|
12719
12681
|
}
|
|
12720
|
-
|
|
12721
|
-
//#region src/ifc-writer/infrastructureWriter.ts
|
|
12682
|
+
// src/ifc-writer/infrastructureWriter.ts
|
|
12722
12683
|
function writeBridge(w, guid, spec, ownerHistoryId, parentPlacementId) {
|
|
12723
12684
|
const placementId = writeSpatialLocalPlacement(w, spec, parentPlacementId);
|
|
12724
12685
|
const entityId = w.nextId();
|
|
@@ -12799,8 +12760,7 @@ function writeEarthworksFillEntity(w, guid, spec, ownerHistoryId, localPlacement
|
|
|
12799
12760
|
});
|
|
12800
12761
|
return entityId;
|
|
12801
12762
|
}
|
|
12802
|
-
|
|
12803
|
-
//#region src/ifc-writer/tessellatedProductWriter.ts
|
|
12763
|
+
// src/ifc-writer/tessellatedProductWriter.ts
|
|
12804
12764
|
/** Write a tessellated body in the coordinate frame supplied by the caller. */
|
|
12805
12765
|
function writeTessellatedProductGeometry(w, solid, geomSubContextId, parentPlacementId) {
|
|
12806
12766
|
const placement3DId = writeAxis2Placement3D(w, [
|
|
@@ -12822,8 +12782,7 @@ function writeTessellatedProductGeometry(w, solid, geomSubContextId, parentPlace
|
|
|
12822
12782
|
tessellation
|
|
12823
12783
|
};
|
|
12824
12784
|
}
|
|
12825
|
-
|
|
12826
|
-
//#region src/ifc-writer/groupWriter.ts
|
|
12785
|
+
// src/ifc-writer/groupWriter.ts
|
|
12827
12786
|
/**
|
|
12828
12787
|
* Emits an IfcZone grouping object. `longName` (a descriptive label such as
|
|
12829
12788
|
* "Top Floor Thermal Zone") maps to the entity Description since IfcZone has no
|
|
@@ -12877,8 +12836,7 @@ function writeRelAssignsToGroup(w, guid, ownerHistoryId, groupExpressId, memberE
|
|
|
12877
12836
|
RelatingGroup: w.ref(groupExpressId)
|
|
12878
12837
|
});
|
|
12879
12838
|
}
|
|
12880
|
-
|
|
12881
|
-
//#region src/ifc-writer/styleWriter.ts
|
|
12839
|
+
// src/ifc-writer/styleWriter.ts
|
|
12882
12840
|
function clamp01(n) {
|
|
12883
12841
|
if (n < 0) return 0;
|
|
12884
12842
|
if (n > 1) return 1;
|
|
@@ -12957,8 +12915,7 @@ function writePresentationLayer(w, layerName, itemIds) {
|
|
|
12957
12915
|
Identifier: null
|
|
12958
12916
|
});
|
|
12959
12917
|
}
|
|
12960
|
-
|
|
12961
|
-
//#region src/ifc-writer/connectivityWriter.ts
|
|
12918
|
+
// src/ifc-writer/connectivityWriter.ts
|
|
12962
12919
|
/**
|
|
12963
12920
|
* Emits an IfcRelConnectsElements recording a physical connection between two
|
|
12964
12921
|
* elements. `description` optionally annotates the connection; geometry of the
|
|
@@ -13005,8 +12962,7 @@ function writeRelConnectsPathElements(w, guid, ownerHistoryId, relatingElementId
|
|
|
13005
12962
|
}
|
|
13006
12963
|
});
|
|
13007
12964
|
}
|
|
13008
|
-
|
|
13009
|
-
//#region src/ifc-writer/materialWriter.ts
|
|
12965
|
+
// src/ifc-writer/materialWriter.ts
|
|
13010
12966
|
var LOGICAL_TRUE = "T";
|
|
13011
12967
|
var LOGICAL_FALSE = "F";
|
|
13012
12968
|
var LOGICAL_UNKNOWN = "U";
|
|
@@ -13117,8 +13073,7 @@ function writeMaterialProfileSet(w, guid, ownerHistoryId, spec, relatedObjectIds
|
|
|
13117
13073
|
function writeMaterialSimple(w, guid, ownerHistoryId, materialName, relatedObjectIds) {
|
|
13118
13074
|
writeRelAssociatesMaterial(w, guid, ownerHistoryId, writeMaterial(w, materialName), relatedObjectIds);
|
|
13119
13075
|
}
|
|
13120
|
-
|
|
13121
|
-
//#region src/ifc-writer/classificationWriter.ts
|
|
13076
|
+
// src/ifc-writer/classificationWriter.ts
|
|
13122
13077
|
/** Stable derivation key for an IfcRelAssociatesClassification, keyed on the ref. */
|
|
13123
13078
|
function makeClassificationRelKey(ref) {
|
|
13124
13079
|
return `rel-class:${ref.system}:${ref.code}`;
|
|
@@ -13180,8 +13135,7 @@ function writeClassificationRefs(w, ownerHistoryId, refs) {
|
|
|
13180
13135
|
});
|
|
13181
13136
|
}
|
|
13182
13137
|
}
|
|
13183
|
-
|
|
13184
|
-
//#region src/psets/psetTemplates.ts
|
|
13138
|
+
// src/psets/psetTemplates.ts
|
|
13185
13139
|
var STATUS_PROPERTY = {
|
|
13186
13140
|
name: "Status",
|
|
13187
13141
|
measureType: "IFCLABEL",
|
|
@@ -13443,8 +13397,7 @@ function webIfcConstantFor(measureType) {
|
|
|
13443
13397
|
function templateFor(category) {
|
|
13444
13398
|
return PSET_TEMPLATES[category];
|
|
13445
13399
|
}
|
|
13446
|
-
|
|
13447
|
-
//#region src/psets/qtoWeights.ts
|
|
13400
|
+
// src/psets/qtoWeights.ts
|
|
13448
13401
|
/**
|
|
13449
13402
|
* Indicative material bulk densities in kg/m³, keyed by lowercase material name.
|
|
13450
13403
|
* These are nominal values for deriving an analytic IfcQuantityWeight from a
|
|
@@ -13502,8 +13455,7 @@ function writeWeightQuantity(w, name, volumeM3, densityKgM3) {
|
|
|
13502
13455
|
});
|
|
13503
13456
|
return id;
|
|
13504
13457
|
}
|
|
13505
|
-
|
|
13506
|
-
//#region src/ifc-writer/psetWriter.ts
|
|
13458
|
+
// src/ifc-writer/psetWriter.ts
|
|
13507
13459
|
/**
|
|
13508
13460
|
* Resolves the IFC measure value for a Pset property by name. Properties listed
|
|
13509
13461
|
* in the Pset measure-type table emit their canonical IFC measure type (e.g.
|
|
@@ -13938,8 +13890,7 @@ function writeCoveringCommonPset(w, ownerHistoryId, coveringExpressId, spec) {
|
|
|
13938
13890
|
if (spec.status !== void 0) values["Status"] = spec.status;
|
|
13939
13891
|
writeCommonPset(w, ownerHistoryId, coveringExpressId, "COVERING", values);
|
|
13940
13892
|
}
|
|
13941
|
-
|
|
13942
|
-
//#region src/ifc-writer/openingWriter.ts
|
|
13893
|
+
// src/ifc-writer/openingWriter.ts
|
|
13943
13894
|
function writeAxis2Placement2D(w) {
|
|
13944
13895
|
const originId = w.nextId();
|
|
13945
13896
|
w.writeLine({
|
|
@@ -14303,8 +14254,7 @@ function writeDoorCommonPset(w, ownerHistoryId, doorEntityId, spec) {
|
|
|
14303
14254
|
function writeWindowCommonPset(w, ownerHistoryId, windowEntityId, spec) {
|
|
14304
14255
|
writeCommonPset(w, ownerHistoryId, windowEntityId, "WINDOW", buildOpeningPsetValues(spec));
|
|
14305
14256
|
}
|
|
14306
|
-
|
|
14307
|
-
//#region src/ifc-writer/proxyWriter.ts
|
|
14257
|
+
// src/ifc-writer/proxyWriter.ts
|
|
14308
14258
|
/**
|
|
14309
14259
|
* Writes the IfcLocalPlacement (at origin, relative to parentPlacementId) and a
|
|
14310
14260
|
* tessellated body (IfcTriangulatedFaceSet) for a proxy's solid. Solid
|
|
@@ -14334,8 +14284,7 @@ function writeProxyEntity(w, guid, name, predefinedType, ownerHistoryId, localPl
|
|
|
14334
14284
|
});
|
|
14335
14285
|
return id;
|
|
14336
14286
|
}
|
|
14337
|
-
|
|
14338
|
-
//#region src/ifc-writer/typeWriter.ts
|
|
14287
|
+
// src/ifc-writer/typeWriter.ts
|
|
14339
14288
|
var TYPE_CONSTANT = {
|
|
14340
14289
|
IFCWALLTYPE: WebIFC.IFCWALLTYPE,
|
|
14341
14290
|
IFCSLABTYPE: WebIFC.IFCSLABTYPE,
|
|
@@ -14449,8 +14398,7 @@ function writeIfcType(w, ownerHistoryId, typeName, typeGuid, relGuid, predefined
|
|
|
14449
14398
|
})
|
|
14450
14399
|
};
|
|
14451
14400
|
}
|
|
14452
|
-
|
|
14453
|
-
//#region src/validation/severity.ts
|
|
14401
|
+
// src/validation/severity.ts
|
|
14454
14402
|
function issue(severity, code, message, entity, context) {
|
|
14455
14403
|
return {
|
|
14456
14404
|
severity,
|
|
@@ -14482,8 +14430,7 @@ function countBySeverity(report) {
|
|
|
14482
14430
|
for (const i of report.issues) counts[i.severity] += 1;
|
|
14483
14431
|
return counts;
|
|
14484
14432
|
}
|
|
14485
|
-
|
|
14486
|
-
//#region src/validation/geometryValidity.ts
|
|
14433
|
+
// src/validation/geometryValidity.ts
|
|
14487
14434
|
/**
|
|
14488
14435
|
* Minimum solid volume (mm³) treated as physically meaningful. Real building
|
|
14489
14436
|
* elements are many orders of magnitude larger; degenerate solids produced by
|
|
@@ -14541,16 +14488,14 @@ function checkOne(solid, entity) {
|
|
|
14541
14488
|
if (volume.value <= MIN_VOLUME_MM3) issues.push(issue("error", "ZERO_VOLUME", `Solid has zero or negligible volume (${volume.value} mm³); it carries no usable geometry`, entity, { volumeMm3: volume.value }));
|
|
14542
14489
|
return issues;
|
|
14543
14490
|
}
|
|
14544
|
-
|
|
14545
|
-
//#region src/types/bimTypes.ts
|
|
14491
|
+
// src/types/bimTypes.ts
|
|
14546
14492
|
function isWallOpening(spec) {
|
|
14547
14493
|
return spec.kind === "WALL_OPENING";
|
|
14548
14494
|
}
|
|
14549
14495
|
function isSlabOpening(spec) {
|
|
14550
14496
|
return spec.kind === "SLAB_OPENING";
|
|
14551
14497
|
}
|
|
14552
|
-
|
|
14553
|
-
//#region src/validation/referentialIntegrity.ts
|
|
14498
|
+
// src/validation/referentialIntegrity.ts
|
|
14554
14499
|
/**
|
|
14555
14500
|
* Physical building elements that must live inside exactly one spatial
|
|
14556
14501
|
* structure (via IfcRelContainedInSpatialStructure / CONTAINED_IN). Spatial
|
|
@@ -14637,8 +14582,7 @@ function checkOpeningExists(issues, elementsById, openingId, code) {
|
|
|
14637
14582
|
}
|
|
14638
14583
|
if (opening.category !== "OPENING") issues.push(issue("error", code === "VOID_OPENING_MISSING" ? "VOID_OPENING_WRONG_CATEGORY" : "FILL_OPENING_WRONG_CATEGORY", `References opening localId ${openingId}, expected OPENING but found ${opening.category}`, openingId, { actual: opening.category }));
|
|
14639
14584
|
}
|
|
14640
|
-
|
|
14641
|
-
//#region src/validation/schemaCheck.ts
|
|
14585
|
+
// src/validation/schemaCheck.ts
|
|
14642
14586
|
/**
|
|
14643
14587
|
* EXPRESS/STEP self-validation gate.
|
|
14644
14588
|
*
|
|
@@ -14716,8 +14660,7 @@ function describeError(e) {
|
|
|
14716
14660
|
if (e instanceof Error) return e.message;
|
|
14717
14661
|
return String(e);
|
|
14718
14662
|
}
|
|
14719
|
-
|
|
14720
|
-
//#region src/validation/roundTrip.ts
|
|
14663
|
+
// src/validation/roundTrip.ts
|
|
14721
14664
|
/**
|
|
14722
14665
|
* Human-readable names of the key entities whose per-type counts are compared
|
|
14723
14666
|
* across a write→read→re-write round-trip. The keys double as `typeCounts` map
|
|
@@ -14825,8 +14768,7 @@ async function checkRoundTrip(bytes) {
|
|
|
14825
14768
|
secondPass
|
|
14826
14769
|
};
|
|
14827
14770
|
}
|
|
14828
|
-
|
|
14829
|
-
//#region src/import/spfReader.ts
|
|
14771
|
+
// src/import/spfReader.ts
|
|
14830
14772
|
var SUPPORTED_SCHEMAS = [
|
|
14831
14773
|
"IFC2X3",
|
|
14832
14774
|
"IFC4",
|
|
@@ -15006,8 +14948,7 @@ var SpfReader = class SpfReader {
|
|
|
15006
14948
|
return typeof decoded === "string" ? decoded : s;
|
|
15007
14949
|
}
|
|
15008
14950
|
};
|
|
15009
|
-
|
|
15010
|
-
//#region src/validation/qtoDefinitions.generated.ts
|
|
14951
|
+
// src/validation/qtoDefinitions.generated.ts
|
|
15011
14952
|
var QTO_DEFINITIONS = {
|
|
15012
14953
|
"Qto_ActuatorBaseQuantities": {
|
|
15013
14954
|
"entities": ["IFCACTUATOR"],
|
|
@@ -15628,8 +15569,7 @@ var QTO_DEFINITIONS = {
|
|
|
15628
15569
|
}
|
|
15629
15570
|
}
|
|
15630
15571
|
};
|
|
15631
|
-
|
|
15632
|
-
//#region src/validation/gherkinChecks.ts
|
|
15572
|
+
// src/validation/gherkinChecks.ts
|
|
15633
15573
|
/**
|
|
15634
15574
|
* Local implementations of the buildingSMART Validation Service's gherkin
|
|
15635
15575
|
* normative rules that apply to the entity vocabulary this writer emits:
|
|
@@ -15775,8 +15715,7 @@ function checkGeoreferencing(reader) {
|
|
|
15775
15715
|
if (reader.getLinesOfType(WebIFC.IFCPROJECTEDCRS).length > 0 || reader.getLinesOfType(WebIFC.IFCGEOGRAPHICCRS).length > 0) return [];
|
|
15776
15716
|
return [issue("warning", "NO_GEOREFERENCING", "Model contains a facility but no IfcProjectedCRS/IfcGeographicCRS (GRF003) — set ProjectSpec.crs")];
|
|
15777
15717
|
}
|
|
15778
|
-
|
|
15779
|
-
//#region src/serialize/productBodyPreflight.ts
|
|
15718
|
+
// src/serialize/productBodyPreflight.ts
|
|
15780
15719
|
var testItemPreparer = null;
|
|
15781
15720
|
/** Prepares every retained Body item without writing IFC lines. Source solids remain borrowed. */
|
|
15782
15721
|
function preflightProductBody(input) {
|
|
@@ -15804,8 +15743,7 @@ function preflightProductBody(input) {
|
|
|
15804
15743
|
}
|
|
15805
15744
|
return ok([first.value, ...remainingPrepared]);
|
|
15806
15745
|
}
|
|
15807
|
-
|
|
15808
|
-
//#region src/serialize/wallQuantities.ts
|
|
15746
|
+
// src/serialize/wallQuantities.ts
|
|
15809
15747
|
function deriveWallQuantities(input) {
|
|
15810
15748
|
try {
|
|
15811
15749
|
const measured = measureProductBodyMaterial(input.solids);
|
|
@@ -15823,8 +15761,7 @@ function deriveWallQuantities(input) {
|
|
|
15823
15761
|
function wallVolumeError(cause) {
|
|
15824
15762
|
return err(ifcError("IFC_WALL_QUANTITY_DERIVATION_FAILED", "Failed to derive a positive finite NetVolume for the retained Wall Body", cause));
|
|
15825
15763
|
}
|
|
15826
|
-
|
|
15827
|
-
//#region src/serialize/toIfc.ts
|
|
15764
|
+
// src/serialize/toIfc.ts
|
|
15828
15765
|
function preflightProductBodies(elements) {
|
|
15829
15766
|
const preflighted = [];
|
|
15830
15767
|
for (const element of elements) {
|
|
@@ -16542,8 +16479,7 @@ function findContainerOf(elementId, relationships) {
|
|
|
16542
16479
|
for (const rel of relationships) if (rel.kind === "CONTAINED_IN" && rel.relatedElements.includes(elementId)) return rel.relatingStructure;
|
|
16543
16480
|
return null;
|
|
16544
16481
|
}
|
|
16545
|
-
|
|
16546
|
-
//#region src/import/placement.ts
|
|
16482
|
+
// src/import/placement.ts
|
|
16547
16483
|
/**
|
|
16548
16484
|
* Metres-per-file-unit length scale read from the IfcUnitAssignment's
|
|
16549
16485
|
* LENGTHUNIT. Multiply a file-unit length by this to get metres, then by 1000
|
|
@@ -16798,8 +16734,7 @@ function enumValue(v) {
|
|
|
16798
16734
|
const value = v.value;
|
|
16799
16735
|
return typeof value === "string" ? value : null;
|
|
16800
16736
|
}
|
|
16801
|
-
|
|
16802
|
-
//#region src/import/spatialTree.ts
|
|
16737
|
+
// src/import/spatialTree.ts
|
|
16803
16738
|
var CATEGORY_BY_TYPE = /* @__PURE__ */ new Map([
|
|
16804
16739
|
[WebIFC.IFCPROJECT, "PROJECT"],
|
|
16805
16740
|
[WebIFC.IFCSITE, "SITE"],
|
|
@@ -16916,8 +16851,7 @@ function buildElementContainmentMap(reader) {
|
|
|
16916
16851
|
for (const [structure, elements] of buildContainmentIndex(reader)) for (const elementId of elements) map.set(elementId, structure);
|
|
16917
16852
|
return map;
|
|
16918
16853
|
}
|
|
16919
|
-
|
|
16920
|
-
//#region src/import/geometryRead.ts
|
|
16854
|
+
// src/import/geometryRead.ts
|
|
16921
16855
|
var NONE = { kind: "NONE" };
|
|
16922
16856
|
var testHooks$2 = null;
|
|
16923
16857
|
/**
|
|
@@ -17768,8 +17702,7 @@ function isStreamedTessellatedType(type) {
|
|
|
17768
17702
|
function errMsg$1(e) {
|
|
17769
17703
|
return e instanceof Error ? e.message : String(e);
|
|
17770
17704
|
}
|
|
17771
|
-
|
|
17772
|
-
//#region src/import/cutImportedSolids.ts
|
|
17705
|
+
// src/import/cutImportedSolids.ts
|
|
17773
17706
|
/** Borrow World-placed inputs; own every disconnected result independently of the cut's cache. */
|
|
17774
17707
|
function cutImportedSolids(host, opening) {
|
|
17775
17708
|
const context = { operation: "cutImportedSolids" };
|
|
@@ -17828,8 +17761,7 @@ function cutImportedSolids(host, opening) {
|
|
|
17828
17761
|
}
|
|
17829
17762
|
});
|
|
17830
17763
|
}
|
|
17831
|
-
|
|
17832
|
-
//#region src/import/dataRead.ts
|
|
17764
|
+
// src/import/dataRead.ts
|
|
17833
17765
|
/** Narrows an unknown line attribute to the `{ type, value }` wrapper shape. */
|
|
17834
17766
|
function asTyped(v) {
|
|
17835
17767
|
return typeof v === "object" && v !== null ? v : null;
|
|
@@ -18140,8 +18072,7 @@ function readOwnerHistory(reader, ownerHistoryExpressId) {
|
|
|
18140
18072
|
creationDate
|
|
18141
18073
|
} : { applicationName };
|
|
18142
18074
|
}
|
|
18143
|
-
|
|
18144
|
-
//#region src/import/fromIfc.ts
|
|
18075
|
+
// src/import/fromIfc.ts
|
|
18145
18076
|
var testHooks$1 = null;
|
|
18146
18077
|
/**
|
|
18147
18078
|
* Each enumerated physical-element IFC type and the {@link ImportedElementCategory}
|
|
@@ -18535,8 +18466,7 @@ function refValue(v) {
|
|
|
18535
18466
|
function errMsg(e) {
|
|
18536
18467
|
return e instanceof Error ? e.message : String(e);
|
|
18537
18468
|
}
|
|
18538
|
-
|
|
18539
|
-
//#region src/import/importedModel.ts
|
|
18469
|
+
// src/import/importedModel.ts
|
|
18540
18470
|
/**
|
|
18541
18471
|
* Frees every reconstructed solid handle held by an imported model. The
|
|
18542
18472
|
* geometry are live WASM handles, so callers MUST call this once they are done
|
|
@@ -18545,8 +18475,7 @@ function errMsg(e) {
|
|
|
18545
18475
|
function disposeImportedModel(model) {
|
|
18546
18476
|
for (const el of model.elements) for (const solid of el.geometry.solids) solid[Symbol.dispose]();
|
|
18547
18477
|
}
|
|
18548
|
-
|
|
18549
|
-
//#region src/specs/materialSpec.ts
|
|
18478
|
+
// src/specs/materialSpec.ts
|
|
18550
18479
|
/**
|
|
18551
18480
|
* Shared Zod schemas for the optional material-layer and classification fields
|
|
18552
18481
|
* that element specs (wall/slab/beam/column) accept. Centralised here so every
|
|
@@ -18565,8 +18494,7 @@ var ClassificationRefSchema = object({
|
|
|
18565
18494
|
code: string().min(1),
|
|
18566
18495
|
description: string().optional()
|
|
18567
18496
|
});
|
|
18568
|
-
|
|
18569
|
-
//#region src/specs/wallSpec.ts
|
|
18497
|
+
// src/specs/wallSpec.ts
|
|
18570
18498
|
var unitVec$11 = tuple([
|
|
18571
18499
|
number(),
|
|
18572
18500
|
number(),
|
|
@@ -18614,8 +18542,7 @@ function parseWallSpec(input) {
|
|
|
18614
18542
|
if (!result.success) return err(specError("INVALID_WALL_SPEC", result.error.message, result.error));
|
|
18615
18543
|
return ok(result.data);
|
|
18616
18544
|
}
|
|
18617
|
-
|
|
18618
|
-
//#region src/specs/slabSpec.ts
|
|
18545
|
+
// src/specs/slabSpec.ts
|
|
18619
18546
|
var unitVec$10 = tuple([
|
|
18620
18547
|
number(),
|
|
18621
18548
|
number(),
|
|
@@ -18671,8 +18598,7 @@ function parseSlabSpec(input) {
|
|
|
18671
18598
|
if (!result.success) return err(specError("INVALID_SLAB_SPEC", result.error.message, result.error));
|
|
18672
18599
|
return ok(result.data);
|
|
18673
18600
|
}
|
|
18674
|
-
|
|
18675
|
-
//#region src/specs/beamSpec.ts
|
|
18601
|
+
// src/specs/beamSpec.ts
|
|
18676
18602
|
var unitVec$9 = tuple([
|
|
18677
18603
|
number(),
|
|
18678
18604
|
number(),
|
|
@@ -18732,8 +18658,7 @@ function parseBeamSpec(input) {
|
|
|
18732
18658
|
if (!profileCheck.ok) return err(profileCheck.error);
|
|
18733
18659
|
return ok(result.data);
|
|
18734
18660
|
}
|
|
18735
|
-
|
|
18736
|
-
//#region src/specs/columnSpec.ts
|
|
18661
|
+
// src/specs/columnSpec.ts
|
|
18737
18662
|
var unitVec$8 = tuple([
|
|
18738
18663
|
number(),
|
|
18739
18664
|
number(),
|
|
@@ -18787,8 +18712,7 @@ function parseColumnSpec(input) {
|
|
|
18787
18712
|
if (!profileCheck.ok) return err(profileCheck.error);
|
|
18788
18713
|
return ok(result.data);
|
|
18789
18714
|
}
|
|
18790
|
-
|
|
18791
|
-
//#region src/specs/spaceSpec.ts
|
|
18715
|
+
// src/specs/spaceSpec.ts
|
|
18792
18716
|
var unitVec$7 = tuple([
|
|
18793
18717
|
number(),
|
|
18794
18718
|
number(),
|
|
@@ -18839,8 +18763,7 @@ function parseSpaceSpec(input) {
|
|
|
18839
18763
|
if (!result.success) return err(specError("INVALID_SPACE_SPEC", result.error.message, result.error));
|
|
18840
18764
|
return ok(result.data);
|
|
18841
18765
|
}
|
|
18842
|
-
|
|
18843
|
-
//#region src/specs/roofSpec.ts
|
|
18766
|
+
// src/specs/roofSpec.ts
|
|
18844
18767
|
var ROOF_PREDEFINED_TYPES = [
|
|
18845
18768
|
"FLAT_ROOF",
|
|
18846
18769
|
"SHED_ROOF",
|
|
@@ -18904,8 +18827,7 @@ function parseRoofSpec(input) {
|
|
|
18904
18827
|
if (!result.success) return err(specError("INVALID_ROOF_SPEC", result.error.message, result.error));
|
|
18905
18828
|
return ok(result.data);
|
|
18906
18829
|
}
|
|
18907
|
-
|
|
18908
|
-
//#region src/specs/curtainWallSpec.ts
|
|
18830
|
+
// src/specs/curtainWallSpec.ts
|
|
18909
18831
|
var unitVec$5 = tuple([
|
|
18910
18832
|
number(),
|
|
18911
18833
|
number(),
|
|
@@ -18965,8 +18887,7 @@ function parseCurtainWallSpec(input) {
|
|
|
18965
18887
|
if (!result.success) return err(specError("INVALID_CURTAIN_WALL_SPEC", result.error.message, result.error));
|
|
18966
18888
|
return ok(result.data);
|
|
18967
18889
|
}
|
|
18968
|
-
|
|
18969
|
-
//#region src/specs/foundationSpec.ts
|
|
18890
|
+
// src/specs/foundationSpec.ts
|
|
18970
18891
|
var unitVec$4 = tuple([
|
|
18971
18892
|
number(),
|
|
18972
18893
|
number(),
|
|
@@ -19056,8 +18977,7 @@ function parsePileSpec(input) {
|
|
|
19056
18977
|
if (!profileCheck.ok) return err(profileCheck.error);
|
|
19057
18978
|
return ok(result.data);
|
|
19058
18979
|
}
|
|
19059
|
-
|
|
19060
|
-
//#region src/specs/stairSpec.ts
|
|
18980
|
+
// src/specs/stairSpec.ts
|
|
19061
18981
|
var unitVec$3 = tuple([
|
|
19062
18982
|
number(),
|
|
19063
18983
|
number(),
|
|
@@ -19121,8 +19041,7 @@ function parseStairSpec(input) {
|
|
|
19121
19041
|
if (!result.success) return err(specError("INVALID_STAIR_SPEC", result.error.message, result.error));
|
|
19122
19042
|
return ok(result.data);
|
|
19123
19043
|
}
|
|
19124
|
-
|
|
19125
|
-
//#region src/specs/rampSpec.ts
|
|
19044
|
+
// src/specs/rampSpec.ts
|
|
19126
19045
|
var unitVec$2 = tuple([
|
|
19127
19046
|
number(),
|
|
19128
19047
|
number(),
|
|
@@ -19183,8 +19102,7 @@ function parseRampSpec(input) {
|
|
|
19183
19102
|
if (!result.success) return err(specError("INVALID_RAMP_SPEC", result.error.message, result.error));
|
|
19184
19103
|
return ok(result.data);
|
|
19185
19104
|
}
|
|
19186
|
-
|
|
19187
|
-
//#region src/specs/railingSpec.ts
|
|
19105
|
+
// src/specs/railingSpec.ts
|
|
19188
19106
|
var unitVec$1 = tuple([
|
|
19189
19107
|
number(),
|
|
19190
19108
|
number(),
|
|
@@ -19236,8 +19154,7 @@ function parseRailingSpec(input) {
|
|
|
19236
19154
|
if (!result.success) return err(specError("INVALID_RAILING_SPEC", result.error.message, result.error));
|
|
19237
19155
|
return ok(result.data);
|
|
19238
19156
|
}
|
|
19239
|
-
|
|
19240
|
-
//#region src/specs/coveringSpec.ts
|
|
19157
|
+
// src/specs/coveringSpec.ts
|
|
19241
19158
|
var unitVec = tuple([
|
|
19242
19159
|
number(),
|
|
19243
19160
|
number(),
|
|
@@ -19296,8 +19213,7 @@ function parseCoveringSpec(input) {
|
|
|
19296
19213
|
if (!result.success) return err(specError("INVALID_COVERING_SPEC", result.error.message, result.error));
|
|
19297
19214
|
return ok(result.data);
|
|
19298
19215
|
}
|
|
19299
|
-
|
|
19300
|
-
//#region src/specs/assemblySpec.ts
|
|
19216
|
+
// src/specs/assemblySpec.ts
|
|
19301
19217
|
var ElementAssemblySpecSchema = object({
|
|
19302
19218
|
name: string().optional(),
|
|
19303
19219
|
predefinedType: _enum([
|
|
@@ -19324,8 +19240,7 @@ function parseElementAssemblySpec(input) {
|
|
|
19324
19240
|
if (!result.success) return err(specError("INVALID_ASSEMBLY_SPEC", result.error.message, result.error));
|
|
19325
19241
|
return ok(result.data);
|
|
19326
19242
|
}
|
|
19327
|
-
|
|
19328
|
-
//#region src/specs/groupSpec.ts
|
|
19243
|
+
// src/specs/groupSpec.ts
|
|
19329
19244
|
var ZoneSpecSchema = object({
|
|
19330
19245
|
name: string().min(1),
|
|
19331
19246
|
longName: string().optional(),
|
|
@@ -19348,8 +19263,7 @@ function parseSystemSpec(input) {
|
|
|
19348
19263
|
if (!result.success) return err(specError("INVALID_SYSTEM_SPEC", result.error.message, result.error));
|
|
19349
19264
|
return ok(result.data);
|
|
19350
19265
|
}
|
|
19351
|
-
|
|
19352
|
-
//#region src/specs/styleSpec.ts
|
|
19266
|
+
// src/specs/styleSpec.ts
|
|
19353
19267
|
var SurfaceStyleSpecSchema = object({
|
|
19354
19268
|
name: string().min(1),
|
|
19355
19269
|
r: number().min(0).max(1),
|
|
@@ -19362,8 +19276,7 @@ function parseSurfaceStyleSpec(input) {
|
|
|
19362
19276
|
if (!result.success) return err(specError("INVALID_STYLE_SPEC", result.error.message, result.error));
|
|
19363
19277
|
return ok(result.data);
|
|
19364
19278
|
}
|
|
19365
|
-
|
|
19366
|
-
//#region src/specs/openingSpec.ts
|
|
19279
|
+
// src/specs/openingSpec.ts
|
|
19367
19280
|
var baseOpeningSchema = object({
|
|
19368
19281
|
width: number().positive(),
|
|
19369
19282
|
height: number().positive(),
|
|
@@ -19399,8 +19312,7 @@ function parseSlabOpeningInput(input) {
|
|
|
19399
19312
|
if (!result.success) return err(specError("INVALID_SLAB_OPENING_INPUT", result.error.message, result.error));
|
|
19400
19313
|
return ok(result.data);
|
|
19401
19314
|
}
|
|
19402
|
-
|
|
19403
|
-
//#region src/specs/spatialSpec.ts
|
|
19315
|
+
// src/specs/spatialSpec.ts
|
|
19404
19316
|
var unitVector = tuple([
|
|
19405
19317
|
number(),
|
|
19406
19318
|
number(),
|
|
@@ -19447,8 +19359,7 @@ function parseSiteSpec(input) {
|
|
|
19447
19359
|
const result = SiteSpecSchema.safeParse(input);
|
|
19448
19360
|
return result.success ? ok(result.data) : err(specError("INVALID_SITE_SPEC", result.error.message, result.error));
|
|
19449
19361
|
}
|
|
19450
|
-
|
|
19451
|
-
//#region src/specs/infrastructureSpec.ts
|
|
19362
|
+
// src/specs/infrastructureSpec.ts
|
|
19452
19363
|
var composition = _enum([
|
|
19453
19364
|
"COMPLEX",
|
|
19454
19365
|
"ELEMENT",
|
|
@@ -19508,8 +19419,7 @@ function parseBridgePartSpec(input) {
|
|
|
19508
19419
|
const result = BridgePartSpecSchema.safeParse(input);
|
|
19509
19420
|
return result.success ? ok(result.data) : err(specError("INVALID_BRIDGE_PART_SPEC", result.error.message, result.error));
|
|
19510
19421
|
}
|
|
19511
|
-
|
|
19512
|
-
//#region src/cobie/cobieExport.ts
|
|
19422
|
+
// src/cobie/cobieExport.ts
|
|
19513
19423
|
/**
|
|
19514
19424
|
* Physical-element categories that become COBie Component rows. Spatial
|
|
19515
19425
|
* containers (PROJECT/SITE/BUILDING/STOREY), abstract groupings, and the SPACE
|
|
@@ -19939,8 +19849,7 @@ function serializeCobieToJson(model) {
|
|
|
19939
19849
|
Attribute: model.attribute
|
|
19940
19850
|
};
|
|
19941
19851
|
}
|
|
19942
|
-
|
|
19943
|
-
//#region src/ids/idsXml.ts
|
|
19852
|
+
// src/ids/idsXml.ts
|
|
19944
19853
|
var XmlParseError = class extends Error {};
|
|
19945
19854
|
function parseXml$1(input) {
|
|
19946
19855
|
return new Parser(input).parseDocument();
|
|
@@ -20111,8 +20020,7 @@ function childrenNamed(el, tag) {
|
|
|
20111
20020
|
function firstChild(el, tag) {
|
|
20112
20021
|
return el.children.find((c) => c.tag === tag);
|
|
20113
20022
|
}
|
|
20114
|
-
|
|
20115
|
-
//#region src/ids/idsSchema.generated.ts
|
|
20023
|
+
// src/ids/idsSchema.generated.ts
|
|
20116
20024
|
var IFC_ENTITY_ATTRIBUTES = {
|
|
20117
20025
|
"IFC2DCOMPOSITECURVE": {
|
|
20118
20026
|
"Segments": "L1",
|
|
@@ -29644,8 +29552,7 @@ var IFC_ENTITY_ATTRIBUTES = {
|
|
|
29644
29552
|
"WebThickness": "d"
|
|
29645
29553
|
}
|
|
29646
29554
|
};
|
|
29647
|
-
|
|
29648
|
-
//#region src/ids/idsParser.ts
|
|
29555
|
+
// src/ids/idsParser.ts
|
|
29649
29556
|
/**
|
|
29650
29557
|
* Parses an IDS 1.0 XML document string into a typed {@link IdsDocument}.
|
|
29651
29558
|
*
|
|
@@ -29990,8 +29897,7 @@ function parseValue(container) {
|
|
|
29990
29897
|
maxLength: num("maxLength")
|
|
29991
29898
|
};
|
|
29992
29899
|
}
|
|
29993
|
-
|
|
29994
|
-
//#region src/ids/idsEngine.ts
|
|
29900
|
+
// src/ids/idsEngine.ts
|
|
29995
29901
|
/** Relative + fixed equality tolerance for floating point values (IDS spec). */
|
|
29996
29902
|
var EPS = 1e-6;
|
|
29997
29903
|
/** All relationship-derived context, built once per check. */
|
|
@@ -30763,8 +30669,7 @@ async function checkIdsData(bytes, ids) {
|
|
|
30763
30669
|
reader.close();
|
|
30764
30670
|
}
|
|
30765
30671
|
}
|
|
30766
|
-
|
|
30767
|
-
//#region src/bcf/bcfXml.ts
|
|
30672
|
+
// src/bcf/bcfXml.ts
|
|
30768
30673
|
/**
|
|
30769
30674
|
* Minimal, zero-dependency XML helpers scoped to the BCF 3.0 subset.
|
|
30770
30675
|
*
|
|
@@ -30914,8 +30819,7 @@ function findChildren(node, tag) {
|
|
|
30914
30819
|
function childText(node, tag) {
|
|
30915
30820
|
return findChild(node, tag)?.text;
|
|
30916
30821
|
}
|
|
30917
|
-
|
|
30918
|
-
//#region src/bcf/bcfWrite.ts
|
|
30822
|
+
// src/bcf/bcfWrite.ts
|
|
30919
30823
|
/**
|
|
30920
30824
|
* Serialize a BCF 3.0 container into its unzipped file structure
|
|
30921
30825
|
* (`Map<path, xml-string>`):
|
|
@@ -30923,6 +30827,7 @@ function childText(node, tag) {
|
|
|
30923
30827
|
* - `bcf.version` — container version marker
|
|
30924
30828
|
* - `project.bcfp` — project metadata
|
|
30925
30829
|
* - `{topicGuid}/markup.bcf` — one markup file per topic (topic, comments, viewpoints)
|
|
30830
|
+
* - `{topicGuid}/{viewpoint}.bcfv`: one visualization file per viewpoint (components, camera)
|
|
30926
30831
|
*
|
|
30927
30832
|
* `FLAG: BCF_ZIP_PACKAGING_ABSENT` — to produce an actual `.bcfzip`, ZIP these
|
|
30928
30833
|
* entries with an external library; no ZIP dependency is declared in the
|
|
@@ -30934,13 +30839,15 @@ function serializeBcfFiles(data) {
|
|
|
30934
30839
|
files.set("project.bcfp", writeProject(data));
|
|
30935
30840
|
for (const topic of data.topics) {
|
|
30936
30841
|
files.set(`${topic.guid}/markup.bcf`, writeMarkup(topic));
|
|
30937
|
-
for (const viewpoint of topic.viewpoints) if (viewpoint
|
|
30842
|
+
for (const viewpoint of topic.viewpoints) if (hasVisualization(viewpoint)) files.set(`${topic.guid}/${bcfvName(viewpoint)}`, writeVisualizationInfo(viewpoint));
|
|
30938
30843
|
}
|
|
30939
30844
|
return files;
|
|
30940
30845
|
}
|
|
30941
30846
|
function writeVersion(data) {
|
|
30942
|
-
const
|
|
30943
|
-
if (data.version.detailedVersion
|
|
30847
|
+
const open = `<Version VersionId="${escapeXmlAttr(data.version.versionId)}"`;
|
|
30848
|
+
if (data.version.detailedVersion === void 0) return xmlDocument(`${open} />`);
|
|
30849
|
+
const lines = [`${open}>`];
|
|
30850
|
+
lines.push(` <DetailedVersion>${escapeXmlText(data.version.detailedVersion)}</DetailedVersion>`);
|
|
30944
30851
|
lines.push("</Version>");
|
|
30945
30852
|
return xmlDocument(lines.join("\n"));
|
|
30946
30853
|
}
|
|
@@ -30956,8 +30863,6 @@ function writeProject(data) {
|
|
|
30956
30863
|
function writeMarkup(topic) {
|
|
30957
30864
|
const lines = ["<Markup>"];
|
|
30958
30865
|
lines.push(...writeTopic(topic).map(indent(1)));
|
|
30959
|
-
for (const comment of topic.comments) lines.push(...writeComment(comment).map(indent(1)));
|
|
30960
|
-
for (const viewpoint of topic.viewpoints) lines.push(...writeViewpoint(viewpoint).map(indent(1)));
|
|
30961
30866
|
lines.push("</Markup>");
|
|
30962
30867
|
return xmlDocument(lines.join("\n"));
|
|
30963
30868
|
}
|
|
@@ -30970,7 +30875,7 @@ function writeTopic(topic) {
|
|
|
30970
30875
|
inner.push(`<Title>${escapeXmlText(topic.title)}</Title>`);
|
|
30971
30876
|
pushOptional(inner, "Priority", topic.priority);
|
|
30972
30877
|
pushOptionalNum(inner, "Index", topic.index);
|
|
30973
|
-
|
|
30878
|
+
pushList(inner, "Labels", (topic.labels ?? []).map((label) => [`<Label>${escapeXmlText(label)}</Label>`]));
|
|
30974
30879
|
pushOptional(inner, "CreationDate", topic.creationDate);
|
|
30975
30880
|
pushOptional(inner, "CreationAuthor", topic.creationAuthor);
|
|
30976
30881
|
pushOptional(inner, "ModifiedDate", topic.modifiedDate);
|
|
@@ -30978,7 +30883,9 @@ function writeTopic(topic) {
|
|
|
30978
30883
|
pushOptional(inner, "DueDate", topic.dueDate);
|
|
30979
30884
|
pushOptional(inner, "AssignedTo", topic.assignedTo);
|
|
30980
30885
|
pushOptional(inner, "Description", topic.description);
|
|
30981
|
-
|
|
30886
|
+
pushList(inner, "RelatedTopics", (topic.relatedTopics ?? []).map((related) => [`<RelatedTopic Guid="${escapeXmlAttr(related)}" />`]));
|
|
30887
|
+
pushList(inner, "Comments", topic.comments.map(writeComment));
|
|
30888
|
+
pushList(inner, "Viewpoints", topic.viewpoints.map(writeViewpoint));
|
|
30982
30889
|
lines.push(...inner.map(indent(1)));
|
|
30983
30890
|
lines.push("</Topic>");
|
|
30984
30891
|
return lines;
|
|
@@ -30989,34 +30896,63 @@ function writeComment(comment) {
|
|
|
30989
30896
|
inner.push(`<Date>${escapeXmlText(comment.date)}</Date>`);
|
|
30990
30897
|
inner.push(`<Author>${escapeXmlText(comment.author)}</Author>`);
|
|
30991
30898
|
inner.push(`<Comment>${escapeXmlText(comment.comment)}</Comment>`);
|
|
30899
|
+
if (comment.viewpointRef !== void 0) inner.push(`<Viewpoint Guid="${escapeXmlAttr(comment.viewpointRef)}" />`);
|
|
30992
30900
|
pushOptional(inner, "ModifiedDate", comment.modifiedDate);
|
|
30993
30901
|
pushOptional(inner, "ModifiedAuthor", comment.modifiedAuthor);
|
|
30994
|
-
if (comment.viewpointRef !== void 0) inner.push(`<Viewpoint Guid="${escapeXmlAttr(comment.viewpointRef)}" />`);
|
|
30995
30902
|
lines.push(...inner.map(indent(1)));
|
|
30996
30903
|
lines.push("</Comment>");
|
|
30997
30904
|
return lines;
|
|
30998
30905
|
}
|
|
30999
30906
|
function writeViewpoint(viewpoint) {
|
|
31000
|
-
const lines = [`<
|
|
30907
|
+
const lines = [`<ViewPoint Guid="${escapeXmlAttr(viewpoint.guid)}">`];
|
|
31001
30908
|
const inner = [];
|
|
31002
|
-
if (viewpoint
|
|
30909
|
+
if (hasVisualization(viewpoint)) inner.push(`<Viewpoint>${escapeXmlText(bcfvName(viewpoint))}</Viewpoint>`);
|
|
31003
30910
|
pushOptional(inner, "Snapshot", viewpoint.snapshotFile);
|
|
31004
30911
|
pushOptionalNum(inner, "Index", viewpoint.index);
|
|
31005
30912
|
lines.push(...inner.map(indent(1)));
|
|
31006
|
-
lines.push("</
|
|
30913
|
+
lines.push("</ViewPoint>");
|
|
31007
30914
|
return lines;
|
|
31008
30915
|
}
|
|
30916
|
+
function hasVisualization(viewpoint) {
|
|
30917
|
+
return viewpoint.components !== void 0 || viewpoint.camera !== void 0 || viewpoint.viewpointFile !== void 0;
|
|
30918
|
+
}
|
|
31009
30919
|
/** The .bcfv filename a viewpoint's Components are written to / referenced by. */
|
|
31010
30920
|
function bcfvName(viewpoint) {
|
|
31011
30921
|
return viewpoint.viewpointFile ?? `${viewpoint.guid}.bcfv`;
|
|
31012
30922
|
}
|
|
31013
|
-
/** Serializes a viewpoint's Components into a standalone BCF 3.0 .bcfv document. */
|
|
30923
|
+
/** Serializes a viewpoint's Components and camera into a standalone BCF 3.0 .bcfv document. */
|
|
31014
30924
|
function writeVisualizationInfo(viewpoint) {
|
|
31015
30925
|
const lines = [`<VisualizationInfo Guid="${escapeXmlAttr(viewpoint.guid)}">`];
|
|
31016
30926
|
if (viewpoint.components !== void 0) lines.push(...writeComponents(viewpoint.components).map(indent(1)));
|
|
30927
|
+
if (viewpoint.camera !== void 0) lines.push(...writeCamera(viewpoint.camera).map(indent(1)));
|
|
31017
30928
|
lines.push("</VisualizationInfo>");
|
|
31018
30929
|
return xmlDocument(lines.join("\n"));
|
|
31019
30930
|
}
|
|
30931
|
+
function writeCamera(camera) {
|
|
30932
|
+
const tag = camera.kind === "ORTHOGONAL" ? "OrthogonalCamera" : "PerspectiveCamera";
|
|
30933
|
+
const inner = [
|
|
30934
|
+
...writeVector("CameraViewPoint", camera.viewPoint),
|
|
30935
|
+
...writeVector("CameraDirection", camera.direction),
|
|
30936
|
+
...writeVector("CameraUpVector", camera.upVector)
|
|
30937
|
+
];
|
|
30938
|
+
if (camera.kind === "ORTHOGONAL") inner.push(`<ViewToWorldScale>${camera.viewToWorldScale}</ViewToWorldScale>`);
|
|
30939
|
+
else inner.push(`<FieldOfView>${camera.fieldOfView}</FieldOfView>`);
|
|
30940
|
+
inner.push(`<AspectRatio>${camera.aspectRatio}</AspectRatio>`);
|
|
30941
|
+
return [
|
|
30942
|
+
`<${tag}>`,
|
|
30943
|
+
...inner.map(indent(1)),
|
|
30944
|
+
`</${tag}>`
|
|
30945
|
+
];
|
|
30946
|
+
}
|
|
30947
|
+
function writeVector(tag, [x, y, z]) {
|
|
30948
|
+
return [
|
|
30949
|
+
`<${tag}>`,
|
|
30950
|
+
` <X>${x}</X>`,
|
|
30951
|
+
` <Y>${y}</Y>`,
|
|
30952
|
+
` <Z>${z}</Z>`,
|
|
30953
|
+
`</${tag}>`
|
|
30954
|
+
];
|
|
30955
|
+
}
|
|
31020
30956
|
function writeComponents(components) {
|
|
31021
30957
|
const lines = ["<Components>"];
|
|
31022
30958
|
const inner = [];
|
|
@@ -31048,7 +30984,10 @@ function writeVisibility(visibility) {
|
|
|
31048
30984
|
}
|
|
31049
30985
|
function writeColoring(coloring) {
|
|
31050
30986
|
const lines = [`<Color Color="${escapeXmlAttr(coloring.color)}">`];
|
|
31051
|
-
|
|
30987
|
+
const inner = ["<Components>"];
|
|
30988
|
+
for (const c of coloring.components) inner.push(...writeComponent(c).map(indent(1)));
|
|
30989
|
+
inner.push("</Components>");
|
|
30990
|
+
lines.push(...inner.map(indent(1)));
|
|
31052
30991
|
lines.push("</Color>");
|
|
31053
30992
|
return lines;
|
|
31054
30993
|
}
|
|
@@ -31070,12 +31009,18 @@ function pushOptional(target, tag, value) {
|
|
|
31070
31009
|
function pushOptionalNum(target, tag, value) {
|
|
31071
31010
|
if (value !== void 0) target.push(`<${tag}>${value}</${tag}>`);
|
|
31072
31011
|
}
|
|
31012
|
+
/** A wrapper element around `items`, each already written as lines; nothing when empty. */
|
|
31013
|
+
function pushList(target, tag, items) {
|
|
31014
|
+
if (items.length === 0) return;
|
|
31015
|
+
target.push(`<${tag}>`);
|
|
31016
|
+
for (const item of items) target.push(...item.map(indent(1)));
|
|
31017
|
+
target.push(`</${tag}>`);
|
|
31018
|
+
}
|
|
31073
31019
|
function indent(levels) {
|
|
31074
31020
|
const pad = " ".repeat(levels);
|
|
31075
31021
|
return (line) => `${pad}${line}`;
|
|
31076
31022
|
}
|
|
31077
|
-
|
|
31078
|
-
//#region src/bcf/bcfRead.ts
|
|
31023
|
+
// src/bcf/bcfRead.ts
|
|
31079
31024
|
/**
|
|
31080
31025
|
* Parse an unzipped BCF 3.0 container (`Map<path, xml-string>`) back into the
|
|
31081
31026
|
* typed data model. The inverse of `serializeBcfFiles`.
|
|
@@ -31132,8 +31077,10 @@ function parseMarkup(xml, files, dir) {
|
|
|
31132
31077
|
const markup = parseXml(xml);
|
|
31133
31078
|
const topicEl = findChild(markup, "Topic");
|
|
31134
31079
|
if (topicEl === void 0) throw new Error("markup.bcf is missing a <Topic> element");
|
|
31135
|
-
const
|
|
31136
|
-
const
|
|
31080
|
+
const commentsEl = findChild(topicEl, "Comments");
|
|
31081
|
+
const viewpointsEl = findChild(topicEl, "Viewpoints");
|
|
31082
|
+
const comments = (commentsEl !== void 0 ? findChildren(commentsEl, "Comment") : findChildren(markup, "Comment")).map(parseComment);
|
|
31083
|
+
const viewpoints = (viewpointsEl !== void 0 ? findChildren(viewpointsEl, "ViewPoint") : findChildren(markup, "Viewpoints")).map((el) => parseViewpoint(el, files, dir));
|
|
31137
31084
|
const topic = {
|
|
31138
31085
|
guid: topicEl.attrs["Guid"] ?? "",
|
|
31139
31086
|
title: childText(topicEl, "Title") ?? "",
|
|
@@ -31151,9 +31098,13 @@ function parseMarkup(xml, files, dir) {
|
|
|
31151
31098
|
assign(topic, "dueDate", childText(topicEl, "DueDate"));
|
|
31152
31099
|
assign(topic, "assignedTo", childText(topicEl, "AssignedTo"));
|
|
31153
31100
|
assign(topic, "description", childText(topicEl, "Description"));
|
|
31154
|
-
const labels = findChildren(topicEl, "Labels").
|
|
31101
|
+
const labels = findChildren(topicEl, "Labels").flatMap((l) => {
|
|
31102
|
+
const nested = findChildren(l, "Label");
|
|
31103
|
+
if (nested.length > 0) return nested.map((n) => n.text);
|
|
31104
|
+
return l.text !== "" ? [l.text] : [];
|
|
31105
|
+
});
|
|
31155
31106
|
if (labels.length > 0) topic.labels = labels;
|
|
31156
|
-
const related = findChildren(topicEl, "RelatedTopic").map((r) => r.attrs["Guid"]).filter((g) => g !== void 0);
|
|
31107
|
+
const related = findChildren(findChild(topicEl, "RelatedTopics") ?? topicEl, "RelatedTopic").map((r) => r.attrs["Guid"]).filter((g) => g !== void 0);
|
|
31157
31108
|
if (related.length > 0) topic.relatedTopics = related;
|
|
31158
31109
|
return topic;
|
|
31159
31110
|
}
|
|
@@ -31180,12 +31131,51 @@ function parseViewpoint(el, files, dir) {
|
|
|
31180
31131
|
else if (viewpoint.viewpointFile !== void 0) {
|
|
31181
31132
|
const bcfvXml = files.get(`${dir}${viewpoint.viewpointFile}`);
|
|
31182
31133
|
if (bcfvXml !== void 0) {
|
|
31183
|
-
const
|
|
31134
|
+
const visInfo = parseXml(bcfvXml);
|
|
31135
|
+
const visEl = findChild(visInfo, "Components");
|
|
31184
31136
|
if (visEl !== void 0) viewpoint.components = parseComponents(visEl);
|
|
31137
|
+
const camera = parseCamera(visInfo);
|
|
31138
|
+
if (camera !== void 0) viewpoint.camera = camera;
|
|
31185
31139
|
}
|
|
31186
31140
|
}
|
|
31187
31141
|
return viewpoint;
|
|
31188
31142
|
}
|
|
31143
|
+
function parseCamera(visInfo) {
|
|
31144
|
+
const ortho = findChild(visInfo, "OrthogonalCamera");
|
|
31145
|
+
const persp = findChild(visInfo, "PerspectiveCamera");
|
|
31146
|
+
const el = ortho ?? persp;
|
|
31147
|
+
if (el === void 0) return void 0;
|
|
31148
|
+
const frame = {
|
|
31149
|
+
viewPoint: parseVector(el, "CameraViewPoint"),
|
|
31150
|
+
direction: parseVector(el, "CameraDirection"),
|
|
31151
|
+
upVector: parseVector(el, "CameraUpVector"),
|
|
31152
|
+
aspectRatio: requiredNumber(el, "AspectRatio")
|
|
31153
|
+
};
|
|
31154
|
+
return ortho !== void 0 ? {
|
|
31155
|
+
kind: "ORTHOGONAL",
|
|
31156
|
+
...frame,
|
|
31157
|
+
viewToWorldScale: requiredNumber(el, "ViewToWorldScale")
|
|
31158
|
+
} : {
|
|
31159
|
+
kind: "PERSPECTIVE",
|
|
31160
|
+
...frame,
|
|
31161
|
+
fieldOfView: requiredNumber(el, "FieldOfView")
|
|
31162
|
+
};
|
|
31163
|
+
}
|
|
31164
|
+
function parseVector(camera, tag) {
|
|
31165
|
+
const el = findChild(camera, tag);
|
|
31166
|
+
if (el === void 0) throw new Error(`<${camera.tag}> is missing <${tag}>`);
|
|
31167
|
+
return [
|
|
31168
|
+
requiredNumber(el, "X"),
|
|
31169
|
+
requiredNumber(el, "Y"),
|
|
31170
|
+
requiredNumber(el, "Z")
|
|
31171
|
+
];
|
|
31172
|
+
}
|
|
31173
|
+
function requiredNumber(el, tag) {
|
|
31174
|
+
const text = childText(el, tag);
|
|
31175
|
+
const value = Number(text);
|
|
31176
|
+
if (text === void 0 || text === "" || !Number.isFinite(value)) throw new Error(`<${el.tag}> has no numeric <${tag}>`);
|
|
31177
|
+
return value;
|
|
31178
|
+
}
|
|
31189
31179
|
function parseComponents(el) {
|
|
31190
31180
|
const components = {};
|
|
31191
31181
|
const selectionEl = findChild(el, "Selection");
|
|
@@ -31197,9 +31187,10 @@ function parseComponents(el) {
|
|
|
31197
31187
|
return components;
|
|
31198
31188
|
}
|
|
31199
31189
|
function parseColoring(el) {
|
|
31190
|
+
const componentsEl = findChild(el, "Components") ?? el;
|
|
31200
31191
|
return {
|
|
31201
31192
|
color: el.attrs["Color"] ?? "",
|
|
31202
|
-
components: findChildren(
|
|
31193
|
+
components: findChildren(componentsEl, "Component").map(parseComponent)
|
|
31203
31194
|
};
|
|
31204
31195
|
}
|
|
31205
31196
|
function parseVisibility(el) {
|
|
@@ -31222,8 +31213,7 @@ function assign(target, key, value) {
|
|
|
31222
31213
|
function assignNum(target, key, value) {
|
|
31223
31214
|
if (value !== void 0) target[key] = Number(value);
|
|
31224
31215
|
}
|
|
31225
|
-
|
|
31226
|
-
//#region src/familiesFrame.ts
|
|
31216
|
+
// src/familiesFrame.ts
|
|
31227
31217
|
/** Families translates authored operations at its boundary, in authored order. */
|
|
31228
31218
|
function frameFromOps(ops) {
|
|
31229
31219
|
let frame = IDENTITY_FRAME;
|
|
@@ -31248,8 +31238,7 @@ function requireFrame(result) {
|
|
|
31248
31238
|
if (!result.ok) throw new FrameProjectionError(result.error);
|
|
31249
31239
|
return result.value;
|
|
31250
31240
|
}
|
|
31251
|
-
|
|
31252
|
-
//#region src/familiesProductBody.ts
|
|
31241
|
+
// src/familiesProductBody.ts
|
|
31253
31242
|
/**
|
|
31254
31243
|
* Borrow evaluator parents, then copy and inverse-localize in item order.
|
|
31255
31244
|
* Every successful result is AUTHORITATIVE and caller-owned until COMMITTED.
|
|
@@ -31322,8 +31311,7 @@ function productBodyError(input, code, detail, cause, itemIndex, reports = []) {
|
|
|
31322
31311
|
}
|
|
31323
31312
|
};
|
|
31324
31313
|
}
|
|
31325
|
-
|
|
31326
|
-
//#region src/familiesAdapter.ts
|
|
31314
|
+
// src/familiesAdapter.ts
|
|
31327
31315
|
/**
|
|
31328
31316
|
* brepjs-families -> BimModel adapter. Consumes a resolved element tree and
|
|
31329
31317
|
* feeds each element's PRE-DESUGARED props into parametric specs. Civil wall
|
|
@@ -32508,5 +32496,4 @@ function projectFamiliesToBim(root, options, model) {
|
|
|
32508
32496
|
proxied
|
|
32509
32497
|
});
|
|
32510
32498
|
}
|
|
32511
|
-
//#endregion
|
|
32512
32499
|
export { BimModel, DEFAULT_IFC_SCHEMA, DEFAULT_UNITS, IDENTITY_FRAME, IFC_SCHEMAS, PSET_PROPERTY_TYPE_TABLE, PSET_TEMPLATES, SpfReader, bcfError, bodySolids, checkGeometryValidity, checkGherkinRules, checkIdsData as checkIds, checkIdsData, checkReferentialIntegrity, checkRoundTrip, checkSchema, copyProductBody, countBySeverity, deriveCobieModel, deriveCobieModel as exportCobie, deriveIfcGuid, deriveIfcGuidSync, disposeImportedModel, disposeProductBody, emptyReport, extendedProfileArea, extendedProfileToFace, familiesToBim, fileSchemaString, frameFromMatrix, frameFromPlacement, frameInverse, frameMul, fromBrepError, fromIfc, geometryError, hasErrors, idsError, ifcError, importError, isExtendedProfile, isIfcSchema, isSlabOpening, isValidIfcGuid, isWallOpening, issue, makeLocalIdCounter, measureProductBodyMaterial, measureTypeFor, newIfcGuid, parseBcfFiles, parseBeamSpec, parseBridgePartSpec, parseBridgeSpec, parseColumnSpec, parseCoveringSpec, parseCurtainWallSpec, parseDoorSpec, parseElementAssemblySpec, parseFootingSpec, parseIdsXml, parsePileSpec, parseProfile, parseRailingSpec, parseRampFlightSpec, parseRampSpec, parseRoofSpec, parseSlabOpeningInput, parseSlabSpec, parseSpaceSpec, parseStairFlightSpec, parseStairSpec, parseSurfaceStyleSpec, parseSystemSpec, parseWallSpec, parseWindowSpec, parseZoneSpec, placedSolids, productBodyBounds, rotationFrame, schemaSupports, serializeBcfFiles, serializeCobieToCsv, serializeCobieToJson, setIfcWasmLocateFile, specError, templateFor, toIfc, toIfcLengthM, toIfcValidated, toLengthMm, transformProductBody, translationFrame, validateProductBody, writeClassificationRefs, writeElementAssemblyEntity, writeIfcType, writeMaterialLayerSet, writeMaterialProfileSet, writeMaterialSimple, writePresentationLayer, writeRelAggregatesElements, writeRelAssignsToGroup, writeRelConnectsElements, writeRelConnectsPathElements, writeRelNests, writeStyledItem, writeSurfaceStyle, writeSystemEntity, writeZoneEntity };
|