PDA

View Full Version : Strange numerical anomaly - can anyone explain?



Aww167
11-06-2016, 02:36 PM
Hi there,
I wonder if anyone could cast light on a strange issue that's baffling me? I won't pretend this is of vital importance or someone will (quite rightly I think) be recommending some kind of enforced behavioural therapy, but nevertheless this has me baffled as it should have a logical answer and despite having exercised my capabilities extensively, Iím still none the wiser.
I'm working on an architectural model from a floorplan with specific metric dimensions which is working out well, though I just came across a strange anomaly with the measure points tool when checking some dimensions. I took a measurement along a length of wall (Z axis) which results in a nice round whole number (i.e. no fractional digits). As there's a window part-way along the wall I made cuts at the relevant points and removed the section for the window itself. I then cross-checked the measurement of the added sections with that of the entire length, which as any competent 8 year old would be able to tell me, should be exactly the same. The anomaly is that when adding the sections individually there's a discrepancy of -0.0001mm - against the entire length measurement which remains the same whole number. The anomaly is consistent because moving any one of the affected vertex by the fraction in question makes a difference to the individual section measurements but doesn't eliminate the anomaly - it just gets transferred to one of the other sections even though the entire length measurement remains the same throughout. I thought this could be due to an off-axis vertex point somewhere, but nothing is out on either the X or Y axis by so much as a nano- meter.
Maybe I've just got too much time on my hands - probably true actually as I'm enjoying a really nice break from work right now so this could be an omen that it's time to get back to gainful employment if this is how things turn out, but my need for total order is, well, very total indeed , I mean for goodness sakes, wasn't maths invented by us humans to operate in an orderly and logical fashion ??!! - so given that LW resolves measurements to such a fine degree, and the maths engine appears to be both consistent and accurate to the same degree throughout generally, does anyone have any idea what would explain this strange discrepancy? ... or is this just a bug inserted to deliberately frustrate anyone who actually works to such a detailed numerical resolution?
I hope this hasnít spoiled an otherwise enjoyable Sunday evening for anyone (like it's spoiled mineÖ.)

rustythe1
11-06-2016, 04:36 PM
lightwave displays less dec points than it actually reads and then rounds things up and down in some displays so you can type in 1.00000000000001 and it will display 1.001, but if you typed this no. in to say a box dimension, the box dimension would be correct, it would just display differently if you measured it. so what you are seeing may be a rounded off measurement when you measure.

pinkmouse
11-06-2016, 05:01 PM
Yup, rounding errors in CPU floating point maths.

Aww167
11-07-2016, 04:30 AM
lightwave displays less dec points than it actually reads and then rounds things up and down in some displays so you can type in 1.00000000000001 and it will display 1.001, but if you typed this no. in to say a box dimension, the box dimension would be correct, it would just display differently if you measured it. so what you are seeing may be a rounded off measurement when you measure.


Yup, rounding errors in CPU floating point maths.

Thanks, I appreciate the reply. It's handy to know a thing or two about the underlying structure, and I'm certainly no mathematician but I rely heavily on being able to input specific numbers to get the results I desire, so it does throw me a bit when I see these 'errors', which if I understand you correctly aren't errors as such, just variations in the way the numbers are displayed. Thanks - my calm and serenity is now fully restored.:)

jwiede
11-07-2016, 06:53 PM
which if I understand you correctly aren't errors as such, just variations in the way the numbers are displayed

Technically, it could be either, and unfortunately, there's no easy way to determine which it is. I'd suggest saving and confirming the geometry dimensions in a CAD program, or a 3D pkg know to use exclusively double-precision FP math. LW uses single-precision FP math in some annoying ways, and sometimes that leads to it capturing imprecision in geometry that become visible when viewed in a double-precision FP math-using 3D pkg or CAD pgm.