diff --git a/.gitignore b/.gitignore index 0c89edaf..715e8c9d 100644 --- a/.gitignore +++ b/.gitignore @@ -141,4 +141,6 @@ resources/asdf2.json resources/umdasch/ app -node-app \ No newline at end of file +node-app + +.DS_Store \ No newline at end of file diff --git a/packages/core/src/fragments/IfcLoader/index.ts b/packages/core/src/fragments/IfcLoader/index.ts index 8afbe047..bd2d48a3 100644 --- a/packages/core/src/fragments/IfcLoader/index.ts +++ b/packages/core/src/fragments/IfcLoader/index.ts @@ -90,6 +90,26 @@ export class IfcLoader extends Component implements Disposable { /** * Loads an IFC file and processes it for 3D visualization. * + * By default, the loader imports a minimal set of attributes and relations + * needed for typical visualization workflows. + * + * **Default attributes** + * - Base entities: Project, Site, Building, BuildingStorey + * - Materials: IFC material definitions and layers + * - Properties: Property Sets, quantities (area, volume, length, etc.) + * + * **Default relations** + * - DefinesByProperties (IsDefinedBy / DefinesOccurrence) + * - AssociatesMaterial (HasAssociations / AssociatedTo) + * - Aggregates (IsDecomposedBy / Decomposes) + * - ContainedInSpatialStructure (ContainsElements / ContainedInStructure) + * + * If you need *all* attributes or relations to be loaded, you can enable them + * via the `instanceCallback`. + * + * The callback provides direct access to the underlying `IfcImporter`, + * allowing advanced configuration before processing begins. + * * @param data - The Uint8Array containing the IFC file data. * @param coordinate - Boolean indicating whether to coordinate the loaded IFC data. Default is true. * @param name - Name for the fragments model. @@ -98,6 +118,17 @@ export class IfcLoader extends Component implements Disposable { * @returns A Promise that resolves to the FragmentsModel containing the loaded and processed IFC data. * * @example + * // Load all attributes and relations using the instanceCallback + * ```ts + * const model = await ifcLoader.load(ifcData, true, "modelName", { + * instanceCallback: (importer) => { + * importer.addAllAttributes(); + * importer.addAllRelations(); + * }, + * }); + * ``` + * @example + * // Default loading (built-in attributes and relations only) * ```typescript * const ifcLoader = components.get(IfcLoader); * const model = await ifcLoader.load(ifcData);