Support generator: Debugging visualization of "don't support bridges".

Fixed a bug in raft generator - 1st layer did not respect the 1st layer
density.
This commit is contained in:
Vojtech Bubnik 2021-02-25 12:29:08 +01:00
parent 43c05d35ea
commit 6e73ddab8e

View File

@ -1264,6 +1264,14 @@ namespace SupportMaterialInternal {
offset(layerm->unsupported_bridge_edges, scale_(SUPPORT_MATERIAL_MARGIN), SUPPORT_SURFACES_OFFSET_PARAMETERS));
// Remove bridged areas from the supported areas.
contact_polygons = diff(contact_polygons, bridges, true);
#ifdef SLIC3R_DEBUG
static int iRun = 0;
SVG::export_expolygons(debug_out_path("support-top-contacts-remove-bridges-run%d.svg", iRun ++),
{ { { union_ex(offset(layerm->unsupported_bridge_edges, scale_(SUPPORT_MATERIAL_MARGIN), SUPPORT_SURFACES_OFFSET_PARAMETERS), false) }, { "unsupported_bridge_edges", "orange", 0.5f } },
{ { union_ex(contact_polygons, false) }, { "contact_polygons", "blue", 0.5f } },
{ { union_ex(bridges, false) }, { "bridges", "red", "black", "", scaled<coord_t>(0.1f), 0.5f } } });
#endif /* SLIC3R_DEBUG */
}
}
@ -1678,7 +1686,7 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::top_contact_
#endif /* SLIC3R_DEBUG */
}
}
#ifdef SLIC3R_DEBUG
#ifdef SLIC3R_DEBUG
SVG::export_expolygons(debug_out_path("support-top-contacts-final0-run%d-layer%d-z%f.svg", iRun, layer_id, layer.print_z),
{ { { union_ex(lower_layer_polygons, false) }, { "lower_layer_polygons", "gray", 0.2f } },
{ { union_ex(*new_layer.contact_polygons, false) }, { "new_layer.contact_polygons", "yellow", 0.5f } },
@ -3573,8 +3581,7 @@ void PrintObjectSupportMaterial::generate_toolpaths(
// Base flange.
filler->angle = raft_angle_1st_layer;
filler->spacing = m_first_layer_flow.spacing();
// 70% of density on the 1st layer.
density = 0.7f;
density = float(m_object_config->raft_first_layer_density.value * 0.01);
} else if (support_layer_id >= m_slicing_params.base_raft_layers) {
filler->angle = raft_angle_interface;
// We don't use $base_flow->spacing because we need a constant spacing