mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 20:56:00 +08:00
FIX: remove warnings
../src/libslic3r/SLA/SupportIslands/PolygonUtils.cpp:12:10: warning: variable 'is_in_limits' set but not used [-Wunused-but-set-variable] ../src/libslic3r/SLA/SupportIslands/VoronoiGraphUtils.cpp:294:45: warning: unused variable 'success' [-Wunused-variable]
This commit is contained in:
parent
49de8d2869
commit
257c285c73
@ -3,25 +3,26 @@
|
|||||||
|
|
||||||
using namespace Slic3r::sla;
|
using namespace Slic3r::sla;
|
||||||
|
|
||||||
|
inline bool is_in_coord_limits(const double& value) {
|
||||||
|
return (value < std::numeric_limits<coord_t>::max()) &&
|
||||||
|
(value > std::numeric_limits<coord_t>::min());
|
||||||
|
}
|
||||||
|
|
||||||
Slic3r::Polygon PolygonUtils::create_regular(size_t count_points,
|
Slic3r::Polygon PolygonUtils::create_regular(size_t count_points,
|
||||||
double radius,
|
double radius,
|
||||||
const Point ¢er)
|
const Point ¢er)
|
||||||
{
|
{
|
||||||
assert(radius >= 1.);
|
assert(radius >= 1.);
|
||||||
assert(count_points >= 3);
|
assert(count_points >= 3);
|
||||||
auto is_in_limits = [](double value) {
|
|
||||||
return (value < std::numeric_limits<coord_t>::max()) &&
|
|
||||||
(value > std::numeric_limits<coord_t>::min());
|
|
||||||
};
|
|
||||||
Points points;
|
Points points;
|
||||||
points.reserve(count_points);
|
points.reserve(count_points);
|
||||||
double increase_angle = 2 * M_PI / count_points;
|
double increase_angle = 2 * M_PI / count_points;
|
||||||
for (size_t i = 0; i < count_points; ++i) {
|
for (size_t i = 0; i < count_points; ++i) {
|
||||||
double angle = i * increase_angle;
|
double angle = i * increase_angle;
|
||||||
double x = cos(angle) * radius + center.x();
|
double x = cos(angle) * radius + center.x();
|
||||||
assert(is_in_limits(x));
|
assert(is_in_coord_limits(x));
|
||||||
double y = sin(angle) * radius + center.y();
|
double y = sin(angle) * radius + center.y();
|
||||||
assert(is_in_limits(y));
|
assert(is_in_coord_limits(y));
|
||||||
points.emplace_back(x, y);
|
points.emplace_back(x, y);
|
||||||
}
|
}
|
||||||
return Polygon(points);
|
return Polygon(points);
|
||||||
|
@ -291,9 +291,11 @@ VoronoiGraph::Node *VoronoiGraphUtils::getNode(VoronoiGraph & graph,
|
|||||||
Point point = to_point(vertex);
|
Point point = to_point(vertex);
|
||||||
double distance = line.distance_to(point);
|
double distance = line.distance_to(point);
|
||||||
|
|
||||||
[[maybe_unused]] auto [iterator, success] =
|
auto [iterator, success] = data.emplace(vertex, VoronoiGraph::Node(vertex, distance));
|
||||||
data.emplace(vertex, VoronoiGraph::Node(vertex, distance));
|
|
||||||
assert(success);
|
assert(success);
|
||||||
|
if (!success) return nullptr;
|
||||||
|
|
||||||
return &iterator->second;
|
return &iterator->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user