Fixed asserts and calculations in calculateExtrusionAreaDeviationError.

The previous method worked just for near collinear edges. But it was also used for sharp corners, and for those sharp corners, there was an overflow in the computation of weighted width.
Also, the computation of deviation error was wrong for those sharp corners.

(cherry picked from commit 89b9f702d6cd59bc64c93687bc086f17a206cd0b)
This commit is contained in:
Lukáš Hejl 2023-03-29 21:21:22 +02:00 committed by SoftFever
parent 374f78c768
commit f2c3174896
2 changed files with 13 additions and 24 deletions

View file

@ -186,9 +186,8 @@ struct ExtrusionLine
* \param A Start point of the 3-point-straight line
* \param B Intermediate point of the 3-point-straight line
* \param C End point of the 3-point-straight line
* \param weighted_average_width The weighted average of the widths of the two colinear extrusion segments
* */
static int64_t calculateExtrusionAreaDeviationError(ExtrusionJunction A, ExtrusionJunction B, ExtrusionJunction C, coord_t& weighted_average_width);
static int64_t calculateExtrusionAreaDeviationError(ExtrusionJunction A, ExtrusionJunction B, ExtrusionJunction C);
bool is_contour() const;