Skip to content
Snippets Groups Projects
Commit 678783a8 authored by mattijs's avatar mattijs
Browse files

BUG: triSurfaceMesh: always assign normal

parent bb5a8daa
Branches
Tags
No related merge requests found
......@@ -827,6 +827,8 @@ void Foam::triSurfaceMesh::getNormal
vectorField& normal
) const
{
const triSurface& s = static_cast<const triSurface&>(*this);
normal.setSize(info.size());
if (minQuality_ >= 0)
......@@ -834,7 +836,6 @@ void Foam::triSurfaceMesh::getNormal
// Make sure we don't use triangles with low quality since
// normal is not reliable.
const triSurface& s = static_cast<const triSurface&>(*this);
const labelListList& faceFaces = s.faceFaces();
forAll(info, i)
......@@ -842,6 +843,7 @@ void Foam::triSurfaceMesh::getNormal
if (info[i].hit())
{
label faceI = info[i].index();
normal[i] = s[faceI].normal(points());
scalar qual = s[faceI].tri(points()).quality();
......@@ -861,11 +863,8 @@ void Foam::triSurfaceMesh::getNormal
}
}
}
else
{
normal[i] = s[faceI].normal(points());
}
normal[i] /= mag(normal[i]);
normal[i] /= mag(normal[i]) + VSMALL;
}
else
{
......@@ -885,7 +884,7 @@ void Foam::triSurfaceMesh::getNormal
//normal[i] = faceNormals()[faceI];
//- Uncached
normal[i] = triSurface::operator[](faceI).normal(points());
normal[i] = s[faceI].normal(points());
normal[i] /= mag(normal[i]) + VSMALL;
}
else
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment