brepjs-bim 0.1.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/LICENSE +191 -0
- package/README.md +100 -0
- package/dist/bcf/bcfRead.d.ts +11 -0
- package/dist/bcf/bcfTypes.d.ts +81 -0
- package/dist/bcf/bcfWrite.d.ts +14 -0
- package/dist/bcf/bcfXml.d.ts +34 -0
- package/dist/bcf/index.d.ts +3 -0
- package/dist/brepjs-bim.cjs +15935 -0
- package/dist/brepjs-bim.js +15822 -0
- package/dist/cobie/cobieExport.d.ts +20 -0
- package/dist/cobie/cobieTypes.d.ts +130 -0
- package/dist/cobie/index.d.ts +2 -0
- package/dist/elementFns/beamFns.d.ts +4 -0
- package/dist/elementFns/columnFns.d.ts +4 -0
- package/dist/elementFns/coveringFns.d.ts +4 -0
- package/dist/elementFns/curtainWallFns.d.ts +32 -0
- package/dist/elementFns/foundationFns.d.ts +5 -0
- package/dist/elementFns/openingFns.d.ts +4 -0
- package/dist/elementFns/profileFns.d.ts +5 -0
- package/dist/elementFns/railingFns.d.ts +4 -0
- package/dist/elementFns/rampFns.d.ts +14 -0
- package/dist/elementFns/roofFns.d.ts +4 -0
- package/dist/elementFns/slabFns.d.ts +4 -0
- package/dist/elementFns/slabOpeningFns.d.ts +4 -0
- package/dist/elementFns/spaceFns.d.ts +4 -0
- package/dist/elementFns/stairFns.d.ts +15 -0
- package/dist/elementFns/wallFns.d.ts +4 -0
- package/dist/errors/bimError.d.ts +39 -0
- package/dist/identity/guidDerivation.d.ts +25 -0
- package/dist/identity/ifcGuid.d.ts +7 -0
- package/dist/identity/localId.d.ts +10 -0
- package/dist/ids/idsCheck.d.ts +22 -0
- package/dist/ids/idsFacets.d.ts +21 -0
- package/dist/ids/idsParser.d.ts +20 -0
- package/dist/ids/idsTypes.d.ts +87 -0
- package/dist/ids/idsXml.d.ts +24 -0
- package/dist/ids/index.d.ts +3 -0
- package/dist/ifc-writer/assemblyWriter.d.ts +26 -0
- package/dist/ifc-writer/classificationWriter.d.ts +18 -0
- package/dist/ifc-writer/connectivityWriter.d.ts +16 -0
- package/dist/ifc-writer/coveringWriter.d.ts +12 -0
- package/dist/ifc-writer/curtainWallWriter.d.ts +23 -0
- package/dist/ifc-writer/entityWriter.d.ts +21 -0
- package/dist/ifc-writer/foundationWriter.d.ts +11 -0
- package/dist/ifc-writer/geometryWriter.d.ts +25 -0
- package/dist/ifc-writer/groupWriter.d.ts +19 -0
- package/dist/ifc-writer/headerWriter.d.ts +31 -0
- package/dist/ifc-writer/ifcWriter.d.ts +27 -0
- package/dist/ifc-writer/materialWriter.d.ts +39 -0
- package/dist/ifc-writer/openingWriter.d.ts +24 -0
- package/dist/ifc-writer/ownerHistoryWriter.d.ts +30 -0
- package/dist/ifc-writer/profileDefWriter.d.ts +3 -0
- package/dist/ifc-writer/proxyWriter.d.ts +17 -0
- package/dist/ifc-writer/psetWriter.d.ts +67 -0
- package/dist/ifc-writer/railingWriter.d.ts +11 -0
- package/dist/ifc-writer/relWriter.d.ts +4 -0
- package/dist/ifc-writer/roofWriter.d.ts +21 -0
- package/dist/ifc-writer/schemaVersion.d.ts +36 -0
- package/dist/ifc-writer/spaceWriter.d.ts +11 -0
- package/dist/ifc-writer/stairWriter.d.ts +49 -0
- package/dist/ifc-writer/styleWriter.d.ts +30 -0
- package/dist/ifc-writer/tessellationWriter.d.ts +42 -0
- package/dist/ifc-writer/typeWriter.d.ts +13 -0
- package/dist/import/dataRead.d.ts +65 -0
- package/dist/import/fromIfc.d.ts +24 -0
- package/dist/import/geometryRead.d.ts +41 -0
- package/dist/import/importedModel.d.ts +95 -0
- package/dist/import/placement.d.ts +89 -0
- package/dist/import/spatialTree.d.ts +35 -0
- package/dist/import/spfReader.d.ts +55 -0
- package/dist/index.d.ts +95 -0
- package/dist/model/bimModel.d.ts +151 -0
- package/dist/psets/psetTemplates.d.ts +41 -0
- package/dist/psets/qtoWeights.d.ts +32 -0
- package/dist/serialize/toIfc.d.ts +19 -0
- package/dist/specs/assemblySpec.d.ts +15 -0
- package/dist/specs/beamSpec.d.ts +34 -0
- package/dist/specs/columnSpec.d.ts +34 -0
- package/dist/specs/coveringSpec.d.ts +33 -0
- package/dist/specs/curtainWallSpec.d.ts +37 -0
- package/dist/specs/foundationSpec.d.ts +50 -0
- package/dist/specs/groupSpec.d.ts +27 -0
- package/dist/specs/materialSpec.d.ts +19 -0
- package/dist/specs/openingSpec.d.ts +42 -0
- package/dist/specs/profile.d.ts +108 -0
- package/dist/specs/profilesExtended.d.ts +86 -0
- package/dist/specs/proxySpec.d.ts +20 -0
- package/dist/specs/railingSpec.d.ts +32 -0
- package/dist/specs/rampSpec.d.ts +26 -0
- package/dist/specs/roofSpec.d.ts +32 -0
- package/dist/specs/slabSpec.d.ts +36 -0
- package/dist/specs/spaceSpec.d.ts +24 -0
- package/dist/specs/spatialSpec.d.ts +24 -0
- package/dist/specs/stairSpec.d.ts +24 -0
- package/dist/specs/styleSpec.d.ts +5 -0
- package/dist/specs/wallSpec.d.ts +33 -0
- package/dist/types/bimTypes.d.ts +49 -0
- package/dist/types/classificationTypes.d.ts +16 -0
- package/dist/types/materialTypes.d.ts +14 -0
- package/dist/types/relationships.d.ts +116 -0
- package/dist/units/units.d.ts +7 -0
- package/dist/validation/geometryValidity.d.ts +20 -0
- package/dist/validation/referentialIntegrity.d.ts +24 -0
- package/dist/validation/roundTrip.d.ts +36 -0
- package/dist/validation/schemaCheck.d.ts +14 -0
- package/dist/validation/severity.d.ts +18 -0
- package/package.json +42 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ValidationReport } from './severity.js';
|
|
2
|
+
/**
|
|
3
|
+
* EXPRESS/STEP self-validation gate.
|
|
4
|
+
*
|
|
5
|
+
* Re-opens produced IFC bytes with a fresh web-ifc model and checks that:
|
|
6
|
+
* - the model parses and is non-empty;
|
|
7
|
+
* - the required roots exist (one IfcProject and a spatial structure element);
|
|
8
|
+
* - every IfcRoot.GlobalId is a valid 22-character IFC GUID;
|
|
9
|
+
* - GlobalIds are unique across the model (a collision is an error).
|
|
10
|
+
*
|
|
11
|
+
* The web-ifc model lifecycle is fully owned here: it is always closed before
|
|
12
|
+
* returning, even when a check throws.
|
|
13
|
+
*/
|
|
14
|
+
export declare function checkSchema(bytes: Uint8Array): Promise<ValidationReport>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ValidationSeverity = 'error' | 'warning' | 'info';
|
|
2
|
+
export interface ValidationIssue {
|
|
3
|
+
readonly code: string;
|
|
4
|
+
readonly severity: ValidationSeverity;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
readonly entity?: string | number;
|
|
7
|
+
readonly context?: Readonly<Record<string, unknown>>;
|
|
8
|
+
}
|
|
9
|
+
export interface ValidationReport {
|
|
10
|
+
readonly issues: readonly ValidationIssue[];
|
|
11
|
+
}
|
|
12
|
+
export declare function issue(severity: ValidationSeverity, code: string, message: string, entity?: string | number, context?: Readonly<Record<string, unknown>>): ValidationIssue;
|
|
13
|
+
export declare function emptyReport(): ValidationReport;
|
|
14
|
+
export declare function appendIssue(report: ValidationReport, next: ValidationIssue): ValidationReport;
|
|
15
|
+
export declare function appendIssues(report: ValidationReport, next: readonly ValidationIssue[]): ValidationReport;
|
|
16
|
+
export declare function hasErrors(report: ValidationReport): boolean;
|
|
17
|
+
export type SeverityCounts = Readonly<Record<ValidationSeverity, number>>;
|
|
18
|
+
export declare function countBySeverity(report: ValidationReport): SeverityCounts;
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "brepjs-bim",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "BIM layer for brepjs — IFC4-aligned parametric building elements",
|
|
5
|
+
"keywords": ["bim", "ifc", "cad", "brep"],
|
|
6
|
+
"author": "Andy Aragon",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"engines": { "node": ">=24" },
|
|
11
|
+
"main": "./dist/brepjs-bim.cjs",
|
|
12
|
+
"module": "./dist/brepjs-bim.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/brepjs-bim.js" },
|
|
17
|
+
"require": { "types": "./dist/index.d.ts", "default": "./dist/brepjs-bim.cjs" }
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": ["dist", "LICENSE"],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "vite build",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"lint": "eslint src tests"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"brepjs": ">=18.0.0",
|
|
29
|
+
"web-ifc": ">=0.0.50"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@eslint/js": "*",
|
|
33
|
+
"eslint": "*",
|
|
34
|
+
"typescript": "*",
|
|
35
|
+
"typescript-eslint": "*",
|
|
36
|
+
"vite": "^8.0.0",
|
|
37
|
+
"vite-plugin-dts": "^5.0.0",
|
|
38
|
+
"vitest": "^4.0.0",
|
|
39
|
+
"web-ifc": "^0.0.77",
|
|
40
|
+
"zod": "^4.4.3"
|
|
41
|
+
}
|
|
42
|
+
}
|