mirror of https://github.com/CGAL/cgal
added more debug output for failure cases
This commit is contained in:
parent
850776533e
commit
f2d9066aaf
|
|
@ -47,7 +47,12 @@ namespace internal {
|
|||
// TODO: This happens for circles and cylinders only! Maybe after my
|
||||
// precision cleaning in the new revision PR, this will be gone for all platforms.
|
||||
if (value < FT(0)) return FT(0); // clamp to zero
|
||||
CGAL_precondition(value >= FT(0));
|
||||
const bool is_value_ok = (value >= FT(0));
|
||||
if (!is_value_ok) { // TODO: remove that!
|
||||
std::cout.precision(20);
|
||||
std::cout << "- wrong value: " << value << std::endl;
|
||||
}
|
||||
CGAL_precondition(is_value_ok);
|
||||
return static_cast<FT>(CGAL::sqrt(CGAL::to_double(value)));
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -115,7 +115,10 @@ int main(int argc, char *argv[]) {
|
|||
distance_threshold, angle_threshold, min_region_size,
|
||||
input_range.point_map(), input_range.normal_map());
|
||||
},
|
||||
[](const auto& r) -> bool { return (r.size() >= 6 && r.size() <= 8); });
|
||||
[](const auto& r) -> bool {
|
||||
std::cout << "- num regions planes: " << r.size() << std::endl;
|
||||
return (r.size() >= 6 && r.size() <= 8);
|
||||
});
|
||||
if (!success)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
|
|
@ -140,7 +143,10 @@ int main(int argc, char *argv[]) {
|
|||
min_radius, max_radius,
|
||||
input_range.point_map(), input_range.normal_map());
|
||||
},
|
||||
[](const auto& r) -> bool { return (r.size() > 28 && r.size() < 48); });
|
||||
[](const auto& r) -> bool {
|
||||
std::cout << "- num regions spheres: " << r.size() << std::endl;
|
||||
return (r.size() > 28 && r.size() < 48);
|
||||
});
|
||||
if (!success)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
|
|
@ -165,7 +171,10 @@ int main(int argc, char *argv[]) {
|
|||
min_radius, max_radius,
|
||||
input_range.point_map(), input_range.normal_map());
|
||||
},
|
||||
[](const auto& r) -> bool { return (r.size() > 4 && r.size() < 12); });
|
||||
[](const auto& r) -> bool {
|
||||
std::cout << "- num regions cylinders: " << r.size() << std::endl;
|
||||
return (r.size() > 4 && r.size() < 12);
|
||||
});
|
||||
if (!success)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue