1) New methods PrintObject::num_regions() and ::has_region() to make

the code more readable and to highlight where PrintObject::region_volumes
   are actually set and consumed.
2) Replaced Slic3r::clamp() with std::clamp(). They differ in the order
   of their parameters, thus hopefully no new bugs were introduced.
3) Some refactoring of MultiMaterialSegmentation for efficiency.
This commit is contained in:
Vojtech Bubnik 2021-04-22 11:41:26 +02:00
parent 4f950343c8
commit 38bb7d2950
19 changed files with 139 additions and 161 deletions

View file

@ -1039,7 +1039,7 @@ ClipperLib::Path mittered_offset_path_scaled(const Points &contour, const std::v
Vec2d nnext = perp(ptnext - pt).normalized();
double delta = deltas[i];
double sin_a = clamp(-1., 1., cross2(nprev, nnext));
double sin_a = std::clamp(cross2(nprev, nnext), -1., 1.);
double convex = sin_a * delta;
if (convex <= - sin_min_parallel) {
// Concave corner.