Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,6 @@ resources/asdf2.json
resources/umdasch/

app
node-app
node-app

.DS_Store
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helps macOS devs avoid accidentally pushing this system file

31 changes: 31 additions & 0 deletions packages/core/src/fragments/IfcLoader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
Expand Down