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

Fix diagonal line handling #326

Merged
merged 1 commit into from
Dec 5, 2019
Merged

Fix diagonal line handling #326

merged 1 commit into from
Dec 5, 2019

Conversation

ppiastucki
Copy link

Add special handling for diagonal lines to XAXIS in pixelateLineTouching.
It looks like due to some floating point inaccuracy diagonal lines get processed as XAXIS lines and result in non-watertight outline. I could not reproduce the issue on Mac however, I can reproduce it on Linux.

Add special handling for diagonal lines to XAXIS in
pixelateLineTouching.
Copy link
Collaborator

@blsemo blsemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Piotr,
Thanks for submitting this fix. If you have an input file to reproduce the issue, would you mind contributing that as well (along with a description), please?
Ideally, I'd like to add a regression test for this kind of error.

@ppiastucki
Copy link
Author

ppiastucki commented Dec 3, 2019

Here you are
Macos:
shapes_macos

Linux:
shapes_linux

Source DXF file
shapes.zip

Grid size: 0.2

As you can see the shapes are rendered differently and in case of Linux there are some holes when the segment is diagonal. I believe the difference between Linux and Mac OS comes from different locale settings and thus the coordinates are truncated to integers on Linux.

@ppiastucki
Copy link
Author

I have truncated the coordinates manually and now the issue can be easily reproduced on any system.
shapes_integers.dxf.zip

Copy link
Collaborator

@blsemo blsemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix and the test data!

@blsemo blsemo merged commit 98a6e1e into SpaceGroupUCL:master Dec 5, 2019
pklampros pushed a commit that referenced this pull request Sep 2, 2020
Add special handling for diagonal lines to XAXIS in
pixelateLineTouching.
@pklampros pklampros added this to the 0.8.0 milestone Oct 27, 2020
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

Successfully merging this pull request may close these issues.

3 participants