mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 17:25:53 +08:00
ArcWelder: Disabled for pressure equalizer.
Fixed some compiler warnings
This commit is contained in:
parent
c74eb1abe0
commit
e0baccd654
@ -799,14 +799,29 @@ std::vector<const PrintInstance*> sort_object_instances_by_model_order(const Pri
|
|||||||
return instances;
|
return instances;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool arc_welder_enabled(const PrintConfig& print_config)
|
||||||
|
{
|
||||||
|
return
|
||||||
|
// Enabled
|
||||||
|
print_config.arc_fitting != ArcFittingType::Disabled &&
|
||||||
|
// Not a spiral vase print
|
||||||
|
!print_config.spiral_vase &&
|
||||||
|
// Presure equalizer not used
|
||||||
|
print_config.max_volumetric_extrusion_rate_slope_negative == 0. &&
|
||||||
|
print_config.max_volumetric_extrusion_rate_slope_positive == 0.;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline GCode::SmoothPathCache::InterpolationParameters interpolation_parameters(const PrintConfig& print_config)
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
scaled<double>(print_config.gcode_resolution.value),
|
||||||
|
arc_welder_enabled(print_config) ? Geometry::ArcWelder::default_arc_length_percent_tolerance : 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static inline GCode::SmoothPathCache smooth_path_interpolate_global(const Print& print)
|
static inline GCode::SmoothPathCache smooth_path_interpolate_global(const Print& print)
|
||||||
{
|
{
|
||||||
const GCode::SmoothPathCache::InterpolationParameters interpolation_params {
|
const GCode::SmoothPathCache::InterpolationParameters interpolation_params = interpolation_parameters(print.config());
|
||||||
scaled<double>(print.config().gcode_resolution.value),
|
|
||||||
print.config().arc_fitting != ArcFittingType::Disabled && ! print.config().spiral_vase ?
|
|
||||||
Geometry::ArcWelder::default_arc_length_percent_tolerance :
|
|
||||||
0
|
|
||||||
};
|
|
||||||
GCode::SmoothPathCache out;
|
GCode::SmoothPathCache out;
|
||||||
out.interpolate_add(print.skirt(), interpolation_params);
|
out.interpolate_add(print.skirt(), interpolation_params);
|
||||||
out.interpolate_add(print.brim(), interpolation_params);
|
out.interpolate_add(print.brim(), interpolation_params);
|
||||||
@ -1282,12 +1297,7 @@ void GCodeGenerator::process_layers(
|
|||||||
GCodeOutputStream &output_stream)
|
GCodeOutputStream &output_stream)
|
||||||
{
|
{
|
||||||
size_t layer_to_print_idx = 0;
|
size_t layer_to_print_idx = 0;
|
||||||
const GCode::SmoothPathCache::InterpolationParameters interpolation_params {
|
const GCode::SmoothPathCache::InterpolationParameters interpolation_params = interpolation_parameters(print.config());
|
||||||
scaled<double>(print.config().gcode_resolution.value),
|
|
||||||
print.config().arc_fitting != ArcFittingType::Disabled && ! print.config().spiral_vase ?
|
|
||||||
Geometry::ArcWelder::default_arc_length_percent_tolerance :
|
|
||||||
0
|
|
||||||
};
|
|
||||||
const auto smooth_path_interpolator = tbb::make_filter<void, std::pair<size_t, GCode::SmoothPathCache>>(slic3r_tbb_filtermode::serial_in_order,
|
const auto smooth_path_interpolator = tbb::make_filter<void, std::pair<size_t, GCode::SmoothPathCache>>(slic3r_tbb_filtermode::serial_in_order,
|
||||||
[this, &print, &layers_to_print, &layer_to_print_idx, &interpolation_params](tbb::flow_control &fc) -> std::pair<size_t, GCode::SmoothPathCache> {
|
[this, &print, &layers_to_print, &layer_to_print_idx, &interpolation_params](tbb::flow_control &fc) -> std::pair<size_t, GCode::SmoothPathCache> {
|
||||||
if (layer_to_print_idx >= layers_to_print.size()) {
|
if (layer_to_print_idx >= layers_to_print.size()) {
|
||||||
@ -1385,12 +1395,7 @@ void GCodeGenerator::process_layers(
|
|||||||
GCodeOutputStream &output_stream)
|
GCodeOutputStream &output_stream)
|
||||||
{
|
{
|
||||||
size_t layer_to_print_idx = 0;
|
size_t layer_to_print_idx = 0;
|
||||||
const GCode::SmoothPathCache::InterpolationParameters interpolation_params {
|
const GCode::SmoothPathCache::InterpolationParameters interpolation_params = interpolation_parameters(print.config());
|
||||||
scaled<double>(print.config().gcode_resolution.value),
|
|
||||||
print.config().arc_fitting != ArcFittingType::Disabled && ! print.config().spiral_vase ?
|
|
||||||
Geometry::ArcWelder::default_arc_length_percent_tolerance :
|
|
||||||
0
|
|
||||||
};
|
|
||||||
const auto smooth_path_interpolator = tbb::make_filter<void, std::pair<size_t, GCode::SmoothPathCache>> (slic3r_tbb_filtermode::serial_in_order,
|
const auto smooth_path_interpolator = tbb::make_filter<void, std::pair<size_t, GCode::SmoothPathCache>> (slic3r_tbb_filtermode::serial_in_order,
|
||||||
[this, &print, &layers_to_print, &layer_to_print_idx, interpolation_params](tbb::flow_control &fc) -> std::pair<size_t, GCode::SmoothPathCache> {
|
[this, &print, &layers_to_print, &layer_to_print_idx, interpolation_params](tbb::flow_control &fc) -> std::pair<size_t, GCode::SmoothPathCache> {
|
||||||
if (layer_to_print_idx >= layers_to_print.size()) {
|
if (layer_to_print_idx >= layers_to_print.size()) {
|
||||||
|
@ -2711,12 +2711,16 @@ void GCodeProcessor::process_G2_G3(const GCodeReader::GCodeLine& line, bool cloc
|
|||||||
|
|
||||||
// relative center
|
// relative center
|
||||||
Vec3f rel_center = Vec3f::Zero();
|
Vec3f rel_center = Vec3f::Zero();
|
||||||
|
#ifndef _NDEBUG
|
||||||
double radius = 0.0;
|
double radius = 0.0;
|
||||||
|
#endif // _NDEBUG
|
||||||
if (fitting == EFitting::R) {
|
if (fitting == EFitting::R) {
|
||||||
float r;
|
float r;
|
||||||
if (!line.has_value('R', r) || r == 0.0f)
|
if (!line.has_value('R', r) || r == 0.0f)
|
||||||
return;
|
return;
|
||||||
|
#ifndef _NDEBUG
|
||||||
radius = (double)std::abs(r);
|
radius = (double)std::abs(r);
|
||||||
|
#endif // _NDEBUG
|
||||||
const Vec2f start_pos((float)m_start_position[X], (float)m_start_position[Y]);
|
const Vec2f start_pos((float)m_start_position[X], (float)m_start_position[Y]);
|
||||||
const Vec2f end_pos((float)end_position[X], (float)end_position[Y]);
|
const Vec2f end_pos((float)end_position[X], (float)end_position[Y]);
|
||||||
const Vec2f c = Geometry::ArcWelder::arc_center(start_pos, end_pos, r, !clockwise);
|
const Vec2f c = Geometry::ArcWelder::arc_center(start_pos, end_pos, r, !clockwise);
|
||||||
|
@ -645,7 +645,7 @@ std::pair<Path, Path> split_at(const Path &path, const PathSegmentProjection &pr
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assert(split_segment_id >= 0 && split_segment_id < path.size());
|
assert(split_segment_id >= 0 && split_segment_id < path.size());
|
||||||
if (split_segment_id + 1 == path.size())
|
if (split_segment_id + 1 == int(path.size()))
|
||||||
out.first = path;
|
out.first = path;
|
||||||
else if (split_segment_id == 0)
|
else if (split_segment_id == 0)
|
||||||
out.second = path;
|
out.second = path;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user