Skip to content

Commit

Permalink
ENH: clip the organic supports outside bed
Browse files Browse the repository at this point in the history
1. Clip the organic supports outside bed.
jira: STUDIO-7061, STUDIO-7211, STUDIO-8076,
github: #4175, #4769
2. Move raft_first_layer_density outside raft section. raft_first_layer_density controls both raft and support first layer density.
jira: STUDIO-8083
github: #4773

Change-Id: I6a1300787cef917a9c1395707ef50aaf6dad66e5
  • Loading branch information
ArthurBambulab authored and lanewei120 committed Oct 15, 2024
1 parent a45a2ee commit 2c6a6ae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
12 changes: 9 additions & 3 deletions src/libslic3r/Support/TreeSupport3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4331,6 +4331,11 @@ static void generate_support_areas(Print &print, TreeSupport* tree_support, cons
SupportGeneratorLayersPtr raft_layers = generate_raft_base(print_object, support_params, print_object.slicing_parameters(), top_contacts, interface_layers, base_interface_layers, intermediate_layers, layer_storage);
SupportGeneratorLayersPtr layers_sorted = generate_support_layers(print_object, raft_layers, bottom_contacts, top_contacts, intermediate_layers, interface_layers, base_interface_layers);

// BBS: This is a hack to avoid the support being generated outside the bed area. See #4769.
for (SupportGeneratorLayer *layer : layers_sorted) {
if (layer) layer->polygons = intersection(layer->polygons, volumes.m_bed_area);
}

// Don't fill in the tree supports, make them hollow with just a single sheath line.
print.set_status(69, _L("Generating support"));
generate_support_toolpaths(print_object.support_layers(), print_object.config(), support_params, print_object.slicing_parameters(),
Expand Down Expand Up @@ -4584,9 +4589,10 @@ void organic_draw_branches(
std::vector<Polygons> slices = slice_mesh(partial_mesh, slice_z, mesh_slicing_params, throw_on_cancel);
bottom_contacts.clear();
//FIXME parallelize?
for (LayerIndex i = 0; i < LayerIndex(slices.size()); ++i)
slices[i] = diff_clipped(slices[i], volumes.getCollision(0, layer_begin + i, true)); //FIXME parent_uses_min || draw_area.element->state.use_min_xy_dist);

for (LayerIndex i = 0; i < LayerIndex(slices.size()); ++i) {
slices[i] = diff_clipped(slices[i], volumes.getCollision(0, layer_begin + i, true)); // FIXME parent_uses_min || draw_area.element->state.use_min_xy_dist);
slices[i] = intersection(slices[i], volumes.m_bed_area);
}
size_t num_empty = 0;
if (slices.front().empty()) {
// Some of the initial layers are empty.
Expand Down
2 changes: 0 additions & 2 deletions src/slic3r/GUI/ConfigManipulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,8 +682,6 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
toggle_field("support_filament", have_support_material || have_skirt);

toggle_line("raft_contact_distance", have_raft && !have_support_soluble);
for (auto el : { "raft_first_layer_density"})
toggle_line(el, have_raft);

bool has_ironing = (config->opt_enum<IroningType>("ironing_type") != IroningType::NoIroning);
for (auto el : {
Expand Down
6 changes: 3 additions & 3 deletions src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2047,7 +2047,7 @@ void TabPrint::build()

page = add_options_page(L("Support"), "support");
optgroup = page->new_optgroup(L("Support"), L"param_support");
optgroup->append_single_option_line("enable_support", "support");
optgroup->append_single_option_line("enable_support", "support");
optgroup->append_single_option_line("support_type", "support#support-types");
optgroup->append_single_option_line("support_style", "support#support-styles");
optgroup->append_single_option_line("support_threshold_angle", "support#threshold-angle");
Expand All @@ -2059,7 +2059,6 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Raft"), L"param_raft");
optgroup->append_single_option_line("raft_layers");
optgroup->append_single_option_line("raft_contact_distance");
optgroup->append_single_option_line("raft_first_layer_density");

optgroup = page->new_optgroup(L("Support filament"), L"param_support_filament");
optgroup->append_single_option_line("support_filament", "support#support-filament");
Expand All @@ -2070,7 +2069,8 @@ void TabPrint::build()

//BBS
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
optgroup->append_single_option_line("raft_first_layer_expansion"); // not only for raft, but for support too
optgroup->append_single_option_line("raft_first_layer_density"); // not only for raft, but for support too
optgroup->append_single_option_line("raft_first_layer_expansion"); // not only for raft, but for support too
optgroup->append_single_option_line("tree_support_wall_count");
optgroup->append_single_option_line("support_top_z_distance", "support#top-z-distance");
optgroup->append_single_option_line("support_bottom_z_distance", "support#bottom-z-distance");
Expand Down

0 comments on commit 2c6a6ae

Please sign in to comment.