Open3DMotionGroup / Open3DMotion

Other
5 stars 2 forks source link

XMove should not use scientific notation in floating point values #61

Closed drjrm closed 7 months ago

drjrm commented 7 months ago

Certain values close to zero may currently be output in XMove files as 5.68434e-14 or similar. Some XML readers do not support scientific notation and for most applications it is not required, so it would be better to remove this possibility. Display of no more than 8 decimal places is typically fine without scientific notation.

drjrm commented 7 months ago

For the moment we implement this using std::fixed and then default behaviour of operator << for streaming of floating point values to text.

drjrm commented 7 months ago

This issue was raised in relation to text parameters, not time sequences expressed via XMLWritingMachine::WriteExtendedData which was not outputting scientific notation anyway. However it is notable that the format string in WriteExtendedData was %f even though double values are input. Although tests passed this is corrected to %lf as part of this issue, to avoid future compatibility problems.