Updated the default values for wall_add_middle_threshold and wall_split_middle_threshold, which should decrease the number of missing tiny islands.

This commit is contained in:
Lukáš Hejl 2022-04-25 12:35:40 +02:00
parent 7e52650430
commit d868261399
7 changed files with 28 additions and 43 deletions

View file

@ -81,7 +81,7 @@ public:
* | | > Don't collapse this edge only.
* o o
*/
void collapseSmallEdges(coord_t snap_dist = 5000);
void collapseSmallEdges(coord_t snap_dist = 5);
void makeRib(edge_t*& prev_edge, Point start_source_point, Point end_source_point, bool is_next_to_start_or_end);

View file

@ -21,25 +21,8 @@
namespace Slic3r::Arachne
{
WallToolPaths::WallToolPaths(const Polygons& outline, const coord_t nominal_bead_width, const size_t inset_count, const coord_t wall_0_inset,
const PrintObjectConfig &print_object_config)
: outline(outline)
, bead_width_0(nominal_bead_width)
, bead_width_x(nominal_bead_width)
, inset_count(inset_count)
, wall_0_inset(wall_0_inset)
, strategy_type(print_object_config.beading_strategy_type.value)
, print_thin_walls(Slic3r::Arachne::fill_outline_gaps)
, min_feature_size(scaled<coord_t>(print_object_config.min_feature_size.value))
, min_bead_width(scaled<coord_t>(print_object_config.min_bead_width.value))
, small_area_length(static_cast<double>(nominal_bead_width) / 2.)
, toolpaths_generated(false)
, print_object_config(print_object_config)
{
}
WallToolPaths::WallToolPaths(const Polygons& outline, const coord_t bead_width_0, const coord_t bead_width_x,
const size_t inset_count, const coord_t wall_0_inset, const PrintObjectConfig &print_object_config)
const size_t inset_count, const coord_t wall_0_inset, const PrintObjectConfig &print_object_config, const PrintConfig &print_config)
: outline(outline)
, bead_width_0(bead_width_0)
, bead_width_x(bead_width_x)
@ -52,6 +35,11 @@ WallToolPaths::WallToolPaths(const Polygons& outline, const coord_t bead_width_0
, toolpaths_generated(false)
, print_object_config(print_object_config)
{
if (const auto &min_bead_width_opt = print_object_config.min_bead_width; min_bead_width_opt.percent) {
assert(!print_config.nozzle_diameter.empty());
double min_nozzle_diameter = *std::min_element(print_config.nozzle_diameter.values.begin(), print_config.nozzle_diameter.values.end());
min_bead_width = scaled<coord_t>(min_bead_width_opt.value * 0.01 * min_nozzle_diameter);
}
}
void simplify(Polygon &thiss, const int64_t smallest_line_segment_squared, const int64_t allowed_error_distance_squared)

View file

@ -23,15 +23,6 @@ constexpr coord_t meshfix_maximum_extrusion_area_deviation = scaled<coord_t>(2.)
class WallToolPaths
{
public:
/*!
* A class that creates the toolpaths given an outline, nominal bead width and maximum amount of walls
* \param outline An outline of the area in which the ToolPaths are to be generated
* \param nominal_bead_width The nominal bead width used in the generation of the toolpaths
* \param inset_count The maximum number of parallel extrusion lines that make up the wall
* \param wall_0_inset How far to inset the outer wall, to make it adhere better to other walls.
*/
WallToolPaths(const Polygons& outline, const coord_t nominal_bead_width, const size_t inset_count, const coord_t wall_0_inset, const PrintObjectConfig &print_object_config);
/*!
* A class that creates the toolpaths given an outline, nominal bead width and maximum amount of walls
* \param outline An outline of the area in which the ToolPaths are to be generated
@ -40,7 +31,7 @@ public:
* \param inset_count The maximum number of parallel extrusion lines that make up the wall
* \param wall_0_inset How far to inset the outer wall, to make it adhere better to other walls.
*/
WallToolPaths(const Polygons& outline, const coord_t bead_width_0, const coord_t bead_width_x, const size_t inset_count, const coord_t wall_0_inset, const PrintObjectConfig &print_object_config);
WallToolPaths(const Polygons& outline, coord_t bead_width_0, coord_t bead_width_x, size_t inset_count, coord_t wall_0_inset, const PrintObjectConfig &print_object_config, const PrintConfig &print_config);
/*!
* Generates the Toolpaths
@ -54,12 +45,6 @@ public:
*/
const std::vector<VariableWidthLines> &getToolPaths();
/*!
* Alternate 'get', for when the vector that'll be inserted in already exists.
* \param The already existing (or empty) paths these new toolpaths are pushed into.
*/
void pushToolPaths(std::vector<VariableWidthLines> &paths);
/*!
* Compute the inner contour of the walls. This contour indicates where the walled area ends and its infill begins.
* The inside can then be filled, e.g. with skin/infill for the walls of a part, or with a pattern in the case of

View file

@ -317,7 +317,7 @@ void PerimeterGenerator::process_arachne()
coord_t bead_width_x = perimeter_spacing;
coord_t wall_0_inset = 0;
Arachne::WallToolPaths wallToolPaths(last_p, bead_width_0, bead_width_x, coord_t(loop_number + 1), wall_0_inset, *this->object_config);
Arachne::WallToolPaths wallToolPaths(last_p, bead_width_0, bead_width_x, coord_t(loop_number + 1), wall_0_inset, *this->object_config, *this->print_config);
wallToolPaths.generate();
std::vector<Arachne::VariableWidthLines> perimeters = wallToolPaths.getToolPaths();

View file

@ -3113,7 +3113,7 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert;
def->min = 1;
def->max = 99;
def->set_default_value(new ConfigOptionPercent(90));
def->set_default_value(new ConfigOptionPercent(50));
def = this->add("wall_add_middle_threshold", coPercent);
def->label = L("Add Middle Line Threshold");
@ -3128,7 +3128,7 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert;
def->min = 1;
def->max = 99;
def->set_default_value(new ConfigOptionPercent(80));
def->set_default_value(new ConfigOptionPercent(75));
def = this->add("min_feature_size", coFloat);
def->label = L("Minimum Feature Size");
@ -3141,16 +3141,17 @@ void PrintConfigDef::init_fff_params()
def->min = 0;
def->set_default_value(new ConfigOptionFloat(0.1));
def = this->add("min_bead_width", coFloat);
def = this->add("min_bead_width", coFloatOrPercent);
def->label = L("Minimum Wall Line Width");
def->category = L("Advanced");
def->tooltip = L("Width of the wall that will replace thin features (according to the Minimum Feature Size) "
"of the model. If the Minimum Wall Line Width is thinner than the thickness of the feature,"
" the wall will become as thick as the feature itself.");
def->sidetext = L("mm");
" the wall will become as thick as the feature itself. "
"If expressed as percentage (for example 85%), it will be computed over nozzle diameter.");
def->sidetext = L("mm or %");
def->mode = comExpert;
def->min = 0;
def->set_default_value(new ConfigOptionFloat(0.2));
def->set_default_value(new ConfigOptionFloatOrPercent(85, true));
// Declare retract values for filament profile, overriding the printer's extruder profile.
for (const char *opt_key : {

View file

@ -495,7 +495,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionPercent, wall_split_middle_threshold))
((ConfigOptionPercent, wall_add_middle_threshold))
((ConfigOptionFloat, min_feature_size))
((ConfigOptionFloat, min_bead_width))
((ConfigOptionFloatOrPercent, min_bead_width))
((ConfigOptionBool, support_material))
// Automatic supports (generated based on support_material_threshold).
((ConfigOptionBool, support_material_auto))

View file

@ -317,6 +317,17 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
bool have_avoid_crossing_perimeters = config->opt_bool("avoid_crossing_perimeters");
toggle_field("avoid_crossing_perimeters_max_detour", have_avoid_crossing_perimeters);
bool have_arachne = config->opt_enum<SlicingEngine>("slicing_engine") == SlicingEngine::Arachne;
toggle_field("wall_transition_length", have_arachne);
toggle_field("wall_transition_filter_distance", have_arachne);
toggle_field("wall_transition_angle", have_arachne);
toggle_field("wall_distribution_count", have_arachne);
toggle_field("wall_split_middle_threshold", have_arachne);
toggle_field("wall_add_middle_threshold", have_arachne);
toggle_field("min_feature_size", have_arachne);
toggle_field("min_bead_width", have_arachne);
toggle_field("thin_walls", !have_arachne);
}
void ConfigManipulation::update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config/* = false*/)