From ebaf422c6e4ca9d8a61261ecbbee5c1da25b217b Mon Sep 17 00:00:00 2001 From: Warren Bloomer Date: Wed, 5 Jun 2024 16:27:51 +1000 Subject: [PATCH] Consistent orientation of mesh hole-filled triangles. --- cpp/open3d/t/geometry/TriangleMesh.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cpp/open3d/t/geometry/TriangleMesh.cpp b/cpp/open3d/t/geometry/TriangleMesh.cpp index 43899aaf58f..b539c81f036 100644 --- a/cpp/open3d/t/geometry/TriangleMesh.cpp +++ b/cpp/open3d/t/geometry/TriangleMesh.cpp @@ -12,8 +12,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -717,8 +719,15 @@ TriangleMesh TriangleMesh::FillHoles(double hole_size) const { vtkNew fill_holes; fill_holes->SetInputData(polydata); fill_holes->SetHoleSize(hole_size); - fill_holes->Update(); - auto result = fill_holes->GetOutput(); + + // make the triangle winding order consistent + vtkNew normals; + normals->SetInputConnection(fill_holes->GetOutputPort()); + normals->SetConsistency(true); + normals->SetSplitting(false); + normals->Update(); + auto result = normals->GetOutput(); + return CreateTriangleMeshFromVtkPolyData(result); }