Skip to content

Commit 5f5c7e4

Browse files
authored
Merge pull request #2539 from SCIInstitute/amorris/fix-2538-contour-groom
Fix #2538. Contour grooming problem.
2 parents 2d6c287 + 1c36a3c commit 5f5c7e4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Libs/Mesh/MeshUtils.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,12 @@ vtkSmartPointer<vtkPolyData> MeshUtils::recreate_mesh(vtkSmartPointer<vtkPolyDat
11201120

11211121
//---------------------------------------------------------------------------
11221122
vtkSmartPointer<vtkPolyData> MeshUtils::repair_mesh(vtkSmartPointer<vtkPolyData> mesh, bool extract_largest) {
1123+
// Line-only / vertex-only polydata (e.g. contours) has no polygons to repair;
1124+
// the triangulation and cleanup steps below would discard its cells.
1125+
if (mesh->GetNumberOfPolys() == 0) {
1126+
return mesh;
1127+
}
1128+
11231129
auto triangle_filter = vtkSmartPointer<vtkTriangleFilter>::New();
11241130
triangle_filter->SetInputData(mesh);
11251131
triangle_filter->PassLinesOff();

0 commit comments

Comments
 (0)