1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-16 10:08:36 +03:00

0027521: Standard_ConstructionError when trying to use unifySameDom into a shape

Correct the algorithm in the function MergeEdges in ShapeUpgrade_UnifySameDomain.cxx so as to take into account the orientation of the next edge added to the chain.

Test cases for issue CR27521
This commit is contained in:
msv 2016-05-20 11:36:11 +03:00 committed by bugmaster
parent 55fb31dae4
commit 38c2acd423
3 changed files with 58 additions and 20 deletions

View File

@ -948,21 +948,25 @@ static Standard_Boolean MergeEdges(TopTools_SequenceOfShape& SeqEdges,
{ {
edge = TopoDS::Edge(itL.Value()); edge = TopoDS::Edge(itL.Value());
if (!aUsedEdges.Contains(edge)) if (!aUsedEdges.Contains(edge))
{
TopoDS_Vertex V2[2];
TopExp::Vertices(edge, V2[0], V2[1], Standard_True);
// the neighboring edge must have V[j] reversed and located on the opposite end
if (V2[1 - j].IsEqual(V[j].Reversed()))
{ {
if (j == 0) if (j == 0)
aChain.Prepend(edge); aChain.Prepend(edge);
else else
aChain.Append(edge); aChain.Append(edge);
aUsedEdges.Add(edge); aUsedEdges.Add(edge);
TopoDS_Vertex VF2, VL2; V[j] = V2[j];
TopExp::Vertices(edge, VF2, VL2, Standard_True);
V[j] = (VF2.IsSame(V[j]) ? VL2 : VF2);
isAdded = Standard_True; isAdded = Standard_True;
break; break;
} }
} }
} }
} }
}
if (aChain.Length() < 2) if (aChain.Length() < 2)
continue; continue;

View File

@ -0,0 +1,17 @@
puts "============"
puts "OCC27521"
puts "============"
puts ""
###############################
## Standard_ConstructionError when trying to use unifySameDom into a shape
###############################
restore [locate_data_file bug27521_dom8443-good.brep] a
unifysamedom result a
don result
smallview; fit
checkshape result
checknbshapes result -m UnifySameDomain -face 31 -edge 286
checkview -screenshot -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,17 @@
puts "============"
puts "OCC27521"
puts "============"
puts ""
###############################
## Standard_ConstructionError when trying to use unifySameDom into a shape
###############################
restore [locate_data_file bug27521_dom8443-wrong.brep] a
unifysamedom result a
don result
smallview; fit
checkshape result
checknbshapes result -m UnifySameDomain -face 31 -edge 286
checkview -screenshot -2d -path ${imagedir}/${test_image}.png