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

ENH: surfaceFeatures: survive zero length edge. Fixes #616.

parent cc007285
Branches
Tags
No related merge requests found
...@@ -243,12 +243,16 @@ void Foam::surfaceFeatures::calcFeatPoints ...@@ -243,12 +243,16 @@ void Foam::surfaceFeatures::calcFeatPoints
if (edgeStat[edgeI] != NONE) if (edgeStat[edgeI] != NONE)
{ {
edgeVecs.append(edges[edgeI].vec(localPoints)); vector vec = edges[edgeI].vec(localPoints);
edgeVecs.last() /= mag(edgeVecs.last()); scalar magVec = mag(vec);
if (magVec > SMALL)
{
edgeVecs.append(vec/magVec);
}
} }
} }
if (mag(edgeVecs[0] & edgeVecs[1]) < minCos) if (edgeVecs.size() == 2 && mag(edgeVecs[0] & edgeVecs[1]) < minCos)
{ {
featurePoints.append(pointi); featurePoints.append(pointi);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment