diff --git a/include/InsetOrderOptimizer.h b/include/InsetOrderOptimizer.h index b74ba5b269..7ec9f60b8d 100644 --- a/include/InsetOrderOptimizer.h +++ b/include/InsetOrderOptimizer.h @@ -140,7 +140,6 @@ class InsetOrderOptimizer * \return A vector of ExtrusionLines with walls that should be printed */ std::vector getWallsToBeAdded(const bool reverse, const bool use_one_extruder); - }; } // namespace cura diff --git a/include/LayerPlan.h b/include/LayerPlan.h index eb598e3882..a16025c5bd 100644 --- a/include/LayerPlan.h +++ b/include/LayerPlan.h @@ -292,15 +292,18 @@ class LayerPlan : public NoCopy * * Special conditions for this function are: * - If `always_retract` is true, a retraction is always performed regardless of other factors. - * - If there's an optional `next` point provided, the function adds an intermediate position where the nozzle should go to begin printing the segment with optimal nozzle speed and extrusion parameters. - * - The focus of this method is the travel move for the first wall or layer in a print action, specifically optimizing retraction, travel speed, and the starting point for extrusion, if any. + * - If there's an optional `next` point provided, the function adds an intermediate position where the nozzle should go to begin printing the segment with optimal nozzle speed + * and extrusion parameters. + * - The focus of this method is the travel move for the first wall or layer in a print action, specifically optimizing retraction, travel speed, and the starting point for + * extrusion, if any. * * Note: This function is for handling very specific cases (such as initial layer or wall) in 3D printing G-code generation and should be used appropriately. * * \param pos The point to travel to. * \param always_retract Whether to always enforce a retraction action. - * \param next the subsequent point of the segment moving towards. If provided, an intermediate travel point is added, when feasible, to optimize the start of the actual print action with proper nozzle speed and extrusion. - */ + * \param next the subsequent point of the segment moving towards. If provided, an intermediate travel point is added, when feasible, to optimize the start of the actual print + * action with proper nozzle speed and extrusion. + */ void addFirstWallTravel(const Point2LL& pos, const bool always_retract, const Point2LL* next); /*! diff --git a/include/geometry/Point2LL.h b/include/geometry/Point2LL.h index cc0a1fd3b8..e10a27d9dc 100644 --- a/include/geometry/Point2LL.h +++ b/include/geometry/Point2LL.h @@ -14,8 +14,9 @@ Integer points are used to avoid floating point rounding errors, and because Cli //#include // auto-serialization / auto-toString() #include #include -#include "numbers" + #include "geometry/Point3LL.h" +#include "numbers" #ifdef __GNUC__ #define DEPRECATED(func) func __attribute__((deprecated)) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index fc4942e9b1..ccafae6501 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -369,9 +369,9 @@ std::optional> LayerPlan::getFirstTravelDestinationSta return ret; } -void LayerPlan::addFirstWallTravel(const Point2LL& pos, const bool force_retract, const Point2LL* next) +void LayerPlan::addFirstWallTravel(const Point2LL& pos, const bool force_retract, const Point2LL* next) { - //find amount of retraction already done + // find amount of retraction already done Point2LL extrusion_start_point; // Point where extrusion needs to start const ExtruderTrain* extruder = getLastPlannedExtruderTrain(); const Settings& mesh_or_extruder_settings = current_mesh_ ? current_mesh_->settings : extruder->settings_; @@ -381,7 +381,7 @@ void LayerPlan::addFirstWallTravel(const Point2LL& pos, const bool force_retrac // First travel to intermediate position Point2LL direction = *next - pos; direction = (direction * 1000) / vSize(direction); - extrusion_start_point = pos - direction * (mesh_or_extruder_settings.get("z_seam_approach_distance")/1000); + extrusion_start_point = pos - direction * (mesh_or_extruder_settings.get("z_seam_approach_distance") / 1000); addTravel(extrusion_start_point, force_retract); } // Add simple travel to point, next will already be printed while extruding @@ -1146,7 +1146,7 @@ void LayerPlan::addWall( ExtrusionJunction p0 = wall[start_idx]; if (smooth_approach) { - addFirstWallTravel(p0.p_, always_retract, &(wall[(wall.size() + start_idx + direction) % wall.size()].p_)); + addFirstWallTravel(p0.p_, always_retract, &(wall[(wall.size() + start_idx + direction) % wall.size()].p_)); } else { @@ -1236,34 +1236,34 @@ void LayerPlan::addWall( computeDistanceToBridgeStart((start_idx + wall.size() - 1) % wall.size()); } -// if (wall_0_wipe_dist > 0 && ! is_linked_path) -// { // apply outer wall wipe -// p0 = wall[start_idx]; -// int distance_traversed = 0; -// for (unsigned int point_idx = 1;; point_idx++) -// { -// if (point_idx > wall.size() && distance_traversed == 0) // Wall has a total circumference of 0. This loop would never end. -// { -// break; // No wipe if the wall has no circumference. -// } -// ExtrusionJunction p1 = wall[(start_idx + point_idx) % wall.size()]; -// int p0p1_dist = vSize(p1 - p0); -// if (distance_traversed + p0p1_dist >= wall_0_wipe_dist) -// { -// Point2LL vector = p1.p_ - p0.p_; -// Point2LL half_way = p0.p_ + normal(vector, wall_0_wipe_dist - distance_traversed); -// addTravel_simple(half_way); -// break; -// } -// else -// { -// addTravel_simple(p1.p_); -// distance_traversed += p0p1_dist; -// } -// p0 = p1; -// } -// forceNewPathStart(); -// } + // if (wall_0_wipe_dist > 0 && ! is_linked_path) + // { // apply outer wall wipe + // p0 = wall[start_idx]; + // int distance_traversed = 0; + // for (unsigned int point_idx = 1;; point_idx++) + // { + // if (point_idx > wall.size() && distance_traversed == 0) // Wall has a total circumference of 0. This loop would never end. + // { + // break; // No wipe if the wall has no circumference. + // } + // ExtrusionJunction p1 = wall[(start_idx + point_idx) % wall.size()]; + // int p0p1_dist = vSize(p1 - p0); + // if (distance_traversed + p0p1_dist >= wall_0_wipe_dist) + // { + // Point2LL vector = p1.p_ - p0.p_; + // Point2LL half_way = p0.p_ + normal(vector, wall_0_wipe_dist - distance_traversed); + // addTravel_simple(half_way); + // break; + // } + // else + // { + // addTravel_simple(p1.p_); + // distance_traversed += p0p1_dist; + // } + // p0 = p1; + // } + // forceNewPathStart(); + // } } else {