Skip to content

Commit f744b77

Browse files
committed
Fix #2467 - Mesh computeNormals not correctly recomputing normals
The issue is that we have to remove the existing normals first or the filter will skip creation if normals already exist.
1 parent f1e8aa3 commit f744b77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Libs/Mesh/Mesh.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,10 @@ Mesh& Mesh::clipClosedSurface(const Plane plane) {
722722
}
723723

724724
Mesh& Mesh::computeNormals() {
725+
// Remove existing normals first
726+
poly_data_->GetPointData()->SetNormals(nullptr);
727+
poly_data_->GetCellData()->SetNormals(nullptr);
728+
725729
auto normal = vtkSmartPointer<vtkPolyDataNormals>::New();
726730

727731
normal->SetInputData(this->poly_data_);

0 commit comments

Comments
 (0)