Merge branch 'fs_QuadricEdgeCollapse' of https://github.com/prusa3d/PrusaSlicer into fs_QuadricEdgeCollapse

This commit is contained in:
Filip Sykala 2021-08-16 11:55:43 +02:00
commit 6745076e79
50 changed files with 496 additions and 166 deletions

View file

@ -2,6 +2,7 @@
#include <tuple>
#include "MutablePriorityQueue.hpp"
#include "SimplifyMeshImpl.hpp"
#include <tbb/parallel_for.h>
using namespace Slic3r;
@ -435,7 +436,7 @@ double QuadricEdgeCollapse::calculate_error(uint32_t id_v1,
const Vertices &vertices)
{
double det = calculate_determinant(q);
if (abs(det) < std::numeric_limits<double>::epsilon()) {
if (std::abs(det) < std::numeric_limits<double>::epsilon()) {
// can't divide by zero
auto verts = create_vertices(id_v1, id_v2, vertices);
auto errors = vertices_error(q, verts);
@ -452,7 +453,7 @@ Vec3f QuadricEdgeCollapse::calculate_vertex(uint32_t id_v1,
const Vertices &vertices)
{
double det = calculate_determinant(q);
if (abs(det) < std::numeric_limits<double>::epsilon()) {
if (std::abs(det) < std::numeric_limits<double>::epsilon()) {
// can't divide by zero
auto verts = create_vertices(id_v1, id_v2, vertices);
auto errors = vertices_error(q, verts);
@ -791,4 +792,4 @@ void QuadricEdgeCollapse::compact(const VertexInfos & v_infos,
its.indices[ti_new++] = its.indices[ti];
}
its.indices.erase(its.indices.begin() + ti_new, its.indices.end());
}
}