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; 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;