From: skv Date: Wed, 10 Jul 2013 07:16:01 +0000 (+0000) Subject: 0022177: [CEA 799] RemoveExtraEdges produces non valid faces X-Git-Tag: BR_hydro_v_0_3_1~159 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3c094b0dc5923544f1f66ba4af7bea5b7dc88aa9;p=modules%2Fgeom.git 0022177: [CEA 799] RemoveExtraEdges produces non valid faces --- diff --git a/src/BlockFix/BlockFix_UnionEdges.cxx b/src/BlockFix/BlockFix_UnionEdges.cxx index f57f6c05c..31a924384 100644 --- a/src/BlockFix/BlockFix_UnionEdges.cxx +++ b/src/BlockFix/BlockFix_UnionEdges.cxx @@ -388,6 +388,18 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges, } if (jSplit > 0) { + // This is closed contour. Check the last (it is first as well) vertex, + // as it becomes intermediate after reordering. + TopoDS_Edge anEdge = TopoDS::Edge(aChain.Last()); + TopoDS_Vertex aVtx = sae.LastVertex(anEdge); + + if (IsFixed(aVtx, theFace1, theMapVtxEdge1) || + IsFixed(aVtx, theFace2, theMapVtxEdge2)) { + // This vertex should be kept. So we can't merge this contour. + MESSAGE ("Two edges on closed contour can't be merged."); + return Standard_False; + } + // Reorder edges in the sequence to have jSplit-th edge last. for(j = 1; j <= jSplit; j++) { aChain.Append(aChain.First());