File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
core/src/measurement/MeasurementUtils Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export class MeasurementUtils extends Component {
5050 point : THREE . Vector3 ,
5151 lineStart : THREE . Vector3 ,
5252 lineEnd : THREE . Vector3 ,
53- clamp = false ,
53+ clamp = false
5454 ) {
5555 const tempLine = new THREE . Line3 ( ) ;
5656 const tempPoint = new THREE . Vector3 ( ) ;
@@ -294,7 +294,7 @@ export class MeasurementUtils extends Component {
294294 */
295295 async getVolumeFromFragments ( modelIdMap : ModelIdMap ) {
296296 console . warn (
297- "getVolumeFromFragments is deprecated. Use getItemsVolume instead." ,
297+ "getVolumeFromFragments is deprecated. Use getItemsVolume instead."
298298 ) ;
299299 return this . getItemsVolume ( modelIdMap ) ;
300300 }
@@ -395,7 +395,7 @@ export class MeasurementUtils extends Component {
395395 value : number ,
396396 fromUnit : string ,
397397 toUnit : string ,
398- precision = 2 ,
398+ precision = 2
399399 ) : number {
400400 const unitFactors : Record < string , number > = {
401401 // Length
@@ -425,13 +425,6 @@ export class MeasurementUtils extends Component {
425425
426426 let factor = unitFactors [ fromUnit ] / unitFactors [ toUnit ] ;
427427
428- // Adjust factor for area or volume conversions
429- if ( fromUnit . endsWith ( "2" ) && toUnit . endsWith ( "2" ) ) {
430- factor **= 2 ;
431- } else if ( fromUnit . endsWith ( "3" ) && toUnit . endsWith ( "3" ) ) {
432- factor **= 3 ;
433- }
434-
435428 const convertedValue = value * factor ;
436429 const roundingFactor = 10 ** precision ;
437430 return Math . round ( convertedValue * roundingFactor ) / roundingFactor ;
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ export class MeasureFill {
151151
152152 update ( ) {
153153 this . updateMesh ( ) ;
154- if ( this . area . value === 0 ) {
154+ if ( this . area . rawValue === 0 ) {
155155 this . label . visible = false ;
156156 } else {
157157 this . label . value = this . area . rawValue ;
You can’t perform that action at this time.
0 commit comments