Revert change "make_overhang_printable "

This commit is contained in:
Wang YB
2024-05-07 14:26:22 +08:00
parent c2b5393b82
commit 5368acee65
11 changed files with 1 additions and 192 deletions

View File

@@ -126,9 +126,6 @@ ironing_spacing = 0.15
ironing_speed = 30
ironing_type = top
layer_height = 0.2
make_overhang_printable = 0
make_overhang_printable_angle = 45
make_overhang_printable_hole_size = 0
max_bridge_length = 10
max_print_speed = 600
max_volumetric_extrusion_rate_slope_negative = 0

View File

@@ -758,24 +758,6 @@ Slic3r::ExPolygons diff_ex(const Slic3r::SurfacesPtr &subject, const Slic3r::Pol
{ return _clipper_ex(ClipperLib::ctDifference, ClipperUtils::SurfacesPtrProvider(subject), ClipperUtils::PolygonsProvider(clip), do_safety_offset); }
Slic3r::ExPolygons diff_ex(const Slic3r::SurfacesPtr &subject, const Slic3r::ExPolygons &clip, ApplySafetyOffset do_safety_offset)
{ return _clipper_ex(ClipperLib::ctDifference, ClipperUtils::SurfacesPtrProvider(subject), ClipperUtils::ExPolygonsProvider(clip), do_safety_offset); }
//w31
inline Slic3r::ExPolygons diff_ex(const Slic3r::Polygon& subject, const Slic3r::Polygons& clip, ApplySafetyOffset do_safety_offset)
{
Slic3r::Polygons subject_temp;
subject_temp.push_back(subject);
return diff_ex(subject_temp, clip, do_safety_offset);
}
inline Slic3r::ExPolygons diff_ex(const Slic3r::Polygon& subject, const Slic3r::Polygon& clip, ApplySafetyOffset do_safety_offset)
{
Slic3r::Polygons subject_temp;
Slic3r::Polygons clip_temp;
subject_temp.push_back(subject);
clip_temp.push_back(clip);
return diff_ex(subject_temp, clip_temp, do_safety_offset);
}
Slic3r::ExPolygons intersection_ex(const Slic3r::Polygons &subject, const Slic3r::Polygons &clip, ApplySafetyOffset do_safety_offset)
{ return _clipper_ex(ClipperLib::ctIntersection, ClipperUtils::PolygonsProvider(subject), ClipperUtils::PolygonsProvider(clip), do_safety_offset); }
@@ -795,14 +777,6 @@ Slic3r::ExPolygons intersection_ex(const Slic3r::Surfaces &subject, const Slic3r
{ return _clipper_ex(ClipperLib::ctIntersection, ClipperUtils::SurfacesProvider(subject), ClipperUtils::SurfacesProvider(clip), do_safety_offset); }
Slic3r::ExPolygons intersection_ex(const Slic3r::SurfacesPtr &subject, const Slic3r::ExPolygons &clip, ApplySafetyOffset do_safety_offset)
{ return _clipper_ex(ClipperLib::ctIntersection, ClipperUtils::SurfacesPtrProvider(subject), ClipperUtils::ExPolygonsProvider(clip), do_safety_offset); }
//w31
Slic3r::ExPolygons intersection_ex(const Slic3r::ExPolygon& subject, const Slic3r::ExPolygon& clip, ApplySafetyOffset do_safety_offset)
{ return _clipper_ex(ClipperLib::ctIntersection, ClipperUtils::ExPolygonProvider(subject), ClipperUtils::ExPolygonProvider(clip), do_safety_offset); }
Slic3r::ExPolygons intersection_ex(const Slic3r::ExPolygons& subject, const Slic3r::ExPolygon& clip, ApplySafetyOffset do_safety_offset)
{ return _clipper_ex(ClipperLib::ctIntersection, ClipperUtils::ExPolygonsProvider(subject), ClipperUtils::ExPolygonProvider(clip), do_safety_offset);}
Slic3r::ExPolygons intersection_ex(const Slic3r::ExPolygon& subject, const Slic3r::ExPolygons& clip, ApplySafetyOffset do_safety_offset)
{ return _clipper_ex(ClipperLib::ctIntersection, ClipperUtils::ExPolygonProvider(subject), ClipperUtils::ExPolygonsProvider(clip), do_safety_offset);}
// May be used to "heal" unusual models (3DLabPrints etc.) by providing fill_type (pftEvenOdd, pftNonZero, pftPositive, pftNegative).
Slic3r::ExPolygons union_ex(const Slic3r::Polygons &subject, ClipperLib::PolyFillType fill_type)
{ return _clipper_ex(ClipperLib::ctUnion, ClipperUtils::PolygonsProvider(subject), ClipperUtils::EmptyPathsProvider(), ApplySafetyOffset::No, fill_type); }
@@ -819,10 +793,6 @@ Slic3r::ExPolygons union_ex(const Slic3r::ExPolygons &subject, const Slic3r::Pol
Slic3r::ExPolygons union_ex(const Slic3r::Surfaces &subject)
{ return PolyTreeToExPolygons(clipper_do_polytree(ClipperLib::ctUnion, ClipperUtils::SurfacesProvider(subject), ClipperUtils::EmptyPathsProvider(), ClipperLib::pftNonZero)); }
//w31
Slic3r::ExPolygons xor_ex(const Slic3r::ExPolygons &subject, const Slic3r::ExPolygon &clip, ApplySafetyOffset do_safety_offset) {
return _clipper_ex(ClipperLib::ctXor, ClipperUtils::ExPolygonsProvider(subject), ClipperUtils::ExPolygonProvider(clip), do_safety_offset);
}
template<typename PathsProvider1, typename PathsProvider2>
Polylines _clipper_pl_open(ClipperLib::ClipType clipType, PathsProvider1 &&subject, PathsProvider2 &&clip)

View File

@@ -447,32 +447,6 @@ Slic3r::Polylines diff_pl(const Slic3r::Polylines &subject, const Slic3r::ExPol
Slic3r::Polylines diff_pl(const Slic3r::Polylines &subject, const Slic3r::ExPolygons &clip);
Slic3r::Polylines diff_pl(const Slic3r::Polygons &subject, const Slic3r::Polygons &clip);
//w31
inline Slic3r::ExPolygons diff_ex(const Slic3r::ExPolygon& subject, const Slic3r::ExPolygon& clip, ApplySafetyOffset do_safety_offset = ApplySafetyOffset::No)
{
Slic3r::ExPolygons subject_temp;
Slic3r::ExPolygons clip_temp;
subject_temp.push_back(subject);
clip_temp.push_back(clip);
return diff_ex(subject_temp, clip_temp);
}
inline Slic3r::ExPolygons diff_ex(const Slic3r::ExPolygon& subject, const Slic3r::ExPolygons& clip, ApplySafetyOffset do_safety_offset = ApplySafetyOffset::No)
{
Slic3r::ExPolygons subject_temp;
subject_temp.push_back(subject);
return diff_ex(subject_temp, clip, do_safety_offset);
}
inline Slic3r::ExPolygons diff_ex(const Slic3r::ExPolygons& subject, const Slic3r::ExPolygon& clip, ApplySafetyOffset do_safety_offset = ApplySafetyOffset::No)
{
Slic3r::ExPolygons clip_temp;
clip_temp.push_back(clip);
return diff_ex(subject, clip_temp, do_safety_offset);
}
inline Slic3r::Lines diff_ln(const Slic3r::Lines &subject, const Slic3r::Polygons &clip)
{
@@ -500,10 +474,6 @@ Slic3r::ExPolygons intersection_ex(const Slic3r::Surfaces &subject, const Slic3r
Slic3r::ExPolygons intersection_ex(const Slic3r::Surfaces &subject, const Slic3r::ExPolygons &clip, ApplySafetyOffset do_safety_offset = ApplySafetyOffset::No);
Slic3r::ExPolygons intersection_ex(const Slic3r::Surfaces &subject, const Slic3r::Surfaces &clip, ApplySafetyOffset do_safety_offset = ApplySafetyOffset::No);
Slic3r::ExPolygons intersection_ex(const Slic3r::SurfacesPtr &subject, const Slic3r::ExPolygons &clip, ApplySafetyOffset do_safety_offset = ApplySafetyOffset::No);
//w31
Slic3r::ExPolygons intersection_ex(const Slic3r::ExPolygon& subject, const Slic3r::ExPolygon& clip, ApplySafetyOffset do_safety_offset = ApplySafetyOffset::No);
Slic3r::ExPolygons intersection_ex(const Slic3r::ExPolygons& subject, const Slic3r::ExPolygon& clip, ApplySafetyOffset do_safety_offset = ApplySafetyOffset::No);
Slic3r::ExPolygons intersection_ex(const Slic3r::ExPolygon& subject, const Slic3r::ExPolygons& clip, ApplySafetyOffset do_safety_offset = ApplySafetyOffset::No);
Slic3r::Polylines intersection_pl(const Slic3r::Polylines &subject, const Slic3r::Polygon &clip);
Slic3r::Polylines intersection_pl(const Slic3r::Polyline &subject, const Slic3r::ExPolygon &clip);
@@ -545,9 +515,6 @@ Slic3r::ExPolygons union_ex(const Slic3r::Surfaces &subject);
ClipperLib::PolyTree union_pt(const Slic3r::Polygons &subject);
ClipperLib::PolyTree union_pt(const Slic3r::ExPolygons &subject);
//w31
Slic3r::ExPolygons xor_ex(const Slic3r::ExPolygons &subject, const Slic3r::ExPolygon &clip, ApplySafetyOffset do_safety_offset = ApplySafetyOffset::No);
Slic3r::Polygons union_pt_chained_outside_in(const Slic3r::Polygons &subject);
ClipperLib::PolyNodes order_nodes(const ClipperLib::PolyNodes &nodes);

View File

@@ -493,8 +493,6 @@ static std::vector<std::string> s_Preset_print_options {
,"max_bridge_length"
//w30
,"top_solid_infill_flow_ratio", "bottom_solid_infill_flow_ratio"
//w31
,"make_overhang_printable", "make_overhang_printable_angle", "make_overhang_printable_hole_size"
//w33
,"ironing_pattern"
};

View File

@@ -270,8 +270,6 @@ public:
&& this->config().brim_width.value > 0.
&& ! this->has_raft();
}
//w31
void apply_conical_overhang();
// This is the *total* layer count (including support layers)
// this value is not supposed to be compared with Layer::id
// since they have different semantics.

View File

@@ -3712,36 +3712,6 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
//w31
def = this->add("make_overhang_printable", coBool);
def->label = L("Make overhang printable");
def->category = L("Advanced");
def->tooltip = L("Modify the geometry to print overhangs without support material.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("make_overhang_printable_angle", coFloat);
def->label = L("Make overhang printable maximum angle");
def->category = L("Advanced");
def->tooltip = L("Maximum angle of overhangs to allow after making more steep overhangs printable."
"90° will not change the model at all and allow any overhang, while 0 will "
"replace all overhangs with conical material.");
def->sidetext = L("°");
def->mode = comAdvanced;
def->min = 0.;
def->max = 90.;
def->set_default_value(new ConfigOptionFloat(45.));
def = this->add("make_overhang_printable_hole_size", coFloat);
def->label = L("Make overhang printable hole area");
def->category = L("Advanced");
def->tooltip = L("Maximum area of a hole in the base of the model before it's filled by conical material."
"A value of 0 will fill all the holes in the model base.");
def->sidetext = L("mm²");
def->mode = comAdvanced;
def->min = 0.;
def->set_default_value(new ConfigOptionFloat(0.));
def = this->add("wall_transition_length", coFloatOrPercent);
def->label = L("Perimeter transition length");
def->category = L("Advanced");

View File

@@ -607,9 +607,6 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionBool, only_one_wall_first_layer))
//w27
((ConfigOptionBool, precise_z_height))
//w31
((ConfigOptionFloat, make_overhang_printable_angle))
((ConfigOptionFloat, make_overhang_printable_hole_size))
)
PRINT_CONFIG_CLASS_DEFINE(
@@ -678,8 +675,6 @@ PRINT_CONFIG_CLASS_DEFINE(
//w30
((ConfigOptionFloat, top_solid_infill_flow_ratio))
((ConfigOptionFloat, bottom_solid_infill_flow_ratio))
//w31
((ConfigOptionBool, make_overhang_printable))
)
PRINT_CONFIG_CLASS_DEFINE(

View File

@@ -876,11 +876,7 @@ bool PrintObject::invalidate_state_by_config_options(
//w17
|| opt_key == "top_area_threshold"
//w23
|| opt_key == "only_one_wall_first_layer"
//w31
|| opt_key == "make_overhang_printable"
|| opt_key == "make_overhang_printable_angle"
|| opt_key == "make_overhang_printable_hole_size") {
|| opt_key == "only_one_wall_first_layer") {
steps.emplace_back(posSlice);
} else if (
opt_key == "seam_position"

View File

@@ -760,9 +760,6 @@ void PrintObject::slice_volumes()
BOOST_LOG_TRIVIAL(debug) << "Slicing volumes - MMU segmentation";
apply_mm_segmentation(*this, [print]() { print->throw_if_canceled(); });
}
//w31
this->apply_conical_overhang();
m_print->throw_if_canceled();
BOOST_LOG_TRIVIAL(debug) << "Slicing volumes - make_slices in parallel - begin";
{
@@ -910,77 +907,6 @@ void PrintObject::slice_volumes()
m_print->throw_if_canceled();
BOOST_LOG_TRIVIAL(debug) << "Slicing volumes - make_slices in parallel - end";
}
//w31
void PrintObject::apply_conical_overhang()
{
BOOST_LOG_TRIVIAL(info) << "Make overhang printable...";
if (m_layers.empty()) {
return;
}
const double conical_overhang_angle = this->config().make_overhang_printable_angle;
if (conical_overhang_angle == 90.0) {
return;
}
const double angle_radians = conical_overhang_angle * M_PI / 180.;
const double max_hole_area = this->config().make_overhang_printable_hole_size;
const double tan_angle = tan(angle_radians);
BOOST_LOG_TRIVIAL(info) << "angle " << angle_radians << " maxHoleArea " << max_hole_area << " tan_angle " << tan_angle;
const coordf_t layer_thickness = m_config.layer_height.value;
const coordf_t max_dist_from_lower_layer = tan_angle * layer_thickness;
BOOST_LOG_TRIVIAL(info) << "layer_thickness " << layer_thickness << " max_dist_from_lower_layer " << max_dist_from_lower_layer;
const coordf_t scaled_max_dist_from_lower_layer = -float(scale_(max_dist_from_lower_layer));
const coordf_t scaled_max_hole_area = float(scale_(scale_(max_hole_area)));
for (auto i = m_layers.rbegin() + 1; i != m_layers.rend(); ++i) {
m_print->throw_if_canceled();
Layer *layer = *i;
Layer *upper_layer = layer->upper_layer;
if (upper_layer->empty()) {
continue;
}
if (std::all_of(layer->m_regions.begin(), layer->m_regions.end(),
[](const LayerRegion *r) { return r->slices().empty() || !r->region().config().make_overhang_printable; })) {
continue;
}
auto upper_poly = upper_layer->merged(float(SCALED_EPSILON));
upper_poly = union_ex(upper_poly);
if (scaled_max_hole_area > 0.0) {
auto current_poly = layer->merged(float(SCALED_EPSILON));
current_poly = union_ex(current_poly);
for (auto layer_polygon : current_poly) {
for (auto hole : layer_polygon.holes) {
if (std::abs(hole.area()) < scaled_max_hole_area) {
ExPolygon hole_poly(hole);
auto hole_with_above = intersection_ex(upper_poly, hole_poly);
if (!hole_with_above.empty()) {
auto hole_difference = xor_ex(hole_with_above, hole_poly);
if (hole_difference.empty()) {
upper_poly = diff_ex(upper_poly, hole_poly);
}
}
}
}
}
}
upper_poly = offset_ex(upper_poly, scaled_max_dist_from_lower_layer);
for (size_t region_id = 0; region_id < this->num_printing_regions(); ++region_id) {
if (!upper_layer->m_regions[region_id]->region().config().make_overhang_printable) {
continue;
}
auto p = intersection_ex(upper_layer->m_regions[region_id]->slices().surfaces, upper_poly);
ExPolygons layer_polygons = to_expolygons(layer->m_regions[region_id]->slices().surfaces);
layer->m_regions[region_id]->m_slices.set(union_ex(layer_polygons, p), stInternal);
}
}
}
//w12
ExPolygons PrintObject::_shrink_contour_holes(double contour_delta, double hole_delta, const ExPolygons &polys) const
{

View File

@@ -380,10 +380,6 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
bool is_top_one_wall = config->opt_enum<TopOneWallType>("top_one_wall_type") != TopOneWallType::Disable;
toggle_field("top_area_threshold", is_top_one_wall);
//w31
bool have_make_overhang_printable = config->opt_bool("make_overhang_printable");
toggle_field("make_overhang_printable_angle", have_make_overhang_printable);
toggle_field("make_overhang_printable_hole_size", have_make_overhang_printable);
}
void ConfigManipulation::toggle_print_sla_options(DynamicPrintConfig* config)

View File

@@ -1474,10 +1474,6 @@ void TabPrint::build()
optgroup->append_single_option_line("top_area_threshold");
//w23
optgroup->append_single_option_line("only_one_wall_first_layer");
//w31
optgroup->append_single_option_line("make_overhang_printable");
optgroup->append_single_option_line("make_overhang_printable_angle");
optgroup->append_single_option_line("make_overhang_printable_hole_size");
optgroup = page->new_optgroup(L("Fuzzy skin (experimental)"));
category_path = "fuzzy-skin_246186/#";