Fix of Support generator debugging functions after some refactoring

This commit is contained in:
Vojtech Bubnik 2020-08-12 10:47:36 +02:00
parent a6a5025a76
commit 12f43736bd

View File

@ -409,7 +409,7 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
export_print_z_polygons_and_extrusions_to_svg(
debug_out_path("support-w-fills-%d-%lf.svg", iRun, layers_sorted[i]->print_z).c_str(),
layers_sorted.data() + i, j - i,
*object.support_layers[layer_id]);
*object.support_layers()[layer_id]);
++layer_id;
}
i = j;
@ -597,8 +597,8 @@ public:
::fwrite(&n_points, 4, 1, file);
for (uint32_t j = 0; j < n_points; ++ j) {
const Point &pt = poly.points[j];
::fwrite(&pt.x, sizeof(coord_t), 1, file);
::fwrite(&pt.y, sizeof(coord_t), 1, file);
::fwrite(&pt.x(), sizeof(coord_t), 1, file);
::fwrite(&pt.y(), sizeof(coord_t), 1, file);
}
}
n_polygons = m_trimming_polygons->size();
@ -609,8 +609,8 @@ public:
::fwrite(&n_points, 4, 1, file);
for (uint32_t j = 0; j < n_points; ++ j) {
const Point &pt = poly.points[j];
::fwrite(&pt.x, sizeof(coord_t), 1, file);
::fwrite(&pt.y, sizeof(coord_t), 1, file);
::fwrite(&pt.x(), sizeof(coord_t), 1, file);
::fwrite(&pt.y(), sizeof(coord_t), 1, file);
}
}
::fclose(file);
@ -1134,7 +1134,7 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::top_contact_
{
::Slic3r::SVG svg(debug_out_path("support-top-contacts-raw-run%d-layer%d-region%d.svg",
iRun, layer_id,
std::find_if(layer.regions.begin(), layer.regions.end(), [layerm](const LayerRegion* other){return other == layerm;}) - layer.regions.begin()),
std::find_if(layer.regions().begin(), layer.regions().end(), [layerm](const LayerRegion* other){return other == layerm;}) - layer.regions().begin()),
get_extents(diff_polygons));
Slic3r::ExPolygons expolys = union_ex(diff_polygons, false);
svg.draw(expolys);
@ -1152,7 +1152,7 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::top_contact_
Slic3r::SVG::export_expolygons(
debug_out_path("support-top-contacts-filtered-run%d-layer%d-region%d-z%f.svg",
iRun, layer_id,
std::find_if(layer.regions.begin(), layer.regions.end(), [layerm](const LayerRegion* other){return other == layerm;}) - layer.regions.begin(),
std::find_if(layer.regions().begin(), layer.regions().end(), [layerm](const LayerRegion* other){return other == layerm;}) - layer.regions().begin(),
layer.print_z),
union_ex(diff_polygons, false));
#endif /* SLIC3R_DEBUG */
@ -1482,7 +1482,7 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::bottom_conta
svg.draw(union_ex(top, false), "blue", 0.5f);
svg.draw(union_ex(projection_raw, true), "red", 0.5f);
svg.draw_outline(union_ex(projection_raw, true), "red", "blue", scale_(0.1f));
svg.draw(layer.slices, "green", 0.5f);
svg.draw(layer.lslices, "green", 0.5f);
}
#endif /* SLIC3R_DEBUG */