/** * IFC5 (IFCX) Exporter * * Converts an IfcDataStore (from IFC2X3/IFC4/IFC4X3 STEP files) to the * IFC5 IFCX JSON format with USD geometry. * * This performs full schema conversion: * - Entity type mapping to IFC5 (aligned with IFC4X3 naming) * - Properties converted to IFCX attribute namespaces * - Tessellated geometry converted to USD mesh format * - Spatial hierarchy mapped to IFCX path-based structure */ import type { IfcDataStore } from '@ifc-lite/parser'; import type { MutablePropertyView } from '@ifc-lite/mutations'; import type { GeometryResult } from '@ifc-lite/geometry'; /** * Property names that have official IFC5 schema definitions in prop@v5a.ifcx. * Source: https://github.com/buildingSMART/ifcx.dev/blob/main/@standards.buildingsmart.org/ifc/core/prop@v5a.ifcx * * IFC4 properties NOT in this set (e.g. Reference, LoadBearing, ExtendToStructure) * must be omitted from IFC5 export — the viewer reports "Missing schema" errors for them. * * Name and Description are handled separately (always exported), so they're excluded here. */ export declare const IFC5_KNOWN_PROP_NAMES: Set; /** Options for IFC5 export */ export interface Ifc5ExportOptions { /** Author name */ author?: string; /** Data version identifier */ dataVersion?: string; /** Include geometry as USD meshes (default: true) */ includeGeometry?: boolean; /** Include properties (default: true) */ includeProperties?: boolean; /** Apply mutations (default: true if mutation view provided) */ applyMutations?: boolean; /** Pretty print JSON (default: true) */ prettyPrint?: boolean; /** Only export visible entities */ visibleOnly?: boolean; /** Hidden entity IDs (local expressIds) */ hiddenEntityIds?: Set; /** Isolated entity IDs (local expressIds, null = no isolation) */ isolatedEntityIds?: Set | null; /** Only export properties with known IFC5 schemas (default: true). * When false, all IFC4 properties are exported even if they lack * an official IFC5 schema definition (viewer may show warnings). */ onlyKnownProperties?: boolean; /** Only export entities reachable from the spatial tree (default: true). * When true, relationship entities (IfcRel*), type objects, materials, * and other non-spatial entities are excluded from the output. */ onlyTreeEntities?: boolean; } /** Result of IFC5 export */ export interface Ifc5ExportResult { /** IFCX JSON content */ content: string; /** Statistics */ stats: { nodeCount: number; propertyCount: number; meshCount: number; fileSize: number; }; } /** * Exports IFC data (from any schema) to IFC5 IFCX JSON format. */ export declare class Ifc5Exporter { private dataStore; private mutationView; private geometryResult; private idOffset; /** Unique child name per entity (with _ suffix when siblings collide) */ private childNames; /** Real names from SpatialNode tree (reliable for spatial containers) */ private spatialNodeNames; /** Spatial container children (Project→Sites, Site→Buildings, etc.) */ private spatialChildIds; /** UUID path for each entity expressId */ private entityUuids; constructor(dataStore: IfcDataStore, geometryResult?: GeometryResult | null, mutationView?: MutablePropertyView, idOffset?: number); /** * Export to IFCX JSON format */ export(options?: Ifc5ExportOptions): Ifc5ExportResult; /** Find the entity table index for a given expressId. */ private findEntityIndex; /** * Build UUID paths and child-name maps for all entities. * * IFCX uses flat UUID paths (not hierarchical). Hierarchy is expressed * solely via the `children` dict on each node. This method: * 1. Assigns a UUID to every entity (using GlobalId when available) * 2. Builds the spatial parent→children map * 3. Computes unique child names for the children dict keys */ private buildEntityMaps; /** * Get properties for an entity, converted to IFCX attribute format. */ private getPropertiesForEntity; /** * Convert a property value to IFCX-compatible format. * IFCX uses native JSON types rather than IFC wrapped types. */ private convertPropertyValue; /** * Get children for a spatial entity. * IFCX children format: { childName: childUuid } */ private getChildrenForEntity; /** * Build mesh lookup from GeometryResult, keyed by original expressId. */ private buildMeshLookup; /** * Convert tessellated MeshData (Y-up) to USD mesh format (Z-up). * Merges multiple mesh fragments for the same entity. */ private convertToUsdMesh; /** * Build the set of entity IDs reachable from the spatial tree. * Includes Project, Site, Building, Storey, Space, and all contained elements. */ private buildTreeEntitySet; /** * Build visible entity set if visibility filtering is requested. */ private buildVisibleSet; } //# sourceMappingURL=ifc5-exporter.d.ts.map