-
Hello, There's a crash of the R session when I compute the centroid of the mesh in the attached file. I'm going to prepare a reproducible C++ code in order that you can try. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
The code: #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Kernel/global_functions.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/number_utils.h>
#include <CGAL/Polygon_mesh_processing/measure.h>
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel EK;
typedef EK::Point_3 EPoint3;
typedef CGAL::Surface_mesh<EPoint3> EMesh3;
namespace PMP = CGAL::Polygon_mesh_processing;
int main() {
EMesh3 mesh;
const bool ok = PMP::IO::read_polygon_mesh(
"crash_centroid.off", mesh, CGAL::parameters::verbose(true)
);
if(!ok) {
std::cout << "Reading failure";
std::exit(1);
}
const bool valid = mesh.is_valid(false);
if(!valid) {
std::cout << "The mesh is not valid.";
std::exit(1);
}
const EPoint3 centroid = PMP::centroid(mesh);
std::cout << CGAL::to_double<EK::FT>(centroid.x()) << " "
<< CGAL::to_double<EK::FT>(centroid.y()) << " "
<< CGAL::to_double<EK::FT>(centroid.z()) << "\n";
return 0;
} Not sure I included all the required |
Beta Was this translation helpful? Give feedback.
-
I get:
|
Beta Was this translation helpful? Give feedback.
-
@afabri since EPECK is used I suspect that's the same kind of issues with iterative computations (like what we fixed in area for example) |
Beta Was this translation helpful? Give feedback.
-
Oddly, there's no crash with Valgrind. If this is due to EPECK I will convert to EPICK before the calculation. |
Beta Was this translation helpful? Give feedback.
-
Note we have already talked about similar issues #2066 and #2073 |
Beta Was this translation helpful? Give feedback.
-
Works with EPICK. Thanks. |
Beta Was this translation helpful? Give feedback.
@afabri since EPECK is used I suspect that's the same kind of issues with iterative computations (like what we fixed in area for example)