brepjs-bim 0.8.1 → 0.10.0
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/brepjs-bim.cjs +8 -6
- package/dist/brepjs-bim.js +8 -6
- package/dist/model/bimModel.d.ts +1 -1
- package/package.json +1 -1
package/dist/brepjs-bim.cjs
CHANGED
|
@@ -6386,10 +6386,12 @@ var BimModel = class {
|
|
|
6386
6386
|
this.#associateClassification(id, spec);
|
|
6387
6387
|
return (0, brepjs.ok)(id);
|
|
6388
6388
|
}
|
|
6389
|
-
addColumn(spec) {
|
|
6389
|
+
addColumn(spec, options) {
|
|
6390
|
+
const keyCheck = this.#checkStableKey(options);
|
|
6391
|
+
if (!keyCheck.ok) return keyCheck;
|
|
6390
6392
|
const geomResult = columnToSolid(spec);
|
|
6391
6393
|
if (!geomResult.ok) return (0, brepjs.err)(geomResult.error);
|
|
6392
|
-
const id = this.#makeElement("COLUMN", spec, geomResult.value);
|
|
6394
|
+
const id = this.#makeElement("COLUMN", spec, geomResult.value, options?.stableKey);
|
|
6393
6395
|
this.#associateMaterial(id, spec);
|
|
6394
6396
|
this.#associateClassification(id, spec);
|
|
6395
6397
|
return (0, brepjs.ok)(id);
|
|
@@ -16493,7 +16495,7 @@ function assignNum(target, key, value) {
|
|
|
16493
16495
|
* while the IR path serves the viewport and dedup. GlobalIds derive from
|
|
16494
16496
|
* families key paths (stable under reordering), not insertion order.
|
|
16495
16497
|
*
|
|
16496
|
-
* Scope: Storey containers, Wall/Slab elements, and wall openings — a
|
|
16498
|
+
* Scope: Storey containers, Wall/Slab/Column elements, and wall openings — a
|
|
16497
16499
|
* fill-role void (Door/Window family) maps onto addDoor/addWindow, which cut
|
|
16498
16500
|
* the wall and wire IfcRelVoidsElement + IfcRelFillsElement; the opening and
|
|
16499
16501
|
* filler GlobalIds derive from the synthesized key paths. Anonymous (non-fill)
|
|
@@ -16678,12 +16680,12 @@ function familiesToBim(root, options) {
|
|
|
16678
16680
|
model.aggregate(buildingId, id);
|
|
16679
16681
|
idByKeyPath.set(el.keyPath, id);
|
|
16680
16682
|
containerId = id;
|
|
16681
|
-
} else if (el.type === "Wall" || el.type === "Slab") {
|
|
16683
|
+
} else if (el.type === "Wall" || el.type === "Slab" || el.type === "Column") {
|
|
16682
16684
|
const keyed = requireKeyed(el);
|
|
16683
16685
|
if (!keyed.ok) return keyed;
|
|
16684
|
-
const parsed = el.type === "Wall" ? parseWallSpec(specInput(el)) : parseSlabSpec(specInput(el));
|
|
16686
|
+
const parsed = el.type === "Wall" ? parseWallSpec(specInput(el)) : el.type === "Slab" ? parseSlabSpec(specInput(el)) : parseColumnSpec(specInput(el));
|
|
16685
16687
|
if (!parsed.ok) return parsed;
|
|
16686
|
-
const added = el.type === "Wall" ? model.addWall(parsed.value, { stableKey: el.keyPath }) : model.addSlab(parsed.value, { stableKey: el.keyPath });
|
|
16688
|
+
const added = el.type === "Wall" ? model.addWall(parsed.value, { stableKey: el.keyPath }) : el.type === "Slab" ? model.addSlab(parsed.value, { stableKey: el.keyPath }) : model.addColumn(parsed.value, { stableKey: el.keyPath });
|
|
16687
16689
|
if (!added.ok) return added;
|
|
16688
16690
|
idByKeyPath.set(el.keyPath, added.value);
|
|
16689
16691
|
if (containerId === null) return (0, brepjs.err)(specError("FAMILIES_NO_STOREY", `familiesToBim: '${el.keyPath}' has no Storey ancestor — IFC elements need spatial containment`));
|
package/dist/brepjs-bim.js
CHANGED
|
@@ -6363,10 +6363,12 @@ var BimModel = class {
|
|
|
6363
6363
|
this.#associateClassification(id, spec);
|
|
6364
6364
|
return ok(id);
|
|
6365
6365
|
}
|
|
6366
|
-
addColumn(spec) {
|
|
6366
|
+
addColumn(spec, options) {
|
|
6367
|
+
const keyCheck = this.#checkStableKey(options);
|
|
6368
|
+
if (!keyCheck.ok) return keyCheck;
|
|
6367
6369
|
const geomResult = columnToSolid(spec);
|
|
6368
6370
|
if (!geomResult.ok) return err(geomResult.error);
|
|
6369
|
-
const id = this.#makeElement("COLUMN", spec, geomResult.value);
|
|
6371
|
+
const id = this.#makeElement("COLUMN", spec, geomResult.value, options?.stableKey);
|
|
6370
6372
|
this.#associateMaterial(id, spec);
|
|
6371
6373
|
this.#associateClassification(id, spec);
|
|
6372
6374
|
return ok(id);
|
|
@@ -16470,7 +16472,7 @@ function assignNum(target, key, value) {
|
|
|
16470
16472
|
* while the IR path serves the viewport and dedup. GlobalIds derive from
|
|
16471
16473
|
* families key paths (stable under reordering), not insertion order.
|
|
16472
16474
|
*
|
|
16473
|
-
* Scope: Storey containers, Wall/Slab elements, and wall openings — a
|
|
16475
|
+
* Scope: Storey containers, Wall/Slab/Column elements, and wall openings — a
|
|
16474
16476
|
* fill-role void (Door/Window family) maps onto addDoor/addWindow, which cut
|
|
16475
16477
|
* the wall and wire IfcRelVoidsElement + IfcRelFillsElement; the opening and
|
|
16476
16478
|
* filler GlobalIds derive from the synthesized key paths. Anonymous (non-fill)
|
|
@@ -16655,12 +16657,12 @@ function familiesToBim(root, options) {
|
|
|
16655
16657
|
model.aggregate(buildingId, id);
|
|
16656
16658
|
idByKeyPath.set(el.keyPath, id);
|
|
16657
16659
|
containerId = id;
|
|
16658
|
-
} else if (el.type === "Wall" || el.type === "Slab") {
|
|
16660
|
+
} else if (el.type === "Wall" || el.type === "Slab" || el.type === "Column") {
|
|
16659
16661
|
const keyed = requireKeyed(el);
|
|
16660
16662
|
if (!keyed.ok) return keyed;
|
|
16661
|
-
const parsed = el.type === "Wall" ? parseWallSpec(specInput(el)) : parseSlabSpec(specInput(el));
|
|
16663
|
+
const parsed = el.type === "Wall" ? parseWallSpec(specInput(el)) : el.type === "Slab" ? parseSlabSpec(specInput(el)) : parseColumnSpec(specInput(el));
|
|
16662
16664
|
if (!parsed.ok) return parsed;
|
|
16663
|
-
const added = el.type === "Wall" ? model.addWall(parsed.value, { stableKey: el.keyPath }) : model.addSlab(parsed.value, { stableKey: el.keyPath });
|
|
16665
|
+
const added = el.type === "Wall" ? model.addWall(parsed.value, { stableKey: el.keyPath }) : el.type === "Slab" ? model.addSlab(parsed.value, { stableKey: el.keyPath }) : model.addColumn(parsed.value, { stableKey: el.keyPath });
|
|
16664
16666
|
if (!added.ok) return added;
|
|
16665
16667
|
idByKeyPath.set(el.keyPath, added.value);
|
|
16666
16668
|
if (containerId === null) return err(specError("FAMILIES_NO_STOREY", `familiesToBim: '${el.keyPath}' has no Storey ancestor — IFC elements need spatial containment`));
|
package/dist/model/bimModel.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare class BimModel {
|
|
|
43
43
|
addWall(spec: WallSpec, options?: ElementIdentityOptions): Result<LocalId, BimError>;
|
|
44
44
|
addSlab(spec: SlabSpec, options?: ElementIdentityOptions): Result<LocalId, BimError>;
|
|
45
45
|
addBeam(spec: BeamSpec): Result<LocalId, BimError>;
|
|
46
|
-
addColumn(spec: ColumnSpec): Result<LocalId, BimError>;
|
|
46
|
+
addColumn(spec: ColumnSpec, options?: ElementIdentityOptions): Result<LocalId, BimError>;
|
|
47
47
|
addSpace(spec: SpaceSpec): Result<LocalId, BimError>;
|
|
48
48
|
addRoof(spec: RoofSpec): Result<LocalId, BimError>;
|
|
49
49
|
addCurtainWall(spec: CurtainWallSpec): Result<LocalId, BimError>;
|