mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 15:38:43 +03:00
add only_one_wall_first_layer
This commit is contained in:
@@ -137,7 +137,9 @@ void LayerRegion::make_perimeters(
|
||||
m_thin_fills,
|
||||
fill_expolygons,
|
||||
//w21
|
||||
fill_no_overlap_expolygons);
|
||||
fill_no_overlap_expolygons,
|
||||
//w23
|
||||
this->layer()->id());
|
||||
else
|
||||
PerimeterGenerator::process_arachne(
|
||||
// input:
|
||||
@@ -152,7 +154,9 @@ void LayerRegion::make_perimeters(
|
||||
m_thin_fills,
|
||||
fill_expolygons,
|
||||
//w21
|
||||
fill_no_overlap_expolygons);
|
||||
fill_no_overlap_expolygons,
|
||||
//w23
|
||||
this->layer()->id());
|
||||
|
||||
else
|
||||
PerimeterGenerator::process_classic(
|
||||
@@ -169,7 +173,9 @@ void LayerRegion::make_perimeters(
|
||||
m_thin_fills,
|
||||
fill_expolygons,
|
||||
//w21
|
||||
fill_no_overlap_expolygons);
|
||||
fill_no_overlap_expolygons,
|
||||
//w23
|
||||
this->layer()->id());
|
||||
perimeter_and_gapfill_ranges.emplace_back(
|
||||
ExtrusionRange{ perimeters_begin, uint32_t(m_perimeters.size()) },
|
||||
ExtrusionRange{ gap_fills_begin, uint32_t(m_thin_fills.size()) });
|
||||
|
||||
@@ -1123,7 +1123,9 @@ void PerimeterGenerator::process_arachne(
|
||||
// Infills without the gap fills
|
||||
ExPolygons &out_fill_expolygons,
|
||||
//w21
|
||||
ExPolygons &out_fill_no_overlap)
|
||||
ExPolygons &out_fill_no_overlap,
|
||||
//w23
|
||||
const size_t layer_id)
|
||||
{
|
||||
// other perimeters
|
||||
coord_t perimeter_spacing = params.perimeter_flow.scaled_spacing();
|
||||
@@ -1151,7 +1153,8 @@ void PerimeterGenerator::process_arachne(
|
||||
Polygons last_p = to_polygons(last);
|
||||
|
||||
//w16
|
||||
if (upper_slices == nullptr && params.object_config.top_one_wall_type == TopOneWallType::Onlytopmost)
|
||||
//w23
|
||||
if ((upper_slices == nullptr && params.object_config.top_one_wall_type == TopOneWallType::Onlytopmost)||(params.object_config.only_one_wall_first_layer && layer_id == 0))
|
||||
loop_number = 0;
|
||||
|
||||
Arachne::WallToolPaths wallToolPaths(last_p, ext_perimeter_spacing, perimeter_spacing, coord_t(loop_number + 1), 0, params.layer_height, params.object_config, params.print_config);
|
||||
@@ -1388,9 +1391,11 @@ void PerimeterGenerator::process_with_one_wall_arachne(
|
||||
// Gaps without the thin walls
|
||||
ExtrusionEntityCollection & /* out_gap_fill */,
|
||||
// Infills without the gap fills
|
||||
ExPolygons &out_fill_expolygons,
|
||||
ExPolygons &out_fill_expolygons,
|
||||
//w21
|
||||
ExPolygons &out_fill_no_overlap)
|
||||
ExPolygons &out_fill_no_overlap,
|
||||
//w23
|
||||
const size_t layer_id)
|
||||
{
|
||||
// other perimeters
|
||||
coord_t perimeter_spacing = params.perimeter_flow.scaled_spacing();
|
||||
@@ -1419,6 +1424,9 @@ void PerimeterGenerator::process_with_one_wall_arachne(
|
||||
// extra perimeters for each one
|
||||
// detect how many perimeters must be generated for this island
|
||||
int loop_number = params.config.perimeters + surface.extra_perimeters - 1; // 0-indexed loops
|
||||
//w23
|
||||
if (params.object_config.only_one_wall_first_layer && layer_id == 0)
|
||||
loop_number = 0;
|
||||
ExPolygons last = offset_ex(surface.expolygon.simplify_p(params.scaled_resolution), - float(ext_perimeter_width / 2. - ext_perimeter_spacing / 2.));
|
||||
Polygons last_p = to_polygons(last);
|
||||
|
||||
@@ -1771,7 +1779,9 @@ void PerimeterGenerator::process_classic(
|
||||
// Infills without the gap fills
|
||||
ExPolygons &out_fill_expolygons,
|
||||
//w21
|
||||
ExPolygons &out_fill_no_overlap)
|
||||
ExPolygons &out_fill_no_overlap,
|
||||
//w23
|
||||
const size_t layer_id)
|
||||
{
|
||||
// other perimeters
|
||||
coord_t perimeter_width = params.perimeter_flow.scaled_width();
|
||||
@@ -1821,7 +1831,9 @@ void PerimeterGenerator::process_classic(
|
||||
double upper_nozzle_diameter = params.print_config.nozzle_diameter.get_at(params.config.perimeter_extruder - 1);
|
||||
upper_layer_polygons_cache = offset(*upper_slices, float(scale_(+upper_nozzle_diameter / 2)));
|
||||
}
|
||||
if (loop_number > 0 && params.object_config.top_one_wall_type != TopOneWallType::Disable && upper_slices == nullptr)
|
||||
//w16
|
||||
//w23
|
||||
if (loop_number > 0 && (params.object_config.top_one_wall_type != TopOneWallType::Disable && upper_slices == nullptr) || (params.object_config.only_one_wall_first_layer && layer_id == 0))
|
||||
loop_number = 0;
|
||||
if (loop_number >= 0) {
|
||||
// In case no perimeters are to be generated, loop_number will equal to -1.
|
||||
|
||||
@@ -83,7 +83,9 @@ void process_classic(
|
||||
// Infills without the gap fills
|
||||
ExPolygons &out_fill_expolygons,
|
||||
//w21
|
||||
ExPolygons &out_fill_no_overlap);
|
||||
ExPolygons &out_fill_no_overlap,
|
||||
//w23
|
||||
const size_t layer_id );
|
||||
|
||||
void process_arachne(
|
||||
// Inputs:
|
||||
@@ -100,9 +102,11 @@ void process_arachne(
|
||||
// Gaps without the thin walls
|
||||
ExtrusionEntityCollection &out_gap_fill,
|
||||
// Infills without the gap fills
|
||||
ExPolygons &out_fill_expolygons,
|
||||
ExPolygons &out_fill_expolygons,
|
||||
//w21
|
||||
ExPolygons &out_fill_no_overlap);
|
||||
ExPolygons &out_fill_no_overlap,
|
||||
//w23
|
||||
const size_t layer_id);
|
||||
|
||||
void process_with_one_wall_arachne(
|
||||
// Inputs:
|
||||
@@ -120,9 +124,11 @@ void process_with_one_wall_arachne(
|
||||
// Gaps without the thin walls
|
||||
ExtrusionEntityCollection &out_gap_fill,
|
||||
// Infills without the gap fills
|
||||
ExPolygons &out_fill_expolygons,
|
||||
ExPolygons &out_fill_expolygons,
|
||||
//w21
|
||||
ExPolygons &out_fill_no_overlap);
|
||||
ExPolygons &out_fill_no_overlap,
|
||||
//w23
|
||||
const size_t layer_id);
|
||||
|
||||
//w16
|
||||
void add_infill_contour_for_arachne(ExPolygons infill_contour,
|
||||
|
||||
@@ -481,6 +481,8 @@ static std::vector<std::string> s_Preset_print_options {
|
||||
,"top_area_threshold"
|
||||
//w21
|
||||
,"filter_top_gap_infill"
|
||||
//w23
|
||||
,"only_one_wall_first_layer"
|
||||
};
|
||||
|
||||
static std::vector<std::string> s_Preset_filament_options {
|
||||
|
||||
@@ -3628,6 +3628,13 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionPercent(100));
|
||||
|
||||
//w23
|
||||
def = this->add("only_one_wall_first_layer", coBool);
|
||||
def->label = L("Only one wall on first layer");
|
||||
def->category = L("Advanced");
|
||||
def->tooltip = L("Use only one wall on the first layer of model");
|
||||
def->set_default_value(new ConfigOptionBool(false));
|
||||
|
||||
def = this->add("wall_transition_length", coFloatOrPercent);
|
||||
def->label = L("Perimeter transition length");
|
||||
def->category = L("Advanced");
|
||||
|
||||
@@ -597,6 +597,8 @@ PRINT_CONFIG_CLASS_DEFINE(
|
||||
((ConfigOptionPercent, top_area_threshold))
|
||||
//w21
|
||||
((ConfigOptionFloat, filter_top_gap_infill))
|
||||
//w23
|
||||
((ConfigOptionBool, only_one_wall_first_layer))
|
||||
)
|
||||
|
||||
PRINT_CONFIG_CLASS_DEFINE(
|
||||
|
||||
@@ -868,7 +868,9 @@ bool PrintObject::invalidate_state_by_config_options(
|
||||
//w16
|
||||
|| opt_key == "top_one_wall_type"
|
||||
//w17
|
||||
|| opt_key == "top_area_threshold") {
|
||||
|| opt_key == "top_area_threshold"
|
||||
//w23
|
||||
|| opt_key == "only_one_wall_first_layer") {
|
||||
steps.emplace_back(posSlice);
|
||||
} else if (
|
||||
opt_key == "seam_position"
|
||||
|
||||
@@ -1472,6 +1472,8 @@ void TabPrint::build()
|
||||
optgroup->append_single_option_line("top_one_wall_type");
|
||||
//w17
|
||||
optgroup->append_single_option_line("top_area_threshold");
|
||||
//w23
|
||||
optgroup->append_single_option_line("only_one_wall_first_layer");
|
||||
|
||||
optgroup = page->new_optgroup(L("Fuzzy skin (experimental)"));
|
||||
category_path = "fuzzy-skin_246186/#";
|
||||
|
||||
Reference in New Issue
Block a user