You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following program inserts a 64-bit rectangle into a 64-bit polygon set. Then it does the same thing again, but using a polygon instead of a rectangle to represent the shape. It prints out whether each polygon set is empty following the insertion of the figure.
Expected output:
pset1 empty == 0
pset2 empty == 0
Actual output:
pset1 empty == 1
pset2 empty == 0
In other words, inserting the figure as a rectangle drops it.
Note that the figure is not dropped (and you get the expected output) if you change the values of the coordinates to fit in 32 bits.
I chased this down to winding() returning the wrong answer for polygon_90_set_data<int64_t> objects due to 64-bit overflow when calculating the area. This causes insert_vertex_sequence to treat the polygon as a hole, making it disappear.
Test program to illustrate the bug in winding() (Godbolt):
Godbolt live link
The following program inserts a 64-bit rectangle into a 64-bit polygon set. Then it does the same thing again, but using a polygon instead of a rectangle to represent the shape. It prints out whether each polygon set is empty following the insertion of the figure.
Expected output:
Actual output:
In other words, inserting the figure as a rectangle drops it.
Note that the figure is not dropped (and you get the expected output) if you change the values of the coordinates to fit in 32 bits.
The text was updated successfully, but these errors were encountered: