opensim-core
opensim-core copied to clipboard
Large number of decimals in OpenSim 4 file format
Floating point numbers stored in .osim files contain an unnecessary large number of decimals places. This clutters up the .osim file and makes it more difficult to edit by hand.
For example, a via point at location (0.038, 0.022, -0.012)
is stored as:
<location>0.038000002503395081 0.02199999988079071 -0.012000000104308128</location>
The extra decimal points are not significant and only decrease legibility. Instead, I would like to see it stored simply as:
<location>0.038 0.022 -0.012</location>
This issue is present only since OpenSim 4 -- OpenSim 3 does not have this issue.
This boils down to using the raw unformatted conversion on the simbody side which is not context aware, we could possibly change the format options for the stream but none of the off-shelf options seems to produce reasonable results. Please point out the choices you make in scone if better and we'll assess @tgeijten