SpaceGroupUCL / depthmapX

depthmapX is a multi-platform Spatial Network Analysis Software
197 stars 52 forks source link

Fix diagonal line handling #326

Closed ppiastucki closed 4 years ago

ppiastucki commented 4 years ago

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.

ppiastucki commented 4 years ago

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 commented 4 years ago

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