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

Differences depending on platform #516

Open
mbway opened this issue Aug 2, 2021 · 1 comment
Open

Differences depending on platform #516

mbway opened this issue Aug 2, 2021 · 1 comment

Comments

@mbway
Copy link
Contributor

mbway commented Aug 2, 2021

I was upgrading my machine the other day and I have tests which convert a lot of dxf files to my custom format and checks that no changes have occurred. I noticed that a few files had different output on Ubuntu 18.04 compared to 20.04.
Through some investigation it appears to be that ezdxf is creating different paths for the same ARC entity depending on what platform it is run. This is confusing as ezdxf has very few external dependencies.

platform_dependent_arc.dxf.zip

on 20.04 the curve is:

[Curve4To(end=Vec3(2737315.415602067, 53396.83064041643, 0.0), ctrl1=Vec3(2736488.915602067, 53766.86729468128, 0.0), ctrl2=Vec3(2736858.9522563317, 53396.83064041643, 0.0))]

and on 18.04 the curve is:

[Curve4To(end=Vec3(2736730.9918474164, 53638.906885765755, 0.0), ctrl1=Vec3(2736488.915602067, 54004.129211564046, 0.0), ctrl2=Vec3(2736575.993030629, 53793.90570255305, 0.0)),
 Curve4To(end=Vec3(2737315.415602067, 53396.83064041643, 0.0), ctrl1=Vec3(2736885.9906642037, 53483.90806897845, 0.0), ctrl2=Vec3(2737096.2141732145, 53396.83064041643, 0.0))]

I ran the conversion under a debugger on both platforms and the difference seems to be because the start angle differs very slightly dxf.start_angle is 180.0 on Ubuntu 20.04 but is 179.99999999999997 on Ubuntu 18.04.
This particular ARC was nested 2 levels deep in INSERTs which could be contributing to the difference. The vast majority of files were converted exactly the same on both platforms.

This isn't causing any problems but it's strange that the OS is making a difference so I thought I would mention it. If this doesn't matter to you then feel free to close the issue. If it does interest you then I may be able to investigate further, perhaps using docker to ensure the environment is clean and reproducable. I have more examples as well which may not be ARCs. I haven't looked into these yet.

@mozman
Copy link
Owner

mozman commented Aug 3, 2021

Thank you for the information. This will get annoying if these differences extend to Linux / Windows / macOS compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants