mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-13 02:51:48 +08:00
Fixed build on Linux, abs->std::abs
This commit is contained in:
parent
54897aeac0
commit
01f32e18d6
@ -2,6 +2,7 @@
|
|||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include "MutablePriorityQueue.hpp"
|
#include "MutablePriorityQueue.hpp"
|
||||||
#include "SimplifyMeshImpl.hpp"
|
#include "SimplifyMeshImpl.hpp"
|
||||||
|
#include <tbb/parallel_for.h>
|
||||||
|
|
||||||
using namespace Slic3r;
|
using namespace Slic3r;
|
||||||
|
|
||||||
@ -316,7 +317,7 @@ double QuadricEdgeCollapse::calculate_error(uint32_t id_v1,
|
|||||||
const Vertices &vertices)
|
const Vertices &vertices)
|
||||||
{
|
{
|
||||||
double det = calculate_determinant(q);
|
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
|
// can't divide by zero
|
||||||
auto verts = create_vertices(id_v1, id_v2, vertices);
|
auto verts = create_vertices(id_v1, id_v2, vertices);
|
||||||
auto errors = vertices_error(q, verts);
|
auto errors = vertices_error(q, verts);
|
||||||
@ -333,7 +334,7 @@ Vec3f QuadricEdgeCollapse::calculate_vertex(uint32_t id_v1,
|
|||||||
const Vertices &vertices)
|
const Vertices &vertices)
|
||||||
{
|
{
|
||||||
double det = calculate_determinant(q);
|
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
|
// can't divide by zero
|
||||||
auto verts = create_vertices(id_v1, id_v2, vertices);
|
auto verts = create_vertices(id_v1, id_v2, vertices);
|
||||||
auto errors = vertices_error(q, verts);
|
auto errors = vertices_error(q, verts);
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
#include "libslic3r/Model.hpp"
|
#include "libslic3r/Model.hpp"
|
||||||
#include "libslic3r/QuadricEdgeCollapse.hpp"
|
#include "libslic3r/QuadricEdgeCollapse.hpp"
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
namespace Slic3r::GUI {
|
namespace Slic3r::GUI {
|
||||||
|
|
||||||
GLGizmoSimplify::GLGizmoSimplify(GLCanvas3D & parent,
|
GLGizmoSimplify::GLGizmoSimplify(GLCanvas3D & parent,
|
||||||
@ -274,8 +277,8 @@ void GLGizmoSimplify::process()
|
|||||||
state = State::settings;
|
state = State::settings;
|
||||||
}
|
}
|
||||||
// need to render last status fn
|
// need to render last status fn
|
||||||
// without Sleep it freeze until mouse move
|
// without sleep it freezes until mouse move
|
||||||
Sleep(50);
|
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||||
m_parent.schedule_extra_frame(0);
|
m_parent.schedule_extra_frame(0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user