Fixes of recent RegionExpansion implementation.

Enabled thick internal bridges even if external thick bridges are disabled.
Fixed compilation of conditionally compiled debugging code.
This commit is contained in:
Vojtech Bubnik 2023-01-06 17:53:49 +01:00
parent 479a39ce0e
commit 1a91d85e7e
6 changed files with 53 additions and 92 deletions

View file

@ -62,6 +62,8 @@ public:
// Inherits coord_t x, y
};
#define DEBUG_INTERSECTIONLINE (! defined(NDEBUG) || defined(SLIC3R_DEBUG_SLICE_PROCESSING))
class IntersectionLine : public Line
{
public:
@ -119,14 +121,14 @@ public:
};
uint32_t flags { 0 };
#ifndef NDEBUG
#if DEBUG_INTERSECTIONLINE
enum class Source {
BottomPlane,
TopPlane,
Slab,
};
Source source { Source::BottomPlane };
#endif // NDEBUG
#endif
};
using IntersectionLines = std::vector<IntersectionLine>;
@ -1440,24 +1442,24 @@ static std::vector<Polygons> make_slab_loops(
for (const IntersectionLine &l : lines.at_slice[slice_below])
if (l.edge_type != IntersectionLine::FacetEdgeType::Top) {
in.emplace_back(l);
#ifndef NDEBUG
#if DEBUG_INTERSECTIONLINE
in.back().source = IntersectionLine::Source::BottomPlane;
#endif // NDEBUG
#endif // DEBUG_INTERSECTIONLINE
}
}
{
// Edges in between slice_below and slice_above.
#ifndef NDEBUG
#if DEBUG_INTERSECTIONLINE
size_t old_size = in.size();
#endif // NDEBUG
#endif // DEBUG_INTERSECTIONLINE
// Edge IDs of end points on in-between lines that touch the layer above are already increased with num_edges.
append(in, lines.between_slices[line_idx]);
#ifndef NDEBUG
#if DEBUG_INTERSECTIONLINE
for (auto it = in.begin() + old_size; it != in.end(); ++ it) {
assert(it->edge_type == IntersectionLine::FacetEdgeType::Slab);
it->source = IntersectionLine::Source::Slab;
}
#endif // NDEBUG
#endif // DEBUG_INTERSECTIONLINE
}
if (has_slice_above) {
for (const IntersectionLine &lsrc : lines.at_slice[slice_above])
@ -1470,9 +1472,9 @@ static std::vector<Polygons> make_slab_loops(
l.edge_a_id += num_edges;
if (l.edge_b_id >= 0)
l.edge_b_id += num_edges;
#ifndef NDEBUG
#if DEBUG_INTERSECTIONLINE
l.source = IntersectionLine::Source::TopPlane;
#endif // NDEBUG
#endif // DEBUG_INTERSECTIONLINE
}
}
if (! in.empty()) {