Skip to content

Commit

Permalink
stability fix for LaplacianMeshSmoother: it failed in LaplacianMeshSm…
Browse files Browse the repository at this point in the history
…oother.RegionSmooth when the input mesh was Closed, and nIncludeExteriorRings was big enough to include all the remaining (not smoothed) triangles in the mesh. (#47)

Co-authored-by: Dmitry Garshin <[email protected]>
  • Loading branch information
dmitry-garshin and Dmitry Garshin authored Apr 2, 2024
1 parent 2d2b413 commit 37c5b03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesh_ops/LaplacianMeshSmoother.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public static void RegionSmooth(DMesh3 mesh, IEnumerable<int> triangles,
constrained.Add(sub_vid);
}

if (constrained.Count > 0) {
if (constrained != null && constrained.Count > 0) {
w = Math.Sqrt(w);
for (int k = 0; k < nConstrainLoops; ++k) {
HashSet<int> next_layer = new HashSet<int>();
Expand Down

0 comments on commit 37c5b03

Please sign in to comment.