@@ -37,6 +37,7 @@ namespace cura
3737class Comb ;
3838class SliceDataStorage ;
3939class LayerPlanBuffer ;
40+ class STHalfEdge ;
4041
4142template <typename PathType>
4243class PathAdapter ;
@@ -511,6 +512,7 @@ class LayerPlan : public NoCopy
511512 * If unset, this causes it to start near the last planned location.
512513 * \param scarf_seam Indicates whether we may use a scarf seam for the path
513514 * \param smooth_speed Indicates whether we may use a speed gradient for the path
515+ * \param texture_data_provider The texture provider to be used to place the seam
514516 */
515517 void addPolygonsByOptimizer (
516518 const Shape& polygons,
@@ -524,7 +526,29 @@ class LayerPlan : public NoCopy
524526 bool reverse_order = false,
525527 const std::optional<Point2LL> start_near_location = std::optional<Point2LL>(),
526528 bool scarf_seam = false,
527- bool smooth_acceleration = false);
529+ bool smooth_speed = false,
530+ const std::shared_ptr<TextureDataProvider>& texture_data_provider = nullptr);
531+
532+ /* !
533+ * Adds infill polygons to the gcode with optimized order.
534+ *
535+ * In case we need to generate extra inwards moves for the infill, we cannot treat them as polygons anymore, since the lines will be un-closed. Thus, the resulting open
536+ * polylines are returned in \p remaining_lines and should be re-added to the gcode, e.g. by using addLinesByOptimizer().
537+ *
538+ * @param polygons The infill polygons to be added
539+ * @param[out] remaining_lines The list to be filled with generates open polylines. The given list may be non-empty, only new lines will be appended. * @param config The
540+ * config with which to print the polygon lines
541+ * @param settings The current settings to retrieve values from
542+ * @param add_extra_inwards_move Indicates whether extra start/end inwards extrusion moves will be generated
543+ * @param near_start_location Optional: Location near where to add the first line. If not provided the last position is used.
544+ */
545+ void addInfillPolygonsByOptimizer (
546+ const Shape& polygons,
547+ OpenLinesSet& remaining_lines,
548+ const GCodePathConfig& config,
549+ const Settings& settings,
550+ const bool add_extra_inwards_move = false ,
551+ const std::optional<Point2LL>& near_start_location = std::optional<Point2LL>());
528552
529553 /* !
530554 * Add a single line that is part of a wall to the gcode.
@@ -685,6 +709,9 @@ class LayerPlan : public NoCopy
685709 * \param fan_speed optional fan speed override for this path
686710 * \param reverse_print_direction Whether to reverse the optimized order and their printing direction.
687711 * \param order_requirements Pairs where first needs to be printed before second. Pointers are pointing to elements of \p lines
712+ * \param extra_inwards_start_move_length The length of the extra inwards moves to be added at the start of each infill line
713+ * \param extra_inwards_end_move_length The length of the extra inwards moves to be added at the end of each infill line
714+ * \param extra_inwards_move_contour The contour to be considered in order to add the inwards moves
688715 */
689716 template <class LineType >
690717 void addLinesByOptimizer (
@@ -697,7 +724,10 @@ class LayerPlan : public NoCopy
697724 const std::optional<Point2LL> near_start_location = std::optional<Point2LL>(),
698725 const double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT,
699726 const bool reverse_print_direction = false,
700- const std::unordered_multimap<const Polyline*, const Polyline*>& order_requirements = PathOrderOptimizer<const Polyline*>::no_order_requirements_);
727+ const std::unordered_multimap<const Polyline*, const Polyline*>& order_requirements = PathOrderOptimizer<const Polyline*>::no_order_requirements_,
728+ const coord_t extra_inwards_start_move_length = 0,
729+ const coord_t extra_inwards_end_move_length = 0,
730+ const Shape& extra_inwards_move_contour = Shape());
701731
702732 /* !
703733 * Add lines to the gcode with optimized order.
@@ -755,7 +785,8 @@ class LayerPlan : public NoCopy
755785 const coord_t exclude_distance = 0 ,
756786 const coord_t wipe_dist = 0 ,
757787 const Ratio flow_ratio = 1 .0_r,
758- const double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT);
788+ const double fan_speed = GCodePathConfig::FAN_SPEED_DEFAULT,
789+ const bool interlaced = false );
759790
760791 /* !
761792 * Add a spiralized slice of wall that is interpolated in X/Y between \p last_wall and \p wall.
@@ -868,14 +899,55 @@ class LayerPlan : public NoCopy
868899 * \param wipe_dist (optional) the distance wiped without extruding after laying down a line.
869900 * \param flow_ratio The ratio with which to multiply the extrusion amount
870901 * \param fan_speed optional fan speed override for this path
902+ * \param extra_inwards_start_move_length The length of the extra inwards moves to be added at the start of each infill line
903+ * \param extra_inwards_end_move_length The length of the extra inwards moves to be added at the end of each infill line
904+ * \param extra_inwards_move_contour The contour to be considered in order to add the inwards moves
871905 */
872906 void addLinesInGivenOrder (
873907 const std::vector<PathOrdering<const Polyline*>>& lines,
874908 const GCodePathConfig& config,
875909 const SpaceFillType space_fill_type,
876910 const coord_t wipe_dist,
877911 const Ratio flow_ratio,
878- const double fan_speed);
912+ const double fan_speed,
913+ const coord_t extra_inwards_start_move_length = 0 ,
914+ const coord_t extra_inwards_end_move_length = 0 ,
915+ const Shape& extra_inwards_move_contour = Shape());
916+
917+ /* !
918+ * Add order optimized polygons to the gcode.
919+ * Add polygons to the gcode with optimized order.
920+ *
921+ * \param polygons The polygons.
922+ * \param config The config with which to print the polygon lines.
923+ * for each given segment (optionally nullptr).
924+ * \param settings The settings which should apply to these polygons added to the layer plan
925+ * \param z_seam_config Optional configuration for z-seam.
926+ * \param wall_0_wipe_dist The distance to travel along each polygon after
927+ * it has been laid down, in order to wipe the start and end of the wall
928+ * together.
929+ * \param spiralize Whether to gradually increase the z height from the
930+ * normal layer height to the height of the next layer over each polygon
931+ * printed.
932+ * \param flow_ratio The ratio with which to multiply the extrusion amount.
933+ * \param always_retract Whether to force a retraction when moving to the
934+ * start of the polygon (used for outer walls).
935+ * \param reverse_order Adds polygons in reverse order.
936+ * \param scarf_seam Indicates whether we may use a scarf seam for the path
937+ * \param smooth_speed Indicates whether we may use a speed gradient for the path
938+ */
939+ void addPolygonsInGivenOrder (
940+ const std::vector<PathOrdering<const Polygon*>>& polygons,
941+ const GCodePathConfig& config,
942+ const Settings& settings,
943+ const ZSeamConfig& z_seam_config = ZSeamConfig(),
944+ coord_t wall_0_wipe_dist = 0,
945+ bool spiralize = false,
946+ const Ratio flow_ratio = 1.0_r,
947+ bool always_retract = false,
948+ bool reverse_order = false,
949+ bool scarf_seam = false,
950+ bool smooth_speed = false);
879951
880952 /* !
881953 * @brief Send a GCodePath line to the communication object, applying proper Z offsets
@@ -1148,6 +1220,16 @@ class LayerPlan : public NoCopy
11481220 const std::optional<TravelAntiOozing>& priming_amounts,
11491221 const Velocity& speed,
11501222 const size_t point_index);
1223+
1224+ /* !
1225+ * Generates an extrusion move that goes as inwards as possible given a skeletized contour, starting from the given point
1226+ * @param trapezoidal_edges The edges of the skeletal trapezoidation for the contour
1227+ * @param start_point The point to start generating the move from
1228+ * @param move_inwards_length The length of the move to be generated
1229+ * @return Extrusion path to be started from the given start point, going further inwards. It may be empty if not possible or if the start point is
1230+ * already inwards the contour enough.
1231+ */
1232+ static OpenPolyline makeInwardsMove (const std::list<STHalfEdge>& trapezoidal_edges, const Point2LL& start_point, const coord_t move_inwards_length);
11511233};
11521234
11531235} // namespace cura
0 commit comments