#922 Infill bridge issues

This commit is contained in:
remi durand 2021-03-19 12:36:38 +01:00
parent a8036a9e31
commit 519bcaf1a2
8 changed files with 11 additions and 8 deletions

View File

@ -312,7 +312,7 @@ ExtrusionRole ExtrusionEntity::string_to_role(const std::string_view role)
else if (role == L("Bridge infill")) else if (role == L("Bridge infill"))
return erBridgeInfill; return erBridgeInfill;
else if (role == L("Internal bridge infill")) else if (role == L("Internal bridge infill"))
return erBridgeInfill; return erInternalBridgeInfill;
else if (role == L("Thin wall")) else if (role == L("Thin wall"))
return erThinWall; return erThinWall;
else if (role == L("Gap fill")) else if (role == L("Gap fill"))

View File

@ -104,6 +104,7 @@ inline bool is_perimeter(ExtrusionRole role)
inline bool is_infill(ExtrusionRole role) inline bool is_infill(ExtrusionRole role)
{ {
return role == erBridgeInfill return role == erBridgeInfill
|| role == erInternalBridgeInfill
|| role == erInternalInfill || role == erInternalInfill
|| role == erSolidInfill || role == erSolidInfill
|| role == erTopSolidInfill || role == erTopSolidInfill
@ -113,13 +114,15 @@ inline bool is_infill(ExtrusionRole role)
inline bool is_solid_infill(ExtrusionRole role) inline bool is_solid_infill(ExtrusionRole role)
{ {
return role == erBridgeInfill return role == erBridgeInfill
|| role == erInternalBridgeInfill
|| role == erSolidInfill || role == erSolidInfill
|| role == erTopSolidInfill || role == erTopSolidInfill
|| role == erIroning; || role == erIroning;
} }
inline bool is_bridge(ExtrusionRole role) { inline bool is_bridge(ExtrusionRole role) {
return role == erBridgeInfill; return role == erBridgeInfill
|| role == erInternalBridgeInfill;
} }

View File

@ -252,7 +252,7 @@ Fill::do_gap_fill(const ExPolygons& gapfill_areas, const FillParams& params, Ext
MedialAxis{ ex, params.flow.scaled_width() * 2, params.flow.scaled_width() / 5, coord_t(params.flow.height) }.build(polylines_gapfill); MedialAxis{ ex, params.flow.scaled_width() * 2, params.flow.scaled_width() / 5, coord_t(params.flow.height) }.build(polylines_gapfill);
} }
} }
if (!polylines_gapfill.empty() && params.role != erBridgeInfill && params.role != erInternalBridgeInfill) { if (!polylines_gapfill.empty() && !is_bridge(params.role)) {
//test //test
#ifdef _DEBUG #ifdef _DEBUG
for (ThickPolyline poly : polylines_gapfill) { for (ThickPolyline poly : polylines_gapfill) {

View File

@ -164,7 +164,7 @@ protected:
ExtrusionRole getRoleFromSurfaceType(const FillParams &params, const Surface *surface) const { ExtrusionRole getRoleFromSurfaceType(const FillParams &params, const Surface *surface) const {
if (params.role == erNone || params.role == erCustom) { if (params.role == erNone || params.role == erCustom) {
return params.flow.bridge ? return params.flow.bridge ?
(surface->has_pos_bottom() ? erBridgeInfill :erInternalBridgeInfill) : (surface->has_pos_bottom() ? erBridgeInfill : erInternalBridgeInfill) :
(surface->has_fill_solid() ? (surface->has_fill_solid() ?
((surface->has_pos_top()) ? erTopSolidInfill : erSolidInfill) : ((surface->has_pos_top()) ? erTopSolidInfill : erSolidInfill) :
erInternalInfill); erInternalInfill);

View File

@ -153,7 +153,7 @@ FillConcentricWGapFill::fill_surface_extrusion(
MedialAxis{ ex, coord_t(max), coord_t(min), coord_t(params.flow.height) }.build(polylines); MedialAxis{ ex, coord_t(max), coord_t(min), coord_t(params.flow.height) }.build(polylines);
} }
} }
if (!polylines.empty() && good_role != erBridgeInfill && good_role != erInternalBridgeInfill) { if (!polylines.empty() && !is_bridge(good_role)) {
ExtrusionEntityCollection gap_fill = thin_variable_width(polylines, erGapFill, params.flow); ExtrusionEntityCollection gap_fill = thin_variable_width(polylines, erGapFill, params.flow);
//set role if needed //set role if needed
if (good_role != erSolidInfill) { if (good_role != erSolidInfill) {

View File

@ -3719,7 +3719,7 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string
throw Slic3r::InvalidArgument("Invalid speed"); throw Slic3r::InvalidArgument("Invalid speed");
} }
//don't modify bridge speed //don't modify bridge speed
if (factor < 1 && !(path.role() == erOverhangPerimeter || path.role() == erBridgeInfill || path.role() == erInternalBridgeInfill)) { if (factor < 1 && !(path.role() == erOverhangPerimeter || is_bridge(path.role()))) {
float small_speed = m_config.small_perimeter_speed.get_abs_value(m_config.perimeter_speed); float small_speed = m_config.small_perimeter_speed.get_abs_value(m_config.perimeter_speed);
//apply factor between feature speed and small speed //apply factor between feature speed and small speed
speed = speed * factor + (1.f - factor) * small_speed; speed = speed * factor + (1.f - factor) * small_speed;

View File

@ -1909,7 +1909,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
#endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE #endif // ENABLE_TOOLPATHS_WIDTH_HEIGHT_FROM_GCODE
// cross section: rectangle // cross section: rectangle
m_width = delta_pos[E] * static_cast<float>(M_PI * sqr(1.05f * filament_radius)) / (delta_xyz * m_height); m_width = delta_pos[E] * static_cast<float>(M_PI * sqr(1.05f * filament_radius)) / (delta_xyz * m_height);
else if (m_extrusion_role == erBridgeInfill || m_extrusion_role == erNone) else if (is_bridge(m_extrusion_role) || m_extrusion_role == erNone)
// cross section: circle // cross section: circle
m_width = static_cast<float>(m_filament_diameters[m_extruder_id]) * std::sqrt(delta_pos[E] / delta_xyz); m_width = static_cast<float>(m_filament_diameters[m_extruder_id]) * std::sqrt(delta_pos[E] / delta_xyz);
else else

View File

@ -808,7 +808,7 @@ namespace SupportMaterialInternal {
return true; return true;
} else { } else {
assert(! ee->is_loop()); assert(! ee->is_loop());
if (ee->role() == erBridgeInfill || ee->role() == erInternalBridgeInfill) if (is_bridge(ee->role()))
return true; return true;
} }
} }