Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to Transform results in loss of precision #2800

Closed
timglewis opened this issue Jul 25, 2023 · 0 comments · Fixed by #2815
Closed

Changes to Transform results in loss of precision #2800

timglewis opened this issue Jul 25, 2023 · 0 comments · Fixed by #2815
Assignees
Labels
bug Something isn't working objects issues related to the objects kit.

Comments

@timglewis
Copy link
Contributor

timglewis commented Jul 25, 2023

The conversion of the Transform class to use System.Numerics.Matrix4x4 results in a loss of precision as this uses floats instead of doubles.

The change was introduced in #2159.

Whilst this loss of precision may be fine when working with local coordinate transformations, it isn't if you want to place objects accurately in geospatial applications.

Request has been made to change the System.Numerics.Matrix4x4 API here, but doesn't appear to be being addressed anytime soon.

dotnet/runtime#24168

Possible alternative solution is to use the Silk.NET library as mentioned in the comments of the issue above:

https://www.nuget.org/packages/Silk.NET.Maths

@timglewis timglewis added the bug Something isn't working label Jul 25, 2023
@teocomi teocomi added the objects issues related to the objects kit. label Jul 27, 2023
@AlanRynne AlanRynne linked a pull request Jul 31, 2023 that will close this issue
JR-Morgan added a commit that referenced this issue Aug 17, 2023
* Added System.DoubleNumerics to the core project
Converted Transform.cs to use System.DoubleNumerics
Added a new TransformTests.cs file to test the new transform class
Changed Converters to use System.DoubleNumerics

* Adds handling of new System.DoubleNumerics matrix4x4 to serializer and deserializer

* Update ConverterNavisworks.Geometry.cs

* updates transform methods in rhino and revit

* test(core): Tests matrix serialisation

* Added log for backwards compatibility usage

---------

Co-authored-by: Claire Kuang <[email protected]>
Co-authored-by: Jedd Morgan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working objects issues related to the objects kit.
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants