-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
// TODO This is a HACK for detecting contours
if (poly_data->GetCell(0)->GetNumberOfPoints() == 2) {
optimize->AddContour(poly_data);
} else {
optimize->AddMesh(poly_data);
}This hack needs to be removed/replaced. Loading the attached mesh, if grooming is skipped causes it to be detected as a contour instead of a mesh.
In fact, I can't even remesh it to fix it due to a similar check in Groom.cpp
if (params.get_remesh()) {
auto poly_data = mesh.getVTKMesh();
if (poly_data->GetNumberOfCells() == 0 || poly_data->GetCell(0)->GetNumberOfPoints() == 2) {
SW_DEBUG("Number of cells: {}", poly_data->GetNumberOfCells());
SW_DEBUG("Number of points in first cell: {}", poly_data->GetCell(0)->GetNumberOfPoints());
// write out to /tmp
std::string tmpname = "/tmp/bad_mesh.vtk";
MeshUtils::threadSafeWriteMesh(tmpname, mesh);
throw std::runtime_error("malformed mesh, mesh should be triangular");
}