We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2d6c287 + 1c36a3c commit 5f5c7e4Copy full SHA for 5f5c7e4
1 file changed
Libs/Mesh/MeshUtils.cpp
@@ -1120,6 +1120,12 @@ vtkSmartPointer<vtkPolyData> MeshUtils::recreate_mesh(vtkSmartPointer<vtkPolyDat
1120
1121
//---------------------------------------------------------------------------
1122
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
+
1129
auto triangle_filter = vtkSmartPointer<vtkTriangleFilter>::New();
1130
triangle_filter->SetInputData(mesh);
1131
triangle_filter->PassLinesOff();
0 commit comments