mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 12:45:54 +08:00
FDM supports: One more fix of the new solid interface base
This commit is contained in:
parent
31913ba11b
commit
eb1471427c
@ -2311,11 +2311,10 @@ std::pair<PrintObjectSupportMaterial::MyLayersPtr, PrintObjectSupportMaterial::M
|
|||||||
return &layer_new;
|
return &layer_new;
|
||||||
};
|
};
|
||||||
tbb::parallel_for(tbb::blocked_range<int>(0, int(intermediate_layers.size())),
|
tbb::parallel_for(tbb::blocked_range<int>(0, int(intermediate_layers.size())),
|
||||||
[this, &bottom_contacts, &top_contacts, &intermediate_layers, &insert_layer, num_interface_layers, num_interface_layers_only,
|
[this, &bottom_contacts, &top_contacts, &intermediate_layers, &insert_layer, num_interface_layers, num_base_interface_layers, num_interface_layers_only,
|
||||||
&interface_layers, &base_interface_layers](const tbb::blocked_range<int>& range) {
|
&interface_layers, &base_interface_layers](const tbb::blocked_range<int>& range) {
|
||||||
|
// Gather the top / bottom contact layers intersecting with num_interface_layers resp. num_interface_layers_only intermediate layers above / below
|
||||||
// gather the number of layers below/above object
|
// this intermediate layer.
|
||||||
// FIX The algorithm calculates top_z/bottom_z coordinates refered to the conctacts and above them polygons are projected.
|
|
||||||
// Index of the first top contact layer intersecting the current intermediate layer.
|
// Index of the first top contact layer intersecting the current intermediate layer.
|
||||||
auto idx_top_contact_first = -1;
|
auto idx_top_contact_first = -1;
|
||||||
// Index of the first bottom contact layer intersecting the current intermediate layer.
|
// Index of the first bottom contact layer intersecting the current intermediate layer.
|
||||||
@ -2324,11 +2323,20 @@ std::pair<PrintObjectSupportMaterial::MyLayersPtr, PrintObjectSupportMaterial::M
|
|||||||
for (int idx_intermediate_layer = range.begin(); idx_intermediate_layer < range.end(); ++ idx_intermediate_layer) {
|
for (int idx_intermediate_layer = range.begin(); idx_intermediate_layer < range.end(); ++ idx_intermediate_layer) {
|
||||||
MyLayer &intermediate_layer = *intermediate_layers[idx_intermediate_layer];
|
MyLayer &intermediate_layer = *intermediate_layers[idx_intermediate_layer];
|
||||||
// Top / bottom Z coordinate of a slab, over which we are collecting the top / bottom contact surfaces
|
// Top / bottom Z coordinate of a slab, over which we are collecting the top / bottom contact surfaces
|
||||||
// Indexing is further corrected by the existing contacts, that are interface layers as well.
|
|
||||||
coordf_t top_z = intermediate_layers[std::min(num_intermediate - 1, idx_intermediate_layer + num_interface_layers - 1)]->print_z;
|
coordf_t top_z = intermediate_layers[std::min(num_intermediate - 1, idx_intermediate_layer + num_interface_layers - 1)]->print_z;
|
||||||
coordf_t top_inteface_z = intermediate_layers[std::min(num_intermediate - 1, idx_intermediate_layer + num_interface_layers_only - 1)]->print_z;
|
coordf_t top_inteface_z = std::numeric_limits<coordf_t>::max();
|
||||||
coordf_t bottom_z = intermediate_layers[std::max(0, idx_intermediate_layer - num_interface_layers + 1)]->bottom_z;
|
coordf_t bottom_z = intermediate_layers[std::max(0, idx_intermediate_layer - num_interface_layers + 1)]->bottom_z;
|
||||||
coordf_t bottom_interface_z = intermediate_layers[std::max(0, idx_intermediate_layer - num_interface_layers_only + 1)]->bottom_z;
|
coordf_t bottom_interface_z = - std::numeric_limits<coordf_t>::max();
|
||||||
|
if (num_base_interface_layers > 0) {
|
||||||
|
// Some base interface layers will be generated.
|
||||||
|
if (num_interface_layers_only == 0)
|
||||||
|
// Only base interface layers to generate.
|
||||||
|
std::swap(top_inteface_z, bottom_interface_z);
|
||||||
|
else {
|
||||||
|
top_inteface_z = intermediate_layers[std::min(num_intermediate - 1, idx_intermediate_layer + num_interface_layers_only - 1)]->print_z;
|
||||||
|
bottom_interface_z = intermediate_layers[std::max(0, idx_intermediate_layer - num_interface_layers_only)]->bottom_z;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Move idx_top_contact_first up until above the current print_z.
|
// Move idx_top_contact_first up until above the current print_z.
|
||||||
idx_top_contact_first = idx_higher_or_equal(top_contacts, idx_top_contact_first, [&intermediate_layer](const MyLayer *layer){ return layer->print_z >= intermediate_layer.print_z; }); // - EPSILON
|
idx_top_contact_first = idx_higher_or_equal(top_contacts, idx_top_contact_first, [&intermediate_layer](const MyLayer *layer){ return layer->print_z >= intermediate_layer.print_z; }); // - EPSILON
|
||||||
// Collect the top contact areas above this intermediate layer, below top_z.
|
// Collect the top contact areas above this intermediate layer, below top_z.
|
||||||
@ -2336,7 +2344,7 @@ std::pair<PrintObjectSupportMaterial::MyLayersPtr, PrintObjectSupportMaterial::M
|
|||||||
Polygons polygons_top_contact_projected_base;
|
Polygons polygons_top_contact_projected_base;
|
||||||
for (int idx_top_contact = idx_top_contact_first; idx_top_contact < int(top_contacts.size()); ++ idx_top_contact) {
|
for (int idx_top_contact = idx_top_contact_first; idx_top_contact < int(top_contacts.size()); ++ idx_top_contact) {
|
||||||
const MyLayer &top_contact_layer = *top_contacts[idx_top_contact];
|
const MyLayer &top_contact_layer = *top_contacts[idx_top_contact];
|
||||||
//FIXME maybe this adds one interface layer in excess? removed?
|
//FIXME maybe this adds one interface layer in excess?
|
||||||
if (top_contact_layer.bottom_z - EPSILON > top_z)
|
if (top_contact_layer.bottom_z - EPSILON > top_z)
|
||||||
break;
|
break;
|
||||||
polygons_append(top_contact_layer.bottom_z - EPSILON > top_inteface_z ? polygons_top_contact_projected_base : polygons_top_contact_projected_interface, top_contact_layer.polygons);
|
polygons_append(top_contact_layer.bottom_z - EPSILON > top_inteface_z ? polygons_top_contact_projected_base : polygons_top_contact_projected_interface, top_contact_layer.polygons);
|
||||||
|
@ -201,10 +201,9 @@ private:
|
|||||||
const MyLayersPtr &base_layers,
|
const MyLayersPtr &base_layers,
|
||||||
MyLayerStorage &layer_storage) const;
|
MyLayerStorage &layer_storage) const;
|
||||||
|
|
||||||
// New method allows base interface support, also
|
// Turn some of the base layers into base interface layers.
|
||||||
// Turn some of the base layers into interface layers for number_base_interface_layers == 0.
|
// For soluble interfaces with non-soluble bases, print maximum two first interface layers with the base
|
||||||
// Create base type interface layers under soluble interfaces to extend adhesion.
|
// extruder to improve adhesion of the soluble filament to the base.
|
||||||
// Turn some of the base layers into base interface layers for number_base_interface_layers > 0.
|
|
||||||
std::pair<MyLayersPtr, MyLayersPtr> generate_interface_layers(
|
std::pair<MyLayersPtr, MyLayersPtr> generate_interface_layers(
|
||||||
const MyLayersPtr &bottom_contacts,
|
const MyLayersPtr &bottom_contacts,
|
||||||
const MyLayersPtr &top_contacts,
|
const MyLayersPtr &top_contacts,
|
||||||
@ -226,7 +225,6 @@ private:
|
|||||||
void clip_with_shape();
|
void clip_with_shape();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// New method needed for additional base interface support
|
|
||||||
// Produce the actual G-code.
|
// Produce the actual G-code.
|
||||||
void generate_toolpaths(
|
void generate_toolpaths(
|
||||||
SupportLayerPtrs &support_layers,
|
SupportLayerPtrs &support_layers,
|
||||||
@ -252,7 +250,7 @@ private:
|
|||||||
bool m_can_merge_support_regions;
|
bool m_can_merge_support_regions;
|
||||||
|
|
||||||
coordf_t m_support_layer_height_min;
|
coordf_t m_support_layer_height_min;
|
||||||
coordf_t m_support_layer_height_max;
|
// coordf_t m_support_layer_height_max;
|
||||||
|
|
||||||
coordf_t m_gap_xy;
|
coordf_t m_gap_xy;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user