Closed mdelanno closed 2 years ago
This bug affects all methods that use real numbers, points, vectors...
I've just created v1.1.59 pre-release which should go a long way to resolving this issue. Let me know your feedback.
Thank you for your quick response.
The class Point
should be updated as well because for example, when the PSWorkplane
constructor is called, there is a command which is issued like this:
_powerSHAPE.DoCommand("CREATE WORKPLANE SINGLE " + inputWorkplane.Origin);
Point.ToString()
is called, the x, y and z coordinates are formatted and the scientific notation can appear there.
And don't you think that using only 5 decimal places will result in a loss of precision? I would have used .ToString("G17").ToLower()
instead. G17 is the roundtrip format recommended by MS and the ToLower()
ensure that the E is in lower case, which is correctly interpreted by PowerSHAPE.
I believe PowerShape uses 6 decimal places for values. So I used a ToString("0.######") function to provide it with the amount of precision it will take.
Some code to reproduce:
The
CreateLine()
call is translated as this:PowerSHAPE interprets the
1E-5
as1
because the E is in upper case. The end point is set to 100, 1, 0. If the call was:It will work as expected (end point at 100, 0.00001, 0) because PowerSHAPE will translate 1e-5 to 0.00001
I just found this bug on one of my client projects. If it is confirmed, it is very serious because it can lead to a lot of calculation errors.
I have not tested it, but perhaps the problem can occur with very large values as well.