mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 23:39:01 +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;
|
||||
|
||||
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,
|
||||
double radius,
|
||||
const Point ¢er)
|
||||
{
|
||||
assert(radius >= 1.);
|
||||
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.reserve(count_points);
|
||||
double increase_angle = 2 * M_PI / count_points;
|
||||
for (size_t i = 0; i < count_points; ++i) {
|
||||
double angle = i * increase_angle;
|
||||
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();
|
||||
assert(is_in_limits(y));
|
||||
assert(is_in_coord_limits(y));
|
||||
points.emplace_back(x, y);
|
||||
}
|
||||
return Polygon(points);
|
||||
|
@ -291,9 +291,11 @@ VoronoiGraph::Node *VoronoiGraphUtils::getNode(VoronoiGraph & graph,
|
||||
Point point = to_point(vertex);
|
||||
double distance = line.distance_to(point);
|
||||
|
||||
[[maybe_unused]] auto [iterator, success] =
|
||||
data.emplace(vertex, VoronoiGraph::Node(vertex, distance));
|
||||
auto [iterator, success] = data.emplace(vertex, VoronoiGraph::Node(vertex, distance));
|
||||
|
||||
assert(success);
|
||||
if (!success) return nullptr;
|
||||
|
||||
return &iterator->second;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user