Open ChrisVilches opened 1 year ago
Polygon intersection is incorrect.
It was fixed in the Rust repository here: https://github.com/ChrisVilches/Polygonal-Puzzle/blob/main/src/shapes/polygon.rs
One of the lines that looked like this (there were two):
if th2 > EPS && th2 < th - EPS {
was changed to:
if th2 >= 0_f64 && th2 < th - EPS {
And then it worked.
In the C++ solution in this repository, I still haven't updated the code.
Despite the intersection being wrong, the result was the same, because the polygon was very symmetric.
Correct result (before updating the line, one polygon was on top of the other one, intersecting at some vertices):
Polygon intersection is incorrect.
It was fixed in the Rust repository here: https://github.com/ChrisVilches/Polygonal-Puzzle/blob/main/src/shapes/polygon.rs
One of the lines that looked like this (there were two):
was changed to:
And then it worked.
In the C++ solution in this repository, I still haven't updated the code.
Despite the intersection being wrong, the result was the same, because the polygon was very symmetric.
Correct result (before updating the line, one polygon was on top of the other one, intersecting at some vertices):