mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-05 15:20:53 +08:00
Fix:
../src/slic3r/GUI/TextLines.cpp:27:24: warning: ‘const Slic3r::Polygon* {anonymous}::largest(const Polygons&)’ defined but not used [-Wunused-function] ../src/slic3r/GUI/TextLines.cpp:74:10: warning: variable ‘calc_norm’ set but not used [-Wunused-but-set-variable]
This commit is contained in:
parent
6ab3963d83
commit
0cda6ddc17
@ -24,27 +24,6 @@ using namespace Slic3r::Emboss;
|
|||||||
using namespace Slic3r::GUI;
|
using namespace Slic3r::GUI;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const Slic3r::Polygon *largest(const Slic3r::Polygons &polygons)
|
|
||||||
{
|
|
||||||
if (polygons.empty())
|
|
||||||
return nullptr;
|
|
||||||
if (polygons.size() == 1)
|
|
||||||
return &polygons.front();
|
|
||||||
|
|
||||||
// compare polygon to find largest
|
|
||||||
size_t biggest_size = 0;
|
|
||||||
const Slic3r::Polygon *result = nullptr;
|
|
||||||
for (const Slic3r::Polygon &polygon : polygons) {
|
|
||||||
Point s = polygon.bounding_box().size();
|
|
||||||
size_t size = s.x() * s.y();
|
|
||||||
if (size <= biggest_size)
|
|
||||||
continue;
|
|
||||||
biggest_size = size;
|
|
||||||
result = &polygon;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Be careful it is not water tide and contain self intersections
|
// Be careful it is not water tide and contain self intersections
|
||||||
// It is only for visualization purposes
|
// It is only for visualization purposes
|
||||||
indexed_triangle_set its_create_torus(const Slic3r::Polygon &polygon, float radius, size_t steps = 20)
|
indexed_triangle_set its_create_torus(const Slic3r::Polygon &polygon, float radius, size_t steps = 20)
|
||||||
@ -69,12 +48,6 @@ indexed_triangle_set its_create_torus(const Slic3r::Polygon &polygon, float radi
|
|||||||
for (size_t i = 0; i < count - 1; ++i)
|
for (size_t i = 0; i < count - 1; ++i)
|
||||||
line_norm[i] = calc_line_norm(points_d[i], points_d[i + 1]);
|
line_norm[i] = calc_line_norm(points_d[i], points_d[i + 1]);
|
||||||
line_norm.back() = calc_line_norm(points_d.back(), points_d.front());
|
line_norm.back() = calc_line_norm(points_d.back(), points_d.front());
|
||||||
|
|
||||||
// calculate normals for each point
|
|
||||||
auto calc_norm = [](const Vec2f &prev, const Vec2f &next) -> Vec2f {
|
|
||||||
Vec2f dir = prev + next;
|
|
||||||
return Vec2f(-dir.x(), dir.y());
|
|
||||||
};
|
|
||||||
|
|
||||||
// precalculate sinus and cosinus
|
// precalculate sinus and cosinus
|
||||||
double angle_step = 2 * M_PI / steps;
|
double angle_step = 2 * M_PI / steps;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user