Reworked "only_retract_when_crossing_perimeters" feature, which

was terribly slow:
Introduced RetractWhenCrossingPerimeters.cpp,hpp
AABBTreeIndirect traverse template was extended to support early exit.
This commit is contained in:
Vojtech Bubnik 2022-12-05 09:59:59 +01:00
parent b1bfef44ba
commit 7309c729e0
9 changed files with 140 additions and 9 deletions
src/libslic3r

View file

@ -3090,7 +3090,7 @@ bool GCode::needs_retraction(const Polyline &travel, ExtrusionRole role)
}
if (m_config.only_retract_when_crossing_perimeters && m_layer != nullptr &&
m_config.fill_density.value > 0 && m_layer->any_internal_region_slice_contains(travel))
m_config.fill_density.value > 0 && m_retract_when_crossing_perimeters.travel_inside_internal_regions(*m_layer, travel))
// Skip retraction if travel is contained in an internal slice *and*
// internal infill is enabled (so that stringing is entirely not visible).
//FIXME any_internal_region_slice_contains() is potentionally very slow, it shall test for the bounding boxes first.