Skip to content

Commit

Permalink
Consistent orientation of mesh hole-filled triangles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Warren Bloomer committed Jun 5, 2024
1 parent 525c4e6 commit ebaf422
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cpp/open3d/t/geometry/TriangleMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
#include <vtkClipPolyData.h>
#include <vtkCutter.h>
#include <vtkFillHolesFilter.h>
#include <vtkPolyDataNormals.h>
#include <vtkPlane.h>
#include <vtkQuadricDecimation.h>
#include <vtkPointData.h>

#include <Eigen/Core>
#include <string>
Expand Down Expand Up @@ -717,8 +719,15 @@ TriangleMesh TriangleMesh::FillHoles(double hole_size) const {
vtkNew<vtkFillHolesFilter> 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<vtkPolyDataNormals> normals;
normals->SetInputConnection(fill_holes->GetOutputPort());
normals->SetConsistency(true);
normals->SetSplitting(false);
normals->Update();
auto result = normals->GetOutput();

return CreateTriangleMeshFromVtkPolyData(result);
}

Expand Down

0 comments on commit ebaf422

Please sign in to comment.