Skip to content

Commit

Permalink
Applied clang-format.
Browse files Browse the repository at this point in the history
  • Loading branch information
saumyaj3 authored and github-actions[bot] committed May 1, 2024
1 parent 7d947d1 commit a368605
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 38 deletions.
1 change: 0 additions & 1 deletion include/InsetOrderOptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class InsetOrderOptimizer
* \return A vector of ExtrusionLines with walls that should be printed
*/
std::vector<ExtrusionLine> getWallsToBeAdded(const bool reverse, const bool use_one_extruder);

};
} // namespace cura

Expand Down
11 changes: 7 additions & 4 deletions include/LayerPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*!
Expand Down
3 changes: 2 additions & 1 deletion include/geometry/Point2LL.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ Integer points are used to avoid floating point rounding errors, and because Cli
//#include <iostream> // auto-serialization / auto-toString()
#include <limits>
#include <polyclipping/clipper.hpp>
#include "numbers"

#include "geometry/Point3LL.h"
#include "numbers"

#ifdef __GNUC__
#define DEPRECATED(func) func __attribute__((deprecated))
Expand Down
64 changes: 32 additions & 32 deletions src/LayerPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ std::optional<std::pair<Point2LL, bool>> 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_;
Expand All @@ -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<coord_t>("z_seam_approach_distance")/1000);
extrusion_start_point = pos - direction * (mesh_or_extruder_settings.get<coord_t>("z_seam_approach_distance") / 1000);
addTravel(extrusion_start_point, force_retract);
}
// Add simple travel to point, next will already be printed while extruding
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit a368605

Please sign in to comment.