From 1b60d52929961fef8bd3fea484d17e3a2e8858db Mon Sep 17 00:00:00 2001 From: miguel gutierrez Date: Sun, 11 Jan 2026 22:39:47 +0000 Subject: [PATCH 1/6] fix: remove exponentiation in unit conversion --- .../core/src/measurement/MeasurementUtils/index.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/core/src/measurement/MeasurementUtils/index.ts b/packages/core/src/measurement/MeasurementUtils/index.ts index e380a2f2d..f588ac2cf 100644 --- a/packages/core/src/measurement/MeasurementUtils/index.ts +++ b/packages/core/src/measurement/MeasurementUtils/index.ts @@ -50,7 +50,7 @@ export class MeasurementUtils extends Component { point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, - clamp = false, + clamp = false ) { const tempLine = new THREE.Line3(); const tempPoint = new THREE.Vector3(); @@ -294,7 +294,7 @@ export class MeasurementUtils extends Component { */ async getVolumeFromFragments(modelIdMap: ModelIdMap) { console.warn( - "getVolumeFromFragments is deprecated. Use getItemsVolume instead.", + "getVolumeFromFragments is deprecated. Use getItemsVolume instead." ); return this.getItemsVolume(modelIdMap); } @@ -395,7 +395,7 @@ export class MeasurementUtils extends Component { value: number, fromUnit: string, toUnit: string, - precision = 2, + precision = 2 ): number { const unitFactors: Record = { // Length @@ -425,13 +425,6 @@ export class MeasurementUtils extends Component { let factor = unitFactors[fromUnit] / unitFactors[toUnit]; - // Adjust factor for area or volume conversions - if (fromUnit.endsWith("2") && toUnit.endsWith("2")) { - factor **= 2; - } else if (fromUnit.endsWith("3") && toUnit.endsWith("3")) { - factor **= 3; - } - const convertedValue = value * factor; const roundingFactor = 10 ** precision; return Math.round(convertedValue * roundingFactor) / roundingFactor; From 571826c9ba70b57abdc6d58f09504745529c1e8b Mon Sep 17 00:00:00 2001 From: miguel gutierrez Date: Mon, 12 Jan 2026 00:53:40 +0000 Subject: [PATCH 2/6] fix(measure-mark): update label visibility status based on area rawvalue --- packages/front/src/utils/measure-fill.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/front/src/utils/measure-fill.ts b/packages/front/src/utils/measure-fill.ts index d1cfa0a23..b9ffc1e7f 100644 --- a/packages/front/src/utils/measure-fill.ts +++ b/packages/front/src/utils/measure-fill.ts @@ -151,7 +151,7 @@ export class MeasureFill { update() { this.updateMesh(); - if (this.area.value === 0) { + if (this.area.rawValue === 0) { this.label.visible = false; } else { this.label.value = this.area.rawValue; From ccf7317a8a1b6bbcb3a4c60739bfe8629e7a14ca Mon Sep 17 00:00:00 2001 From: miguel gutierrez Date: Wed, 21 Jan 2026 15:19:36 +0000 Subject: [PATCH 3/6] feat(IfcLoader): add options to include all attributes and relations --- .gitignore | 4 +++- packages/core/src/fragments/IfcLoader/index.ts | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0c89edaf2..715e8c9d9 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 8afbe047c..c71811b7f 100644 --- a/packages/core/src/fragments/IfcLoader/index.ts +++ b/packages/core/src/fragments/IfcLoader/index.ts @@ -111,6 +111,8 @@ export class IfcLoader extends Component implements Disposable { userData?: Record; processData?: Omit; instanceCallback?: (importer: FRAGS.IfcImporter) => void; + addAllAttributes?: boolean; + addAllRelations?: boolean; }, ) { const fragments = this.components.get(FragmentsManager); @@ -129,6 +131,9 @@ export class IfcLoader extends Component implements Disposable { serializer.wasm.absolute = this.settings.wasm.absolute; serializer.webIfcSettings = this.settings.webIfc; + if (config?.addAllAttributes) serializer.addAllAttributes(); + if (config?.addAllRelations) serializer.addAllRelations(); + this.onIfcImporterInitialized.trigger(serializer); if (config?.instanceCallback) config.instanceCallback(serializer); From 53ef790fd9035c32f4680f0e79a9245ae66f898e Mon Sep 17 00:00:00 2001 From: miguel gutierrez Date: Wed, 21 Jan 2026 15:26:15 +0000 Subject: [PATCH 4/6] docs(IfcLoader): document default attributes/relations and new config flags --- .../core/src/fragments/IfcLoader/index.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/core/src/fragments/IfcLoader/index.ts b/packages/core/src/fragments/IfcLoader/index.ts index c71811b7f..b92d5ff8d 100644 --- a/packages/core/src/fragments/IfcLoader/index.ts +++ b/packages/core/src/fragments/IfcLoader/index.ts @@ -90,6 +90,25 @@ 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 config options: + * - `addAllAttributes`: include all attributes + * - `addAllRelations`: include all relations + * * @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. From aba5ab446c0169d4fa1fcc32c4d7715ff173ebe8 Mon Sep 17 00:00:00 2001 From: miguel gutierrez Date: Thu, 22 Jan 2026 11:35:07 +0000 Subject: [PATCH 5/6] feat(IfcLoader): remove add all flags and rely on instance callback --- .../core/src/fragments/IfcLoader/index.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/core/src/fragments/IfcLoader/index.ts b/packages/core/src/fragments/IfcLoader/index.ts index b92d5ff8d..a9e6889b8 100644 --- a/packages/core/src/fragments/IfcLoader/index.ts +++ b/packages/core/src/fragments/IfcLoader/index.ts @@ -105,9 +105,10 @@ export class IfcLoader extends Component implements Disposable { * - ContainedInSpatialStructure (ContainsElements / ContainedInStructure) * * If you need *all* attributes or relations to be loaded, you can enable them - * via the config options: - * - `addAllAttributes`: include all attributes - * - `addAllRelations`: include all relations + * 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. @@ -119,7 +120,12 @@ export class IfcLoader extends Component implements Disposable { * @example * ```typescript * const ifcLoader = components.get(IfcLoader); - * const model = await ifcLoader.load(ifcData); + * const model = await ifcLoader.load(ifcData, true, "modelName",{ + * instanceCallback: (importer) => { + * importer.addAllAttributes(); + * importer.addAllRelations(); + * }, + * }); * ``` */ async load( @@ -130,8 +136,6 @@ export class IfcLoader extends Component implements Disposable { userData?: Record; processData?: Omit; instanceCallback?: (importer: FRAGS.IfcImporter) => void; - addAllAttributes?: boolean; - addAllRelations?: boolean; }, ) { const fragments = this.components.get(FragmentsManager); @@ -150,9 +154,6 @@ export class IfcLoader extends Component implements Disposable { serializer.wasm.absolute = this.settings.wasm.absolute; serializer.webIfcSettings = this.settings.webIfc; - if (config?.addAllAttributes) serializer.addAllAttributes(); - if (config?.addAllRelations) serializer.addAllRelations(); - this.onIfcImporterInitialized.trigger(serializer); if (config?.instanceCallback) config.instanceCallback(serializer); From 8a06e93fb32907b5a90afdb148b2fbcf314cf328 Mon Sep 17 00:00:00 2001 From: miguel gutierrez Date: Thu, 22 Jan 2026 11:38:22 +0000 Subject: [PATCH 6/6] docs: add default and advanced loading examples --- packages/core/src/fragments/IfcLoader/index.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/core/src/fragments/IfcLoader/index.ts b/packages/core/src/fragments/IfcLoader/index.ts index a9e6889b8..bd2d48a3c 100644 --- a/packages/core/src/fragments/IfcLoader/index.ts +++ b/packages/core/src/fragments/IfcLoader/index.ts @@ -118,15 +118,21 @@ export class IfcLoader extends Component implements Disposable { * @returns A Promise that resolves to the FragmentsModel containing the loaded and processed IFC data. * * @example - * ```typescript - * const ifcLoader = components.get(IfcLoader); - * const model = await ifcLoader.load(ifcData, true, "modelName",{ + * // 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); + * ``` */ async load( data: Uint8Array,