brepjs-bim 0.3.0 → 0.4.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/bcf/bcfXml.d.ts +9 -3
- package/dist/brepjs-bim.cjs +378 -139
- package/dist/brepjs-bim.js +377 -139
- package/dist/familiesAdapter.d.ts +22 -0
- package/dist/index.d.ts +1 -0
- package/dist/model/bimModel.d.ts +9 -4
- package/package.json +5 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Result } from 'brepjs';
|
|
2
|
+
import { ResolvedElement } from 'brepjs-families';
|
|
3
|
+
import { BimModel } from './model/bimModel.js';
|
|
4
|
+
import { LocalId } from './identity/localId.js';
|
|
5
|
+
import { ProjectSpec } from './specs/spatialSpec.js';
|
|
6
|
+
import { BimError } from './errors/bimError.js';
|
|
7
|
+
export interface FamiliesToBimOptions {
|
|
8
|
+
readonly project: ProjectSpec;
|
|
9
|
+
readonly siteName?: string | undefined;
|
|
10
|
+
readonly buildingName?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface FamiliesBimResult {
|
|
13
|
+
readonly model: BimModel;
|
|
14
|
+
/** LocalId per geometry-bearing families key path. */
|
|
15
|
+
readonly idByKeyPath: ReadonlyMap<string, LocalId>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Project a resolved families tree into an eager BimModel. The caller owns
|
|
19
|
+
* the returned model (`using`); families stays domain-neutral — this adapter
|
|
20
|
+
* is where families types meet the IFC vocabulary.
|
|
21
|
+
*/
|
|
22
|
+
export declare function familiesToBim(root: ResolvedElement, options: FamiliesToBimOptions): Result<FamiliesBimResult, BimError>;
|
package/dist/index.d.ts
CHANGED
|
@@ -96,3 +96,4 @@ export type { IdsDocument, IdsSpecification, IdsFacet, IdsRestriction, IdsCardin
|
|
|
96
96
|
export { serializeBcfFiles, parseBcfFiles } from './bcf/index.js';
|
|
97
97
|
export type { BcfColoring, BcfComment, BcfComponent, BcfComponents, BcfContainerData, BcfFiles, BcfProject, BcfTopic, BcfVersion, BcfViewpoint, BcfVisibility, } from './bcf/index.js';
|
|
98
98
|
export { bcfError, idsError } from './errors/bimError.js';
|
|
99
|
+
export { familiesToBim, type FamiliesToBimOptions, type FamiliesBimResult, } from './familiesAdapter.js';
|
package/dist/model/bimModel.d.ts
CHANGED
|
@@ -23,15 +23,20 @@ import { ElementAssemblySpec } from '../specs/assemblySpec.js';
|
|
|
23
23
|
import { ZoneSpec, SystemSpec } from '../specs/groupSpec.js';
|
|
24
24
|
import { SurfaceStyleSpec } from '../ifc-writer/styleWriter.js';
|
|
25
25
|
import { ProjectSpec, SiteSpec, BuildingSpec, StoreySpec } from '../specs/spatialSpec.js';
|
|
26
|
+
/** Optional identity override for created elements: a stable key (e.g. a
|
|
27
|
+
* families key path) that replaces the positional GlobalId derivation. */
|
|
28
|
+
export interface ElementIdentityOptions {
|
|
29
|
+
readonly stableKey?: string | undefined;
|
|
30
|
+
}
|
|
26
31
|
export declare class BimModel {
|
|
27
32
|
#private;
|
|
28
33
|
init(spec: ProjectSpec): Result<LocalId, BimError>;
|
|
29
34
|
[Symbol.dispose](): void;
|
|
30
35
|
addSite(spec: SiteSpec): LocalId;
|
|
31
|
-
addBuilding(spec: BuildingSpec): LocalId;
|
|
32
|
-
addStorey(spec: StoreySpec): LocalId;
|
|
33
|
-
addWall(spec: WallSpec): Result<LocalId, BimError>;
|
|
34
|
-
addSlab(spec: SlabSpec): Result<LocalId, BimError>;
|
|
36
|
+
addBuilding(spec: BuildingSpec, options?: ElementIdentityOptions): LocalId;
|
|
37
|
+
addStorey(spec: StoreySpec, options?: ElementIdentityOptions): LocalId;
|
|
38
|
+
addWall(spec: WallSpec, options?: ElementIdentityOptions): Result<LocalId, BimError>;
|
|
39
|
+
addSlab(spec: SlabSpec, options?: ElementIdentityOptions): Result<LocalId, BimError>;
|
|
35
40
|
addBeam(spec: BeamSpec): Result<LocalId, BimError>;
|
|
36
41
|
addColumn(spec: ColumnSpec): Result<LocalId, BimError>;
|
|
37
42
|
addSpace(spec: SpaceSpec): Result<LocalId, BimError>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brepjs-bim",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "BIM layer for brepjs — IFC4-aligned parametric building elements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bim",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
],
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "vite build",
|
|
44
|
-
"typecheck": "
|
|
44
|
+
"typecheck": "tsgo --noEmit",
|
|
45
45
|
"test": "vitest run",
|
|
46
46
|
"lint": "eslint src tests"
|
|
47
47
|
},
|
|
@@ -59,5 +59,8 @@
|
|
|
59
59
|
"vitest": "^4.0.0",
|
|
60
60
|
"web-ifc": "^0.0.77",
|
|
61
61
|
"zod": "^4.4.3"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"brepjs-families": "^0.1.0"
|
|
62
65
|
}
|
|
63
66
|
}
|