diff --git a/resources/data/printer_gantries/geometries.json b/resources/data/printer_gantries/geometries.json index 1d8a7b24bb..ed55f5642d 100644 --- a/resources/data/printer_gantries/geometries.json +++ b/resources/data/printer_gantries/geometries.json @@ -66,6 +66,14 @@ { "height": "7", "type": "convex", + "polygons": [ + "-48,-15; 24,-15; 24,66; -48,66", + "-37,-47; 40,-47; 40,21; -37,21" + ] + }, + { + "height": "32", + "type": "convex", "polygons": [ "-49,7; 27,7; 27,83; -49,83", "-42,-46; 40,-46; 40,14; -42,14" @@ -192,14 +200,14 @@ "type": "convex", "polygons": [ "-10,-47;34,-47;34,16;-10,16", - "-34,13;32,13;32,67;-34,67" + "-43,11;28,11;28,66;-43,66" ] }, { "height": "23", "type": "convex", "polygons": [ - "-42,11;32,11;32,66;-42,66", + "-43,11;28,11;28,66;-43,66", "-33,-37;43,-37;43,18;-33,18", "-13,-68;47,-68;47,-30;-13,-30" ] @@ -208,7 +216,7 @@ "height": "19", "type": "box", "polygons": [ - "-400,24;400,24;400,50;-400,50" + "-400,24;400,24;400,59;-400,59" ] }, { @@ -263,7 +271,7 @@ "height": "33", "type": "box", "polygons": [ - "-300,-49; 300,-49; 300,-24; -300,-24" + "-300,-49; 300,-49; 300,-19; -300,-19" ] }, { diff --git a/resources/data/printer_gantries/prusa3d_coreone_gantry.stl b/resources/data/printer_gantries/prusa3d_coreone_gantry.stl index e8e0294078..cde5efc1bd 100644 Binary files a/resources/data/printer_gantries/prusa3d_coreone_gantry.stl and b/resources/data/printer_gantries/prusa3d_coreone_gantry.stl differ diff --git a/resources/data/printer_gantries/prusa3d_xl_gantry.stl b/resources/data/printer_gantries/prusa3d_xl_gantry.stl index 0fb888d4e5..f08c16e139 100644 Binary files a/resources/data/printer_gantries/prusa3d_xl_gantry.stl and b/resources/data/printer_gantries/prusa3d_xl_gantry.stl differ diff --git a/src/libseqarrange/src/seq_preprocess.cpp b/src/libseqarrange/src/seq_preprocess.cpp index a1e117d224..ab1318dc77 100644 --- a/src/libseqarrange/src/seq_preprocess.cpp +++ b/src/libseqarrange/src/seq_preprocess.cpp @@ -470,6 +470,15 @@ Slic3r::Polygon scaleUp_PolygonForSlicer(coord_t scale_factor, const Polygon &po } +Slic3r::Polygon truncate_PolygonAsSeenBySequentialSolver(coord_t scale_factor, const Slic3r::Polygon &polygon) +{ + Slic3r::Polygon scale_down_polygon = scaleDown_PolygonForSequentialSolver(scale_factor, polygon); + Slic3r::Polygon scale_up_polygon = scaleUp_PolygonForSlicer(scale_factor, scale_down_polygon); + + return scale_up_polygon; +} + + void ground_PolygonByBoundingBox(Slic3r::Polygon &polygon) { BoundingBox polygon_box = get_extents(polygon); @@ -610,9 +619,30 @@ void decimate_PolygonForSequentialSolver(double DP_tolerance, { if (extra_safety) { - grow_PolygonForContainedness(center_x, center_y, decimated_polygon); + Slic3r::Polygon prefinal_polygon = decimated_polygon; + + while (true) + { + grow_PolygonForContainedness(center_x, center_y, decimated_polygon); + Slic3r::Polygon truncated_polygon = truncate_PolygonAsSeenBySequentialSolver(SEQ_SLICER_SCALE_FACTOR, decimated_polygon); + + bool trunc_contains = true; + for (unsigned int i = 0; i < prefinal_polygon.points.size(); ++i) + { + if (!Slic3r::contains(truncated_polygon, prefinal_polygon.points[i], false)) + { + trunc_contains = false; + break; + } + } + + if (trunc_contains) + { + return; + } + } } - break; + return; } } } diff --git a/src/libseqarrange/src/seq_preprocess.hpp b/src/libseqarrange/src/seq_preprocess.hpp index 6cd68641bd..ccf14242fb 100644 --- a/src/libseqarrange/src/seq_preprocess.hpp +++ b/src/libseqarrange/src/seq_preprocess.hpp @@ -106,7 +106,9 @@ Slic3r::Polygon scaleUp_PolygonForSlicer(const Slic3r::Polygon &polygon); Slic3r::Polygon scaleUp_PolygonForSlicer(coord_t scale_factor, const Slic3r::Polygon &polygon); Slic3r::Polygon scaleUp_PolygonForSlicer(const Slic3r::Polygon &polygon, double x_pos, double y_pos); -Slic3r::Polygon scaleUp_PolygonForSlicer(coord_t scale_factor, const Slic3r::Polygon &polygon, double x_pos, double y_pos); +Slic3r::Polygon scaleUp_PolygonForSlicer(coord_t scale_factor, const Slic3r::Polygon &polygon, double x_pos, double y_pos); + +Slic3r::Polygon truncate_PolygonAsSeenBySequentialSolver(coord_t scale_factor, const Slic3r::Polygon &polygon); void ground_PolygonByBoundingBox(Slic3r::Polygon &polygon); void ground_PolygonByFirstPoint(Slic3r::Polygon &polygon);