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
13 changes: 3 additions & 10 deletions packages/core/src/measurement/MeasurementUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -395,7 +395,7 @@ export class MeasurementUtils extends Component {
value: number,
fromUnit: string,
toUnit: string,
precision = 2,
precision = 2
): number {
const unitFactors: Record<string, number> = {
// Length
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/front/src/utils/measure-fill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down