Commit 479160b3 authored by Franjo's avatar Franjo
Browse files

Updated removeSurfaceFacets

parent 312a7c34
......@@ -143,6 +143,10 @@ void triSurfaceRemoveFacets::removeFacets()
//- update feature edges
const edgeLongList& featureEdges = surf_.featureEdges();
const VRWGraph& pointEdges = surf_.pointEdges();
const edgeLongList& edges = surf_.edges();
const VRWGraph& edgeFacets = surf_.edgeFacets();
label edgeCounter(0);
labelLongList newFeatureEdgeLabel(featureEdges.size(), -1);
......@@ -153,6 +157,31 @@ void triSurfaceRemoveFacets::removeFacets()
if( (newPointLabel[e.start()] < 0) || (newPointLabel[e.end()] < 0) )
continue;
//- find global edge label
label eI(-1);
forAllRow(pointEdges, e.start(), peI)
{
const label eJ = pointEdges(e.start(), peI);
if( edges[eJ] == e )
{
eI = eJ;
break;
}
}
//- check if the edge is attached to at least one triangle
bool foundTriangle(false);
forAllRow(edgeFacets, eI, efI)
{
if( newTriangleLabel[edgeFacets(eI, efI)] >= 0 )
{
foundTriangle = true;
break;
}
}
if( !foundTriangle )
continue;
newFeatureEdgeLabel[feI] = edgeCounter++;
}
......
Markdown is supported
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