Skip to content

Commit

Permalink
Classic for first layer WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
vovodroid committed Sep 22, 2024
1 parent 6addaca commit 091da40
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/libslic3r/Fill/Fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
std::vector<SurfaceFill> surface_fills = group_fills(*this);
const Slic3r::BoundingBox bbox = this->object()->bounding_box();
const auto resolution = this->object()->print()->config().gcode_resolution.value;
const auto perimeter_generator = this->object()->config().perimeter_generator;
const auto perimeter_generator = this->id() == 0 && this->object()->config().first_layer_generator_classic ? PerimeterGeneratorType::Arachne : this->object()->config().perimeter_generator;

#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
{
Expand Down Expand Up @@ -550,7 +550,8 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
params.anchor_length = surface_fill.params.anchor_length;
params.anchor_length_max = surface_fill.params.anchor_length_max;
params.resolution = resolution;
params.use_arachne = (perimeter_generator == PerimeterGeneratorType::Arachne && pattern == ipConcentric) || surface_fill.params.pattern == ipEnsuring;
params.use_arachne = ((perimeter_generator == PerimeterGeneratorType::Arachne && pattern == ipConcentric) || surface_fill.params.pattern == ipEnsuring)
&& !(layerm.layer()->id() == 0 && this->object()->config().first_layer_generator_classic);
params.layer_height = layerm.layer()->height;
params.prefer_clockwise_movements = this->object()->print()->config().prefer_clockwise_movements;

Expand Down
3 changes: 2 additions & 1 deletion src/libslic3r/LayerRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ void LayerRegion::make_perimeters(
auto perimeters_begin = uint32_t(m_perimeters.size());
auto gap_fills_begin = uint32_t(m_thin_fills.size());
auto fill_expolygons_begin = uint32_t(fill_expolygons.size());
if (this->layer()->object()->config().perimeter_generator.value == PerimeterGeneratorType::Arachne && !spiral_vase)
if (this->layer()->object()->config().perimeter_generator.value == PerimeterGeneratorType::Arachne && !spiral_vase &&
!(this->layer()->id()==0 && this->layer()->object()->config().first_layer_generator_classic))
PerimeterGenerator::process_arachne(
// input:
params,
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/Preset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ static std::vector<std::string> s_Preset_print_options {
"wipe_tower_width", "wipe_tower_cone_angle", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_bridging", "single_extruder_multi_material_priming", "mmu_segmented_region_max_width",
"mmu_segmented_region_interlocking_depth", "wipe_tower_extruder", "wipe_tower_no_sparse_layers", "wipe_tower_extra_flow", "wipe_tower_extra_spacing", "compatible_printers", "compatible_printers_condition", "inherits",
"perimeter_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle",
"first_layer_generator_classic",
"wall_distribution_count", "min_feature_size", "min_bead_width",
"max_bead_width",
"top_one_perimeter_type", "only_one_perimeter_first_layer",
Expand Down
7 changes: 7 additions & 0 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3814,6 +3814,13 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnum<PerimeterGeneratorType>(PerimeterGeneratorType::Arachne));

def = this->add("first_layer_generator_classic", coBool);
def->label = L("Use classic for first layer");
def->category = L("Layers and Perimeters");
def->tooltip = L("Use classic perimeter for first layer.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));

def = this->add("wall_transition_length", coFloatOrPercent);
def->label = L("Perimeter transition length");
def->category = L("Advanced");
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ PRINT_CONFIG_CLASS_DEFINE(
((ConfigOptionFloat, slice_closing_radius))
((ConfigOptionEnum<SlicingMode>, slicing_mode))
((ConfigOptionEnum<PerimeterGeneratorType>, perimeter_generator))
((ConfigOptionBool, first_layer_generator_classic))
((ConfigOptionFloatOrPercent, wall_transition_length))
((ConfigOptionFloatOrPercent, wall_transition_filter_deviation))
((ConfigOptionFloat, wall_transition_angle))
Expand Down
1 change: 1 addition & 0 deletions src/libslic3r/PrintObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,7 @@ bool PrintObject::invalidate_state_by_config_options(
steps.emplace_back(posSupportMaterial);
} else if (
opt_key == "perimeter_generator"
|| opt_key == "first_layer_generator_classic"
|| opt_key == "wall_transition_length"
|| opt_key == "wall_transition_filter_deviation"
|| opt_key == "wall_transition_angle"
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1466,6 +1466,7 @@ void TabPrint::build()
optgroup->append_single_option_line("internal_first_on_overhangs", category_path + "external-perimeters-first");
optgroup->append_single_option_line("gap_fill_enabled", category_path + "fill-gaps");
optgroup->append_single_option_line("perimeter_generator");
optgroup->append_single_option_line("first_layer_generator_classic");

optgroup = page->new_optgroup(L("Fuzzy skin (experimental)"));
category_path = "fuzzy-skin_246186/#";
Expand Down

0 comments on commit 091da40

Please sign in to comment.