Fixed bug in polygon test within printable area - the test is going to be removed anyway.

This commit is contained in:
surynek 2025-02-06 11:36:53 +01:00 committed by Lukas Matena
parent edc82445f5
commit 6480d8cf12
2 changed files with 13 additions and 10 deletions

View File

@ -286,6 +286,7 @@ bool check_ScheduledObjectsForSequentialPrintability(const SolverConfiguration
printf("Line check ...\n");
}
#endif
if (!check_PolygonLineIntersections(dec_values_X,
dec_values_Y,
dec_values_T,

View File

@ -985,15 +985,17 @@ bool check_PolygonPositionWithinPlate(const SolverConfiguration &solver_configur
}
#endif
if (x + polygon_box.min.x() < solver_configuration.plate_bounding_box.min.x() * scale_factor || x + polygon_box.max.x() > solver_configuration.plate_bounding_box.max.x() * scale_factor)
if (solver_configuration.plate_bounding_polygon.points.size() == 0)
{
return false;
if (x + polygon_box.min.x() < solver_configuration.plate_bounding_box.min.x() * scale_factor || x + polygon_box.max.x() > solver_configuration.plate_bounding_box.max.x() * scale_factor)
{
return false;
}
if (y + polygon_box.min.y() < solver_configuration.plate_bounding_box.min.y() * scale_factor || y + polygon_box.max.y() > solver_configuration.plate_bounding_box.max.y() * scale_factor)
{
return false;
}
}
if (y + polygon_box.min.y() < solver_configuration.plate_bounding_box.min.y() * scale_factor || y + polygon_box.max.y() > solver_configuration.plate_bounding_box.max.y() * scale_factor)
{
return false;
}
else
{
Polygon plate_polygon = solver_configuration.plate_bounding_polygon;