mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
Merge branch 'master' of https://github.com/QIDITECH/QIDISlicer
This commit is contained in:
@@ -2993,6 +2993,10 @@ Polylines FillGrid::fill_surface(const Surface *surface, const FillParams ¶m
|
|||||||
{ { 0.f, 0.f }, { float(M_PI / 2.), 0.f } },
|
{ { 0.f, 0.f }, { float(M_PI / 2.), 0.f } },
|
||||||
polylines_out))
|
polylines_out))
|
||||||
BOOST_LOG_TRIVIAL(error) << "FillGrid::fill_surface() failed to fill a region.";
|
BOOST_LOG_TRIVIAL(error) << "FillGrid::fill_surface() failed to fill a region.";
|
||||||
|
//w18 reverse fill path
|
||||||
|
if (this->layer_id % 2 == 1)
|
||||||
|
for (int i = 0; i < polylines_out.size(); i++)
|
||||||
|
std::reverse(polylines_out[i].begin(), polylines_out[i].end());
|
||||||
return polylines_out;
|
return polylines_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1302,9 +1302,14 @@ void PerimeterGenerator::process_arachne(
|
|||||||
out_loops.append(extrusion_coll);
|
out_loops.append(extrusion_coll);
|
||||||
|
|
||||||
ExPolygons infill_contour = union_ex(wallToolPaths.getInnerContour());
|
ExPolygons infill_contour = union_ex(wallToolPaths.getInnerContour());
|
||||||
|
//w17
|
||||||
const coord_t spacing = (perimeters.size() == 1) ? ext_perimeter_spacing2 : perimeter_spacing;
|
const coord_t spacing = (perimeters.size() == 1) ? ext_perimeter_spacing2 : perimeter_spacing;
|
||||||
if (offset_ex(infill_contour, -float(spacing / 2.)).empty())
|
if (offset_ex(infill_contour, -float(spacing / 2.)).empty())
|
||||||
infill_contour.clear(); // Infill region is too small, so let's filter it out.
|
infill_contour.clear(); // Infill region is too small, so let's filter it out.
|
||||||
|
coord_t perimeter_width = params.perimeter_flow.scaled_width();
|
||||||
|
double min_width_top_surface = (params.object_config.top_area_threshold / 100) *
|
||||||
|
std::max(double(ext_perimeter_spacing / 4 + 10), double(perimeter_width / 4));
|
||||||
|
infill_contour = offset2_ex(infill_contour, -min_width_top_surface, min_width_top_surface + perimeter_width);
|
||||||
|
|
||||||
// create one more offset to be used as boundary for fill
|
// create one more offset to be used as boundary for fill
|
||||||
// we offset by half the perimeter spacing (to get to the actual infill boundary)
|
// we offset by half the perimeter spacing (to get to the actual infill boundary)
|
||||||
@@ -1440,7 +1445,8 @@ void PerimeterGenerator::process_with_one_wall_arachne(
|
|||||||
std::max(ext_perimeter_spacing, perimeter_width));
|
std::max(ext_perimeter_spacing, perimeter_width));
|
||||||
infill_contour = diff_ex(infill_contour, bridge_area);
|
infill_contour = diff_ex(infill_contour, bridge_area);
|
||||||
}
|
}
|
||||||
double min_width_top_surface = std::max(double(ext_perimeter_spacing / 4 + 10), double(perimeter_width / 4));
|
//w17
|
||||||
|
double min_width_top_surface = (params.object_config.top_area_threshold / 100) * std::max(double(ext_perimeter_spacing / 4 + 10), double(perimeter_width / 4));
|
||||||
infill_contour = offset2_ex(infill_contour, -min_width_top_surface, min_width_top_surface + perimeter_width);
|
infill_contour = offset2_ex(infill_contour, -min_width_top_surface, min_width_top_surface + perimeter_width);
|
||||||
|
|
||||||
ExPolygons surface_not_export_to_top = diff_ex(the_layer_surface, infill_contour);
|
ExPolygons surface_not_export_to_top = diff_ex(the_layer_surface, infill_contour);
|
||||||
@@ -1784,7 +1790,7 @@ void PerimeterGenerator::process_classic(
|
|||||||
//w16
|
//w16
|
||||||
ExPolygons fill_clip;
|
ExPolygons fill_clip;
|
||||||
ExPolygons top_fills;
|
ExPolygons top_fills;
|
||||||
if (loop_number > 0 && params.object_config.top_one_wall_type != TopOneWallType::None && upper_slices == nullptr)
|
if (loop_number > 0 && params.object_config.top_one_wall_type != TopOneWallType::Disable && upper_slices == nullptr)
|
||||||
loop_number = 0;
|
loop_number = 0;
|
||||||
if (loop_number >= 0) {
|
if (loop_number >= 0) {
|
||||||
// In case no perimeters are to be generated, loop_number will equal to -1.
|
// In case no perimeters are to be generated, loop_number will equal to -1.
|
||||||
@@ -1891,7 +1897,8 @@ void PerimeterGenerator::process_classic(
|
|||||||
0.9 * (params.config.perimeters.value <= 1 ? 0. : (perimeter_spacing * (params.config.perimeters.value - 1))));
|
0.9 * (params.config.perimeters.value <= 1 ? 0. : (perimeter_spacing * (params.config.perimeters.value - 1))));
|
||||||
else
|
else
|
||||||
offset_top_surface = 0;
|
offset_top_surface = 0;
|
||||||
double min_width_top_surface = (100) *
|
//w17
|
||||||
|
double min_width_top_surface = (params.object_config.top_area_threshold/100 ) *
|
||||||
std::max(double(ext_perimeter_spacing / 2 + 10), 1.0 * (double(perimeter_width)));
|
std::max(double(ext_perimeter_spacing / 2 + 10), 1.0 * (double(perimeter_width)));
|
||||||
BoundingBox last_box = get_extents(last);
|
BoundingBox last_box = get_extents(last);
|
||||||
last_box.offset(SCALED_EPSILON);
|
last_box.offset(SCALED_EPSILON);
|
||||||
|
|||||||
@@ -477,6 +477,8 @@ static std::vector<std::string> s_Preset_print_options {
|
|||||||
,"seam_gap"
|
,"seam_gap"
|
||||||
//w16
|
//w16
|
||||||
, "top_one_wall_type"
|
, "top_one_wall_type"
|
||||||
|
//w17
|
||||||
|
,"top_area_threshold"
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::vector<std::string> s_Preset_filament_options {
|
static std::vector<std::string> s_Preset_filament_options {
|
||||||
|
|||||||
@@ -237,9 +237,9 @@ static t_config_enum_values s_keys_map_PerimeterGeneratorType {
|
|||||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PerimeterGeneratorType)
|
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PerimeterGeneratorType)
|
||||||
|
|
||||||
//w16
|
//w16
|
||||||
static t_config_enum_values s_keys_map_TopOneWallType{{"not apply", int(TopOneWallType::None)},
|
static t_config_enum_values s_keys_map_TopOneWallType{{"disable", int(TopOneWallType::Disable)},
|
||||||
{"all top", int(TopOneWallType::Alltop)},
|
{"all_top", int(TopOneWallType::Alltop)},
|
||||||
{"Only top most", int(TopOneWallType::Onlytopmost)}};
|
{"only_top_most", int(TopOneWallType::Onlytopmost)}};
|
||||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(TopOneWallType)
|
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(TopOneWallType)
|
||||||
|
|
||||||
static void assign_printer_technology_to_unknown(t_optiondef_map &options, PrinterTechnology printer_technology)
|
static void assign_printer_technology_to_unknown(t_optiondef_map &options, PrinterTechnology printer_technology)
|
||||||
@@ -3543,12 +3543,22 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->category = L("Layers and Perimeters");
|
def->category = L("Layers and Perimeters");
|
||||||
def->tooltip = L("Use only one wall on flat top surface, to give more space to the top infill pattern. Could be applyed on topmost surface or all top surface.");
|
def->tooltip = L("Use only one wall on flat top surface, to give more space to the top infill pattern. Could be applyed on topmost surface or all top surface.");
|
||||||
def->set_enum<TopOneWallType>({
|
def->set_enum<TopOneWallType>({
|
||||||
{ "none", L("None") },
|
{ "disable", L("Disable") },
|
||||||
{ "Only top most", L("Onlytopmost") },
|
{ "all_top", L("All top") },
|
||||||
{ "all top", L("Alltop") }
|
{ "only_top_most", L("Only top most") }
|
||||||
});
|
});
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
def->set_default_value(new ConfigOptionEnum<TopOneWallType>(TopOneWallType::None));
|
def->set_default_value(new ConfigOptionEnum<TopOneWallType>(TopOneWallType::Alltop));
|
||||||
|
|
||||||
|
//w17
|
||||||
|
def = this->add("top_area_threshold", coPercent);
|
||||||
|
def->label = L("Top area threshold");
|
||||||
|
def->tooltip = L("This factor affects the acreage of top area. The small the number the big the top area.");
|
||||||
|
def->sidetext = L("%");
|
||||||
|
def->min = 0;
|
||||||
|
def->max = 500;
|
||||||
|
def->mode = comAdvanced;
|
||||||
|
def->set_default_value(new ConfigOptionPercent(100));
|
||||||
|
|
||||||
def = this->add("wall_transition_length", coFloatOrPercent);
|
def = this->add("wall_transition_length", coFloatOrPercent);
|
||||||
def->label = L("Perimeter transition length");
|
def->label = L("Perimeter transition length");
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ enum class PerimeterGeneratorType
|
|||||||
enum class GCodeThumbnailsFormat { QIDI,PNG, JPG, QOI };
|
enum class GCodeThumbnailsFormat { QIDI,PNG, JPG, QOI };
|
||||||
|
|
||||||
//w16
|
//w16
|
||||||
enum class TopOneWallType { None, Alltop, Onlytopmost };
|
enum class TopOneWallType { Disable, Alltop, Onlytopmost };
|
||||||
|
|
||||||
#define CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(NAME) \
|
#define CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(NAME) \
|
||||||
template<> const t_config_enum_names& ConfigOptionEnum<NAME>::get_enum_names(); \
|
template<> const t_config_enum_names& ConfigOptionEnum<NAME>::get_enum_names(); \
|
||||||
@@ -592,6 +592,8 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||||||
((ConfigOptionBool, detect_narrow_internal_solid_infill))
|
((ConfigOptionBool, detect_narrow_internal_solid_infill))
|
||||||
//w16
|
//w16
|
||||||
((ConfigOptionEnum<TopOneWallType>, top_one_wall_type))
|
((ConfigOptionEnum<TopOneWallType>, top_one_wall_type))
|
||||||
|
//w17
|
||||||
|
((ConfigOptionPercent, top_area_threshold))
|
||||||
)
|
)
|
||||||
|
|
||||||
PRINT_CONFIG_CLASS_DEFINE(
|
PRINT_CONFIG_CLASS_DEFINE(
|
||||||
|
|||||||
@@ -865,8 +865,10 @@ bool PrintObject::invalidate_state_by_config_options(
|
|||||||
|| opt_key == "wall_distribution_count"
|
|| opt_key == "wall_distribution_count"
|
||||||
|| opt_key == "min_feature_size"
|
|| opt_key == "min_feature_size"
|
||||||
|| opt_key == "min_bead_width"
|
|| opt_key == "min_bead_width"
|
||||||
//w15
|
//w16
|
||||||
|| opt_key == "top_one_wall_type"){
|
|| opt_key == "top_one_wall_type"
|
||||||
|
//w17
|
||||||
|
|| opt_key == "top_area_threshold") {
|
||||||
steps.emplace_back(posSlice);
|
steps.emplace_back(posSlice);
|
||||||
} else if (
|
} else if (
|
||||||
opt_key == "seam_position"
|
opt_key == "seam_position"
|
||||||
|
|||||||
@@ -1469,6 +1469,8 @@ void TabPrint::build()
|
|||||||
optgroup->append_single_option_line("perimeter_generator");
|
optgroup->append_single_option_line("perimeter_generator");
|
||||||
//w16
|
//w16
|
||||||
optgroup->append_single_option_line("top_one_wall_type");
|
optgroup->append_single_option_line("top_one_wall_type");
|
||||||
|
//w17
|
||||||
|
optgroup->append_single_option_line("top_area_threshold");
|
||||||
|
|
||||||
optgroup = page->new_optgroup(L("Fuzzy skin (experimental)"));
|
optgroup = page->new_optgroup(L("Fuzzy skin (experimental)"));
|
||||||
category_path = "fuzzy-skin_246186/#";
|
category_path = "fuzzy-skin_246186/#";
|
||||||
|
|||||||
Reference in New Issue
Block a user