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,12 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
3
|
+
import { CoveringSpec, CoveringPredefinedType } from '../specs/coveringSpec.js';
|
|
4
|
+
export interface CoveringRepresentationIds {
|
|
5
|
+
localPlacementId: number;
|
|
6
|
+
productDefinitionShapeId: number;
|
|
7
|
+
/** Express ID of the body representation item (the extrusion), for styling. */
|
|
8
|
+
bodyItemId: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function writeCoveringGeometry(w: IfcWriter, spec: CoveringSpec, geomSubContextId: number, parentPlacementId: number | null): CoveringRepresentationIds;
|
|
11
|
+
export declare function writeCoveringEntity(w: IfcWriter, guid: IfcGuid, name: string, predefinedType: CoveringPredefinedType, ownerHistoryId: number, localPlacementId: number, productDefinitionShapeId: number): number;
|
|
12
|
+
export declare function writeRelCoversBldgElements(w: IfcWriter, guid: IfcGuid, ownerHistoryId: number, relatingBuildingElementId: number, relatedCoveringIds: readonly number[]): number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { CurtainWallSpec } from '../specs/curtainWallSpec.js';
|
|
3
|
+
import { CurtainWallGrid } from '../elementFns/curtainWallFns.js';
|
|
4
|
+
export interface CurtainWallWriteResult {
|
|
5
|
+
/** Express ID of the IfcCurtainWall assembly. */
|
|
6
|
+
readonly curtainWallId: number;
|
|
7
|
+
/** Express IDs of the emitted IfcPlate panels. */
|
|
8
|
+
readonly plateIds: readonly number[];
|
|
9
|
+
/** Express IDs of the emitted IfcMember mullions. */
|
|
10
|
+
readonly memberIds: readonly number[];
|
|
11
|
+
/** Express ID of the IfcRelAggregates linking the wall to its parts. */
|
|
12
|
+
readonly aggregatesId: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Serializes a curtain wall: an IfcCurtainWall assembly (no own geometry) that
|
|
16
|
+
* aggregates one IfcPlate per glazing panel and one IfcMember per mullion via a
|
|
17
|
+
* single IfcRelAggregates. The wall carries an IfcLocalPlacement at its world
|
|
18
|
+
* origin/orientation; each plate and member is placed relative to it.
|
|
19
|
+
*
|
|
20
|
+
* GlobalIds are derived deterministically from `stableKey` so re-serializing an
|
|
21
|
+
* identical wall yields identical IDs for every part and the aggregation rel.
|
|
22
|
+
*/
|
|
23
|
+
export declare function writeCurtainWall(w: IfcWriter, spec: CurtainWallSpec, grid: CurtainWallGrid, stableKey: string, name: string, ownerHistoryId: number, geomSubContextId: number, parentPlacementId: number | null): CurtainWallWriteResult;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
3
|
+
export declare function writeProject(w: IfcWriter, guid: IfcGuid, name: string, ownerHistoryId: number, unitAssignmentId: number, geomContextId: number): number;
|
|
4
|
+
export declare function writeSite(w: IfcWriter, guid: IfcGuid, name: string, ownerHistoryId: number): {
|
|
5
|
+
entityId: number;
|
|
6
|
+
placementId: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function writeBuilding(w: IfcWriter, guid: IfcGuid, name: string, ownerHistoryId: number, parentPlacementId: number | null): {
|
|
9
|
+
entityId: number;
|
|
10
|
+
placementId: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function writeStorey(w: IfcWriter, guid: IfcGuid, name: string, elevationMm: number, ownerHistoryId: number, parentPlacementId: number | null): {
|
|
13
|
+
entityId: number;
|
|
14
|
+
placementId: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function writeWallEntity(w: IfcWriter, guid: IfcGuid, name: string, ownerHistoryId: number, localPlacementId: number, productDefinitionShapeId: number): number;
|
|
17
|
+
export declare function writeSlabEntity(w: IfcWriter, guid: IfcGuid, name: string, predefinedType: 'FLOOR' | 'ROOF' | 'LANDING' | 'BASESLAB', ownerHistoryId: number, localPlacementId: number, productDefinitionShapeId: number): number;
|
|
18
|
+
export type BeamPredefinedTypeIfc = 'BEAM' | 'JOIST' | 'LINTEL' | 'HOLLOWCORE' | 'PURLIN' | 'RAFTER' | 'SPANDREL' | 'T_BEAM' | 'NOTDEFINED';
|
|
19
|
+
export declare function writeBeamEntity(w: IfcWriter, guid: IfcGuid, name: string, predefinedType: BeamPredefinedTypeIfc, ownerHistoryId: number, localPlacementId: number, productDefinitionShapeId: number): number;
|
|
20
|
+
export type ColumnPredefinedTypeIfc = 'COLUMN' | 'PILASTER' | 'NOTDEFINED';
|
|
21
|
+
export declare function writeColumnEntity(w: IfcWriter, guid: IfcGuid, name: string, predefinedType: ColumnPredefinedTypeIfc, ownerHistoryId: number, localPlacementId: number, productDefinitionShapeId: number): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
3
|
+
import { FootingSpec, PileSpec, FootingPredefinedType, PilePredefinedType, PileConstructionType } from '../specs/foundationSpec.js';
|
|
4
|
+
export interface FoundationRepresentationIds {
|
|
5
|
+
localPlacementId: number;
|
|
6
|
+
productDefinitionShapeId: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function writeFootingGeometry(w: IfcWriter, spec: FootingSpec, geomSubContextId: number, parentPlacementId: number | null): FoundationRepresentationIds;
|
|
9
|
+
export declare function writePileGeometry(w: IfcWriter, spec: PileSpec, geomSubContextId: number, parentPlacementId: number | null): FoundationRepresentationIds;
|
|
10
|
+
export declare function writeFootingEntity(w: IfcWriter, guid: IfcGuid, name: string, predefinedType: FootingPredefinedType, ownerHistoryId: number, localPlacementId: number, productDefinitionShapeId: number): number;
|
|
11
|
+
export declare function writePileEntity(w: IfcWriter, guid: IfcGuid, name: string, predefinedType: PilePredefinedType, constructionType: PileConstructionType | null, ownerHistoryId: number, localPlacementId: number, productDefinitionShapeId: number): number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { WallSpec } from '../specs/wallSpec.js';
|
|
3
|
+
import { SlabSpec } from '../specs/slabSpec.js';
|
|
4
|
+
import { BeamSpec } from '../specs/beamSpec.js';
|
|
5
|
+
import { ColumnSpec } from '../specs/columnSpec.js';
|
|
6
|
+
import { RoofSpec } from '../specs/roofSpec.js';
|
|
7
|
+
import { Profile } from '../specs/profile.js';
|
|
8
|
+
export interface WallRepresentationIds {
|
|
9
|
+
localPlacementId: number;
|
|
10
|
+
productDefinitionShapeId: number;
|
|
11
|
+
}
|
|
12
|
+
export interface SlabRepresentationIds {
|
|
13
|
+
localPlacementId: number;
|
|
14
|
+
productDefinitionShapeId: number;
|
|
15
|
+
}
|
|
16
|
+
export interface LinearElementRepresentationIds {
|
|
17
|
+
localPlacementId: number;
|
|
18
|
+
productDefinitionShapeId: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function writeWallGeometry(w: IfcWriter, spec: WallSpec, geomSubContextId: number, parentPlacementId: number | null): WallRepresentationIds;
|
|
21
|
+
export declare function writeSlabGeometry(w: IfcWriter, spec: SlabSpec, geomSubContextId: number, parentPlacementId: number | null): SlabRepresentationIds;
|
|
22
|
+
export declare function writeRoofGeometry(w: IfcWriter, spec: RoofSpec, geomSubContextId: number, parentPlacementId: number | null): SlabRepresentationIds;
|
|
23
|
+
export declare function writeProfile(w: IfcWriter, profile: Profile): number;
|
|
24
|
+
export declare function writeBeamGeometry(w: IfcWriter, spec: BeamSpec, geomSubContextId: number, parentPlacementId: number | null): LinearElementRepresentationIds;
|
|
25
|
+
export declare function writeColumnGeometry(w: IfcWriter, spec: ColumnSpec, geomSubContextId: number, parentPlacementId: number | null): LinearElementRepresentationIds;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
3
|
+
/**
|
|
4
|
+
* Emits an IfcZone grouping object. `longName` (a descriptive label such as
|
|
5
|
+
* "Top Floor Thermal Zone") maps to the entity Description since IfcZone has no
|
|
6
|
+
* LongName attribute; `objectType` maps to ObjectType.
|
|
7
|
+
*/
|
|
8
|
+
export declare function writeZoneEntity(w: IfcWriter, guid: IfcGuid, name: string, longName: string | null, objectType: string | null, ownerHistoryId: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Emits an IfcSystem grouping object. As with {@link writeZoneEntity}, `longName`
|
|
11
|
+
* maps to Description and `objectType` to ObjectType.
|
|
12
|
+
*/
|
|
13
|
+
export declare function writeSystemEntity(w: IfcWriter, guid: IfcGuid, name: string, longName: string | null, objectType: string | null, ownerHistoryId: number): number;
|
|
14
|
+
/**
|
|
15
|
+
* Links a group (zone or system) to its members via IfcRelAssignsToGroup.
|
|
16
|
+
* `groupExpressId` becomes RelatingGroup; each member id becomes a RelatedObjects
|
|
17
|
+
* reference. Member entities must already be written so their express ids exist.
|
|
18
|
+
*/
|
|
19
|
+
export declare function writeRelAssignsToGroup(w: IfcWriter, guid: IfcGuid, ownerHistoryId: number, groupExpressId: number, memberExpressIds: readonly number[]): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { OwnerHistoryAuthor } from './ownerHistoryWriter.js';
|
|
3
|
+
import { IfcSchema } from './schemaVersion.js';
|
|
4
|
+
export interface HeaderIds {
|
|
5
|
+
ownerHistoryId: number;
|
|
6
|
+
geomContextId: number;
|
|
7
|
+
geomSubContextId: number;
|
|
8
|
+
unitAssignmentId: number;
|
|
9
|
+
}
|
|
10
|
+
export interface BimModelMeta {
|
|
11
|
+
applicationName: string;
|
|
12
|
+
applicationVersion: string;
|
|
13
|
+
/** MVD ViewDefinition declared in the STEP FILE_DESCRIPTION header. */
|
|
14
|
+
mvdViewDefinition?: string | undefined;
|
|
15
|
+
/** Authoring person for the IfcOwnerHistory chain. Defaults to an empty person. */
|
|
16
|
+
author?: OwnerHistoryAuthor | undefined;
|
|
17
|
+
/** Owning organization name for the IfcOwnerHistory chain. Defaults to "Unknown". */
|
|
18
|
+
organizationName?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Unix epoch seconds for IfcOwnerHistory.CreationDate. Defaults to 0 (epoch)
|
|
21
|
+
* so serialized output stays byte-deterministic; pass a real timestamp to
|
|
22
|
+
* record authoring time.
|
|
23
|
+
*/
|
|
24
|
+
creationTimestamp?: number | undefined;
|
|
25
|
+
/** Target IFC schema (FILE_SCHEMA + CreateModel). Defaults to IFC4. */
|
|
26
|
+
ifcSchema?: IfcSchema | undefined;
|
|
27
|
+
}
|
|
28
|
+
export declare function writeHeader(w: IfcWriter, meta: BimModelMeta): HeaderIds;
|
|
29
|
+
export declare function writeAxis2Placement3D(w: IfcWriter, origin?: [number, number, number], axisZ?: [number, number, number], axisX?: [number, number, number]): number;
|
|
30
|
+
export declare function writeCartesianPoint(w: IfcWriter, coords: [number, number, number]): number;
|
|
31
|
+
export declare function writeDirection(w: IfcWriter, dir: [number, number, number]): number;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Handle } from 'web-ifc';
|
|
2
|
+
import { BimError } from '../errors/bimError.js';
|
|
3
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
4
|
+
import { IfcSchema } from './schemaVersion.js';
|
|
5
|
+
import { Result } from 'brepjs';
|
|
6
|
+
/** Default MVD ViewDefinition declared in the STEP FILE_DESCRIPTION header. */
|
|
7
|
+
export declare const DEFAULT_MVD_VIEW_DEFINITION = "ReferenceView_v1.2";
|
|
8
|
+
export declare class IfcWriter {
|
|
9
|
+
#private;
|
|
10
|
+
private constructor();
|
|
11
|
+
static create(mvdViewDefinition?: string, ifcSchema?: IfcSchema): Promise<Result<IfcWriter, BimError>>;
|
|
12
|
+
nextId(): number;
|
|
13
|
+
/**
|
|
14
|
+
* Deterministic GlobalId for a writer-minted line, keyed on its express ID.
|
|
15
|
+
* Express IDs are assigned in a fixed serialization order, so an identical
|
|
16
|
+
* model produces identical GlobalIds for its psets/quantities/rels.
|
|
17
|
+
*/
|
|
18
|
+
/** Sets the per-model scope mixed into writer-minted GlobalIds. */
|
|
19
|
+
setModelScope(scope: string): void;
|
|
20
|
+
guidFor(expressId: number): IfcGuid;
|
|
21
|
+
writeLine(entity: {
|
|
22
|
+
expressID: number;
|
|
23
|
+
} & Record<string, unknown>): number;
|
|
24
|
+
ref(id: number): InstanceType<typeof Handle>;
|
|
25
|
+
mkType(type: number, value: unknown): Record<string, unknown>;
|
|
26
|
+
save(): Result<Uint8Array, BimError>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
3
|
+
import { MaterialLayer } from '../types/materialTypes.js';
|
|
4
|
+
export type { MaterialLayer } from '../types/materialTypes.js';
|
|
5
|
+
export interface MaterialLayerSetSpec {
|
|
6
|
+
readonly kind: 'LAYER_SET';
|
|
7
|
+
readonly layerSetName: string;
|
|
8
|
+
readonly layers: readonly MaterialLayer[];
|
|
9
|
+
/** Offset of the layer set from the element reference line, in mm (default 0). */
|
|
10
|
+
readonly offsetFromReferenceLine?: number | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface MaterialProfileSpec {
|
|
13
|
+
readonly kind: 'PROFILE_SET';
|
|
14
|
+
readonly profileSetName: string;
|
|
15
|
+
/** Name of the profile; the profile geometry is referenced by name only. */
|
|
16
|
+
readonly profileName: string;
|
|
17
|
+
readonly materialName: string;
|
|
18
|
+
}
|
|
19
|
+
export type MaterialSpec = MaterialLayerSetSpec | MaterialProfileSpec;
|
|
20
|
+
/**
|
|
21
|
+
* Writes IfcMaterialLayer × N + IfcMaterialLayerSet + IfcMaterialLayerSetUsage,
|
|
22
|
+
* then associates the usage with the related objects via IfcRelAssociatesMaterial.
|
|
23
|
+
* The rel GlobalId comes from `guid` (a deterministic, caller-supplied GUID).
|
|
24
|
+
* Returns the IfcRelAssociatesMaterial express ID, or 0 if the layer list is
|
|
25
|
+
* empty (nothing is written).
|
|
26
|
+
*/
|
|
27
|
+
export declare function writeMaterialLayerSet(w: IfcWriter, guid: IfcGuid, ownerHistoryId: number, spec: MaterialLayerSetSpec, relatedObjectIds: readonly number[], direction?: 'AXIS2' | 'AXIS3'): number;
|
|
28
|
+
/**
|
|
29
|
+
* Writes a IfcMaterialProfileSet referencing a single named profile + material,
|
|
30
|
+
* then associates it with the related objects via IfcRelAssociatesMaterial.
|
|
31
|
+
* Profile geometry is referenced by name only (no IfcProfileDef geometry).
|
|
32
|
+
* Returns the IfcRelAssociatesMaterial express ID.
|
|
33
|
+
*/
|
|
34
|
+
export declare function writeMaterialProfileSet(w: IfcWriter, guid: IfcGuid, ownerHistoryId: number, spec: MaterialProfileSpec, relatedObjectIds: readonly number[]): number;
|
|
35
|
+
/**
|
|
36
|
+
* Writes a bare IfcMaterial + IfcRelAssociatesMaterial. This is the
|
|
37
|
+
* single-material path used when no layer/profile spec is present.
|
|
38
|
+
*/
|
|
39
|
+
export declare function writeMaterialSimple(w: IfcWriter, guid: IfcGuid, ownerHistoryId: number, materialName: string, relatedObjectIds: readonly number[]): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
3
|
+
import { WallSpec } from '../specs/wallSpec.js';
|
|
4
|
+
import { WallOpeningSpec, SlabOpeningSpec } from '../types/bimTypes.js';
|
|
5
|
+
import { SlabSpec } from '../specs/slabSpec.js';
|
|
6
|
+
export interface OpeningIds {
|
|
7
|
+
openingEntityId: number;
|
|
8
|
+
openingPlacementId: number;
|
|
9
|
+
}
|
|
10
|
+
type OpeningPsetSpec = {
|
|
11
|
+
readonly isExternal?: boolean | undefined;
|
|
12
|
+
readonly fireRating?: string | undefined;
|
|
13
|
+
readonly acousticRating?: string | undefined;
|
|
14
|
+
readonly thermalTransmittance?: number | undefined;
|
|
15
|
+
};
|
|
16
|
+
export declare function writeOpeningGeometry(w: IfcWriter, guid: IfcGuid, openingSpec: WallOpeningSpec, wallSpec: WallSpec, wallPlacementId: number, geomSubContextId: number, ownerHistoryId: number): OpeningIds;
|
|
17
|
+
export declare function writeSlabOpeningGeometry(w: IfcWriter, guid: IfcGuid, openingSpec: SlabOpeningSpec, slabSpec: SlabSpec, slabPlacementId: number, geomSubContextId: number, ownerHistoryId: number): OpeningIds;
|
|
18
|
+
export declare function writeDoorEntity(w: IfcWriter, guid: IfcGuid, name: string, ownerHistoryId: number, openingPlacementId: number, geomSubContextId: number, overallWidthM: number, overallHeightM: number, nominalDepthMm?: number): number;
|
|
19
|
+
export declare function writeWindowEntity(w: IfcWriter, guid: IfcGuid, name: string, ownerHistoryId: number, openingPlacementId: number, geomSubContextId: number, overallWidthM: number, overallHeightM: number, nominalDepthMm?: number): number;
|
|
20
|
+
export declare function writeRelVoidsElement(w: IfcWriter, guid: IfcGuid, ownerHistoryId: number, wallEntityId: number, openingEntityId: number): void;
|
|
21
|
+
export declare function writeRelFillsElement(w: IfcWriter, guid: IfcGuid, ownerHistoryId: number, openingEntityId: number, fillerEntityId: number): void;
|
|
22
|
+
export declare function writeDoorCommonPset(w: IfcWriter, ownerHistoryId: number, doorEntityId: number, spec: OpeningPsetSpec): void;
|
|
23
|
+
export declare function writeWindowCommonPset(w: IfcWriter, ownerHistoryId: number, windowEntityId: number, spec: OpeningPsetSpec): void;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
/** Authoring person for the IfcOwnerHistory chain. */
|
|
3
|
+
export interface OwnerHistoryAuthor {
|
|
4
|
+
readonly givenName?: string | undefined;
|
|
5
|
+
readonly familyName?: string | undefined;
|
|
6
|
+
/** Optional contact email; emitted as an IfcTelecomAddress on the person. */
|
|
7
|
+
readonly email?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Configurable owner-history metadata. All identity values are passed in so the
|
|
11
|
+
* writer never reads wall-clock time — `creationTimestamp` defaults to 0 (epoch)
|
|
12
|
+
* to keep serialized output byte-deterministic.
|
|
13
|
+
*/
|
|
14
|
+
export interface OwnerHistoryMeta {
|
|
15
|
+
readonly author: OwnerHistoryAuthor;
|
|
16
|
+
readonly organizationName: string;
|
|
17
|
+
readonly applicationName: string;
|
|
18
|
+
readonly applicationVersion: string;
|
|
19
|
+
/** Unix epoch seconds for IfcOwnerHistory.CreationDate. Default 0 (epoch). */
|
|
20
|
+
readonly creationTimestamp?: number | undefined;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Writes the IfcPerson → IfcOrganization → IfcPersonAndOrganization →
|
|
24
|
+
* IfcApplication → IfcOwnerHistory chain from the supplied metadata and returns
|
|
25
|
+
* the IfcOwnerHistory express id for owned entities to reference.
|
|
26
|
+
*
|
|
27
|
+
* Determinism: no wall-clock time is read here; CreationDate comes solely from
|
|
28
|
+
* `meta.creationTimestamp` (default 0). Identical meta yields identical output.
|
|
29
|
+
*/
|
|
30
|
+
export declare function writeOwnerHistory(w: IfcWriter, meta: OwnerHistoryMeta): number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { TessellationOutput } from './tessellationWriter.js';
|
|
3
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
4
|
+
import { ProxySpec } from '../specs/proxySpec.js';
|
|
5
|
+
export interface ProxyRepresentationIds {
|
|
6
|
+
readonly localPlacementId: number;
|
|
7
|
+
readonly productDefinitionShapeId: number;
|
|
8
|
+
readonly tessellation: TessellationOutput;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Writes the IfcLocalPlacement (at origin, relative to parentPlacementId) and a
|
|
12
|
+
* tessellated body (IfcTriangulatedFaceSet) for a proxy's solid. The solid is
|
|
13
|
+
* exported in its authored coordinate frame; placement is identity because proxy
|
|
14
|
+
* solids carry their own world positions in the brepjs geometry.
|
|
15
|
+
*/
|
|
16
|
+
export declare function writeProxyGeometry(w: IfcWriter, spec: ProxySpec, geomSubContextId: number, parentPlacementId: number | null): ProxyRepresentationIds;
|
|
17
|
+
export declare function writeProxyEntity(w: IfcWriter, guid: IfcGuid, name: string, predefinedType: string, ownerHistoryId: number, localPlacementId: number, productDefinitionShapeId: number): number;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { WallSpec } from '../specs/wallSpec.js';
|
|
3
|
+
import { SlabSpec } from '../specs/slabSpec.js';
|
|
4
|
+
import { BeamSpec } from '../specs/beamSpec.js';
|
|
5
|
+
import { ColumnSpec } from '../specs/columnSpec.js';
|
|
6
|
+
import { SpaceSpec } from '../specs/spaceSpec.js';
|
|
7
|
+
import { RoofSpec } from '../specs/roofSpec.js';
|
|
8
|
+
import { CurtainWallSpec } from '../specs/curtainWallSpec.js';
|
|
9
|
+
import { FootingSpec, PileSpec } from '../specs/foundationSpec.js';
|
|
10
|
+
import { RailingSpec } from '../specs/railingSpec.js';
|
|
11
|
+
import { CoveringSpec } from '../specs/coveringSpec.js';
|
|
12
|
+
import { StairSpec } from '../specs/stairSpec.js';
|
|
13
|
+
import { RampSpec } from '../specs/rampSpec.js';
|
|
14
|
+
import { WallOpeningSpec, SlabOpeningSpec } from '../types/bimTypes.js';
|
|
15
|
+
import { PsetCategory } from '../psets/psetTemplates.js';
|
|
16
|
+
type PsetValue = string | number | boolean;
|
|
17
|
+
export declare function writePropertySingleValueTyped(w: IfcWriter, name: string, value: PsetValue): number;
|
|
18
|
+
/**
|
|
19
|
+
* Emits an IfcPropertyEnumeratedValue: the value plus the backing
|
|
20
|
+
* IfcPropertyEnumeration listing every legal value. Used for enumerated Pset
|
|
21
|
+
* properties such as `Status`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function writePropertyEnumeratedValue(w: IfcWriter, name: string, value: string, enumValues: readonly string[]): number;
|
|
24
|
+
export declare function writePropertySet(w: IfcWriter, ownerHistoryId: number, name: string, propertyIds: readonly number[]): number;
|
|
25
|
+
export declare function writeRelDefinesByProperties(w: IfcWriter, ownerHistoryId: number, entityExpressId: number, psetId: number): void;
|
|
26
|
+
/**
|
|
27
|
+
* Writes the standard Pset_*Common set for an element from its category template
|
|
28
|
+
* and a set of property values. Shared by the door/window pset writers in
|
|
29
|
+
* openingWriter.ts so every element type emits the correct measure types.
|
|
30
|
+
*/
|
|
31
|
+
export declare function writeCommonPset(w: IfcWriter, ownerHistoryId: number, entityExpressId: number, category: PsetCategory, values: Readonly<Record<string, PsetValue>>): void;
|
|
32
|
+
export declare function writeWallCommonPset(w: IfcWriter, ownerHistoryId: number, wallExpressId: number, spec: WallSpec): void;
|
|
33
|
+
interface ManufacturerFields {
|
|
34
|
+
readonly manufacturerName?: string | undefined;
|
|
35
|
+
readonly manufacturerModel?: string | undefined;
|
|
36
|
+
readonly manufacturerProductionYear?: number | undefined;
|
|
37
|
+
}
|
|
38
|
+
export declare function writeManufacturerPset(w: IfcWriter, ownerHistoryId: number, entityExpressId: number, spec: ManufacturerFields): void;
|
|
39
|
+
export declare function writeCustomPsets(w: IfcWriter, ownerHistoryId: number, entityExpressId: number, customProperties: Readonly<Record<string, Readonly<Record<string, string | number | boolean>>>>): void;
|
|
40
|
+
/**
|
|
41
|
+
* Resolves a bulk density (kg/m³) for an element's material association: an
|
|
42
|
+
* explicit `densityKgM3` on the material spec wins, otherwise a nominal value is
|
|
43
|
+
* looked up from the material name. Returns `undefined` when neither is available
|
|
44
|
+
* so the caller can skip emitting a weight quantity.
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveDensityKgM3(materialName: string | undefined, explicitDensityKgM3: number | undefined): number | undefined;
|
|
47
|
+
export declare function writeWallBaseQuantities(w: IfcWriter, ownerHistoryId: number, wallExpressId: number, spec: WallSpec, openings: readonly WallOpeningSpec[], densityKgM3?: number): void;
|
|
48
|
+
export declare function writeSlabCommonPset(w: IfcWriter, ownerHistoryId: number, slabExpressId: number, spec: SlabSpec): void;
|
|
49
|
+
export declare function writeSlabBaseQuantities(w: IfcWriter, ownerHistoryId: number, slabExpressId: number, spec: SlabSpec, openings: readonly SlabOpeningSpec[], densityKgM3?: number): void;
|
|
50
|
+
export declare function writeBeamCommonPset(w: IfcWriter, ownerHistoryId: number, beamExpressId: number, spec: BeamSpec): void;
|
|
51
|
+
export declare function writeColumnCommonPset(w: IfcWriter, ownerHistoryId: number, columnExpressId: number, spec: ColumnSpec): void;
|
|
52
|
+
export declare function writeBeamBaseQuantities(w: IfcWriter, ownerHistoryId: number, beamExpressId: number, spec: BeamSpec): void;
|
|
53
|
+
export declare function writeColumnBaseQuantities(w: IfcWriter, ownerHistoryId: number, columnExpressId: number, spec: ColumnSpec): void;
|
|
54
|
+
export declare function writeSpaceCommonPset(w: IfcWriter, ownerHistoryId: number, spaceExpressId: number, spec: SpaceSpec): void;
|
|
55
|
+
export declare function writeSpaceBaseQuantities(w: IfcWriter, ownerHistoryId: number, spaceExpressId: number, spec: SpaceSpec): void;
|
|
56
|
+
export declare function writeRoofCommonPset(w: IfcWriter, ownerHistoryId: number, roofExpressId: number, spec: RoofSpec): void;
|
|
57
|
+
export declare function writeRoofBaseQuantities(w: IfcWriter, ownerHistoryId: number, roofExpressId: number, spec: RoofSpec): void;
|
|
58
|
+
export declare function writeCurtainWallCommonPset(w: IfcWriter, ownerHistoryId: number, curtainWallExpressId: number, spec: CurtainWallSpec): void;
|
|
59
|
+
export declare function writeFootingCommonPset(w: IfcWriter, ownerHistoryId: number, footingExpressId: number, spec: FootingSpec): void;
|
|
60
|
+
export declare function writeFootingBaseQuantities(w: IfcWriter, ownerHistoryId: number, footingExpressId: number, spec: FootingSpec): void;
|
|
61
|
+
export declare function writePileCommonPset(w: IfcWriter, ownerHistoryId: number, pileExpressId: number, spec: PileSpec): void;
|
|
62
|
+
export declare function writePileBaseQuantities(w: IfcWriter, ownerHistoryId: number, pileExpressId: number, spec: PileSpec): void;
|
|
63
|
+
export declare function writeStairCommonPset(w: IfcWriter, ownerHistoryId: number, stairExpressId: number, spec: StairSpec): void;
|
|
64
|
+
export declare function writeRampCommonPset(w: IfcWriter, ownerHistoryId: number, rampExpressId: number, spec: RampSpec): void;
|
|
65
|
+
export declare function writeRailingCommonPset(w: IfcWriter, ownerHistoryId: number, railingExpressId: number, spec: RailingSpec): void;
|
|
66
|
+
export declare function writeCoveringCommonPset(w: IfcWriter, ownerHistoryId: number, coveringExpressId: number, spec: CoveringSpec): void;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
3
|
+
import { RailingSpec, RailingPredefinedType } from '../specs/railingSpec.js';
|
|
4
|
+
export interface RailingRepresentationIds {
|
|
5
|
+
localPlacementId: number;
|
|
6
|
+
productDefinitionShapeId: number;
|
|
7
|
+
/** Express ID of the body representation item (the extrusion), for styling. */
|
|
8
|
+
bodyItemId: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function writeRailingGeometry(w: IfcWriter, spec: RailingSpec, geomSubContextId: number, parentPlacementId: number | null): RailingRepresentationIds;
|
|
11
|
+
export declare function writeRailingEntity(w: IfcWriter, guid: IfcGuid, name: string, predefinedType: RailingPredefinedType, ownerHistoryId: number, localPlacementId: number, productDefinitionShapeId: number): number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
3
|
+
export declare function writeRelAggregates(w: IfcWriter, guid: IfcGuid, ownerHistoryId: number, relatingObjectId: number, relatedObjectIds: number[]): void;
|
|
4
|
+
export declare function writeRelContainedInSpatialStructure(w: IfcWriter, guid: IfcGuid, ownerHistoryId: number, relatingStructureId: number, relatedElementIds: number[]): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
3
|
+
import { RoofPredefinedType } from '../specs/roofSpec.js';
|
|
4
|
+
/** IfcRoofTypeEnum values, mirrored from {@link RoofPredefinedType}. */
|
|
5
|
+
export type RoofTypeEnum = RoofPredefinedType;
|
|
6
|
+
/**
|
|
7
|
+
* Writes an IfcRoof occurrence. `localPlacementId` and `productDefinitionShapeId`
|
|
8
|
+
* are the IfcLocalPlacement and IfcProductDefinitionShape express IDs produced by
|
|
9
|
+
* the geometry layer; pass `null` for either when not available.
|
|
10
|
+
*/
|
|
11
|
+
export declare function writeRoofEntity(w: IfcWriter, guid: IfcGuid, name: string, predefinedType: RoofTypeEnum, ownerHistoryId: number, localPlacementId: number | null, productDefinitionShapeId: number | null): number;
|
|
12
|
+
export interface RoofTypeWriteResult {
|
|
13
|
+
typeExpressId: number;
|
|
14
|
+
relExpressId: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Writes one IfcRoofType plus an IfcRelDefinesByType linking it to the given
|
|
18
|
+
* occurrence express IDs. `typeGuid`/`relGuid` are the deterministic GUIDs
|
|
19
|
+
* derived for the type object and its relationship.
|
|
20
|
+
*/
|
|
21
|
+
export declare function writeRoofType(w: IfcWriter, ownerHistoryId: number, typeGuid: IfcGuid, relGuid: IfcGuid, predefinedType: RoofTypeEnum, occurrenceExpressIds: readonly number[]): RoofTypeWriteResult;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IFC schema-version abstraction for the writer.
|
|
3
|
+
*
|
|
4
|
+
* The writer targets a single IFC schema per model. This module is the single
|
|
5
|
+
* source of truth for which schemas are supported, the FILE_SCHEMA token that
|
|
6
|
+
* goes into the STEP header (and into web-ifc's `CreateModel({ schema })`), and
|
|
7
|
+
* a guard helper for entities that exist only in a given schema.
|
|
8
|
+
*
|
|
9
|
+
* Selection is wired in by the writer integrator via `BimModelMeta.ifcSchema`;
|
|
10
|
+
* the default is {@link DEFAULT_IFC_SCHEMA}.
|
|
11
|
+
*/
|
|
12
|
+
/** Writer-supported IFC schemas, in declared order. */
|
|
13
|
+
export declare const IFC_SCHEMAS: readonly ["IFC4", "IFC4X3"];
|
|
14
|
+
/** Union of writer-supported IFC schema identifiers. */
|
|
15
|
+
export type IfcSchema = (typeof IFC_SCHEMAS)[number];
|
|
16
|
+
/** Schema used when none is specified in model meta. */
|
|
17
|
+
export declare const DEFAULT_IFC_SCHEMA: IfcSchema;
|
|
18
|
+
/**
|
|
19
|
+
* The FILE_SCHEMA token for the STEP header and `CreateModel({ schema })`.
|
|
20
|
+
*
|
|
21
|
+
* web-ifc identifies schemas by these exact strings, and the STEP serializer
|
|
22
|
+
* emits `FILE_SCHEMA(('<token>'));`. For the supported set the token equals the
|
|
23
|
+
* schema identifier itself, but callers should route through this function so a
|
|
24
|
+
* future schema whose header token diverges from its identifier stays correct.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fileSchemaString(schema: IfcSchema): string;
|
|
27
|
+
/** Type guard narrowing an unknown value to a supported {@link IfcSchema}. */
|
|
28
|
+
export declare function isIfcSchema(value: unknown): value is IfcSchema;
|
|
29
|
+
/**
|
|
30
|
+
* Whether `entityName` may be written in `schema`.
|
|
31
|
+
*
|
|
32
|
+
* Used by entity writers to gate emission of schema-specific entities: an
|
|
33
|
+
* IFC4X3-only entity must not be written into an IFC4 model. Unknown entity
|
|
34
|
+
* names default to supported so the guard never blocks schema-agnostic writes.
|
|
35
|
+
*/
|
|
36
|
+
export declare function schemaSupports(schema: IfcSchema, entityName: string): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { SpaceSpec, SpacePredefinedType } from '../specs/spaceSpec.js';
|
|
3
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
4
|
+
export interface SpaceRepresentationIds {
|
|
5
|
+
localPlacementId: number;
|
|
6
|
+
productDefinitionShapeId: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function writeSpaceGeometry(w: IfcWriter, spec: SpaceSpec, geomSubContextId: number, parentPlacementId: number | null): SpaceRepresentationIds;
|
|
9
|
+
export declare function writeSpaceEntity(w: IfcWriter, guid: IfcGuid, name: string, longName: string | null, predefinedType: SpacePredefinedType, ownerHistoryId: number, localPlacementId: number, productDefinitionShapeId: number): number;
|
|
10
|
+
export type SpaceBoundaryConnectionType = 'PHYSICAL' | 'VIRTUAL' | 'NOTDEFINED';
|
|
11
|
+
export declare function writeRelSpaceBoundary(w: IfcWriter, guid: IfcGuid, ownerHistoryId: number, spaceExpressId: number, elementExpressId: number, connectionType: SpaceBoundaryConnectionType): void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { StairSpec } from '../specs/stairSpec.js';
|
|
3
|
+
import { RampSpec } from '../specs/rampSpec.js';
|
|
4
|
+
import { BimError } from '../errors/bimError.js';
|
|
5
|
+
export interface AssemblyWriteResult {
|
|
6
|
+
/** Express ID of the IfcStair / IfcRamp assembly entity. */
|
|
7
|
+
readonly assemblyExpressId: number;
|
|
8
|
+
/** Express IDs of the IfcStairFlight / IfcRampFlight occurrences. */
|
|
9
|
+
readonly flightExpressIds: readonly number[];
|
|
10
|
+
/**
|
|
11
|
+
* True if any flight body fell back to simplified/degenerate geometry, or if
|
|
12
|
+
* the flight kind is inherently a simplified solid (ramp flights). The caller
|
|
13
|
+
* should surface this as a SIMPLIFIED_GEOMETRY note. Stair flights are real
|
|
14
|
+
* stepped solids and set this false unless tessellation itself fell back.
|
|
15
|
+
*/
|
|
16
|
+
readonly geometrySimplified: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Writes a complete IfcStair assembly: the IfcStair container, one IfcStairFlight
|
|
20
|
+
* per `spec.flights[i]` (each with a tessellated stepped-solid body), and a single
|
|
21
|
+
* IfcRelAggregates linking the flights to the stair. Flight placements are
|
|
22
|
+
* relative to the stair placement, which is relative to `parentPlacementId`
|
|
23
|
+
* (typically the storey). GUIDs are deterministic, keyed on `stairKey`/index so
|
|
24
|
+
* re-serializing an identical model is byte-stable.
|
|
25
|
+
*
|
|
26
|
+
* Returns a BimError if any flight solid cannot be built. Stair flights are real
|
|
27
|
+
* stepped solids; tessellation failure is flagged via `geometrySimplified`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function writeStairAssembly(w: IfcWriter, spec: StairSpec, stairKey: string, ownerHistoryId: number, geomSubContextId: number, parentPlacementId: number | null): {
|
|
30
|
+
ok: true;
|
|
31
|
+
value: AssemblyWriteResult;
|
|
32
|
+
} | {
|
|
33
|
+
ok: false;
|
|
34
|
+
error: BimError;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Writes a complete IfcRamp assembly: the IfcRamp container, one IfcRampFlight
|
|
38
|
+
* per `spec.flights[i]` (each an inclined-slab tessellated body), and a single
|
|
39
|
+
* IfcRelAggregates linking the flights to the ramp. Ramp flights are simplified
|
|
40
|
+
* inclined-slab solids, so `geometrySimplified` is always true. GUIDs are
|
|
41
|
+
* deterministic keyed on `rampKey`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function writeRampAssembly(w: IfcWriter, spec: RampSpec, rampKey: string, ownerHistoryId: number, geomSubContextId: number, parentPlacementId: number | null): {
|
|
44
|
+
ok: true;
|
|
45
|
+
value: AssemblyWriteResult;
|
|
46
|
+
} | {
|
|
47
|
+
ok: false;
|
|
48
|
+
error: BimError;
|
|
49
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
export interface SurfaceStyleSpec {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
/** Red channel, 0–1. */
|
|
5
|
+
readonly r: number;
|
|
6
|
+
/** Green channel, 0–1. */
|
|
7
|
+
readonly g: number;
|
|
8
|
+
/** Blue channel, 0–1. */
|
|
9
|
+
readonly b: number;
|
|
10
|
+
/** 0 = opaque (default), 1 = fully transparent. */
|
|
11
|
+
readonly transparency?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Emits IfcColourRgb + IfcSurfaceStyleRendering + IfcSurfaceStyle and returns the
|
|
15
|
+
* IfcSurfaceStyle express ID. Link the style to geometry items with
|
|
16
|
+
* {@link writeStyledItem}. Colour channels and transparency are clamped to [0,1].
|
|
17
|
+
*/
|
|
18
|
+
export declare function writeSurfaceStyle(w: IfcWriter, spec: SurfaceStyleSpec): number;
|
|
19
|
+
/**
|
|
20
|
+
* Emits an IfcStyledItem associating a single geometry representation item
|
|
21
|
+
* (e.g. an IfcExtrudedAreaSolid or IfcTriangulatedFaceSet) with a surface style
|
|
22
|
+
* produced by {@link writeSurfaceStyle}.
|
|
23
|
+
*/
|
|
24
|
+
export declare function writeStyledItem(w: IfcWriter, geomItemId: number, styleId: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* Emits an IfcPresentationLayerAssignment grouping representation items under a
|
|
27
|
+
* named layer. An empty `itemIds` set is a no-op (IFC requires a non-empty
|
|
28
|
+
* AssignedItems set).
|
|
29
|
+
*/
|
|
30
|
+
export declare function writePresentationLayer(w: IfcWriter, layerName: string, itemIds: readonly number[]): void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ValidSolid } from 'brepjs';
|
|
2
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
3
|
+
export interface TessellationResult {
|
|
4
|
+
readonly productDefinitionShapeId: number;
|
|
5
|
+
/** True when the IfcFacetedBrep fallback was used because mesh() failed. */
|
|
6
|
+
readonly usedFallback: false;
|
|
7
|
+
}
|
|
8
|
+
export interface TessellationFallbackResult {
|
|
9
|
+
readonly productDefinitionShapeId: number;
|
|
10
|
+
readonly usedFallback: true;
|
|
11
|
+
readonly fallbackReason: string;
|
|
12
|
+
}
|
|
13
|
+
export type TessellationOutput = TessellationResult | TessellationFallbackResult;
|
|
14
|
+
/**
|
|
15
|
+
* Writes an IfcTriangulatedFaceSet (preferred IFC4 tessellation) from a brepjs
|
|
16
|
+
* ValidSolid, wrapped in an IfcShapeRepresentation (Body/Tessellation) and an
|
|
17
|
+
* IfcProductDefinitionShape. Returns the IfcProductDefinitionShape express ID.
|
|
18
|
+
*
|
|
19
|
+
* Vertices from mesh() are in mm (brepjs native units) and are converted to
|
|
20
|
+
* metres for IFC. CoordIndex is emitted 1-based as IFC requires.
|
|
21
|
+
*
|
|
22
|
+
* On mesh() failure the function falls back to a degenerate single-vertex
|
|
23
|
+
* IfcFacetedBrep, logs a console.warn, and returns usedFallback: true. The
|
|
24
|
+
* caller should surface the fallback through its ValidationReport.
|
|
25
|
+
*
|
|
26
|
+
* geomSubContextId must be the geometric representation sub-context ('Body').
|
|
27
|
+
* localPlacement is accepted for call-site symmetry with the other geometry
|
|
28
|
+
* writers; tessellation placement is carried by the owning product, not by the
|
|
29
|
+
* shape representation, so it is not referenced here.
|
|
30
|
+
*/
|
|
31
|
+
export declare function writeTessellation(w: IfcWriter, solid: ValidSolid, geomSubContextId: number, _localPlacementId: number | null, toleranceMm?: number): TessellationOutput;
|
|
32
|
+
/**
|
|
33
|
+
* Builds a wall 'Axis' IfcShapeRepresentation: an IfcPolyline from (0,0) to
|
|
34
|
+
* (lengthM, 0) in the wall's local XY plane, wrapped in an IfcShapeRepresentation
|
|
35
|
+
* with RepresentationIdentifier='Axis', RepresentationType='Curve2D'. Returns
|
|
36
|
+
* the IfcShapeRepresentation express ID so callers can add it alongside the Body
|
|
37
|
+
* representation in an IfcProductDefinitionShape.
|
|
38
|
+
*
|
|
39
|
+
* wallLengthMm is the wall length in mm (brepjs native units); it is converted
|
|
40
|
+
* to metres for IFC.
|
|
41
|
+
*/
|
|
42
|
+
export declare function writeWallAxisRepresentation(w: IfcWriter, wallLengthMm: number, geomSubContextId: number): number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IfcWriter } from './ifcWriter.js';
|
|
2
|
+
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
3
|
+
export type IfcTypeName = 'IFCWALLTYPE' | 'IFCSLABTYPE' | 'IFCBEAMTYPE' | 'IFCCOLUMNTYPE' | 'IFCDOORTYPE' | 'IFCWINDOWTYPE' | 'IFCSPACETYPE' | 'IFCFOOTINGTYPE' | 'IFCPILETYPE' | 'IFCRAILINGTYPE' | 'IFCCOVERINGTYPE';
|
|
4
|
+
export interface TypeWriteResult {
|
|
5
|
+
typeExpressId: number;
|
|
6
|
+
relExpressId: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Writes one IfcXxxType plus an IfcRelDefinesByType that
|
|
10
|
+
* links it to the given occurrence expressIDs. `typeGuid`/`relGuid` are the
|
|
11
|
+
* deterministic GUIDs derived for the type object and its relationship.
|
|
12
|
+
*/
|
|
13
|
+
export declare function writeIfcType(w: IfcWriter, ownerHistoryId: number, typeName: IfcTypeName, typeGuid: IfcGuid, relGuid: IfcGuid, predefinedType: string, occurrenceExpressIds: readonly number[]): TypeWriteResult;
|