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

0031023: Fillet regression in OCCT 7.4 from 7.3

Modify local static function ReorderFaces to be able to process multiple-faces-connecting vertices.
This commit is contained in:
jgv 2019-09-20 13:52:10 +03:00 committed by apn
parent eff3eff916
commit b008226203
2 changed files with 59 additions and 19 deletions

View File

@ -89,7 +89,8 @@ static void ReorderFaces(TopoDS_Face& theF1,
TopoDS_Face& theF2, TopoDS_Face& theF2,
const TopoDS_Face& theFirstFace, const TopoDS_Face& theFirstFace,
const TopoDS_Edge& thePrevEdge, const TopoDS_Edge& thePrevEdge,
const TopoDS_Vertex& theCommonVertex) const TopoDS_Vertex& theCommonVertex,
const ChFiDS_Map& theEFmap)
{ {
if (theF1.IsSame(theFirstFace)) if (theF1.IsSame(theFirstFace))
return; return;
@ -99,25 +100,42 @@ static void ReorderFaces(TopoDS_Face& theF1,
return; return;
} }
TopTools_IndexedDataMapOfShapeListOfShape VEmapFirst, VEmap; //Loop until find <theF1> or <theF2>
TopExp::MapShapesAndAncestors(theFirstFace, TopAbs_VERTEX, TopAbs_EDGE, VEmapFirst); Standard_Boolean ToExchange = Standard_False;
TopExp::MapShapesAndAncestors(theF1, TopAbs_VERTEX, TopAbs_EDGE, VEmap); TopoDS_Edge PrevEdge = thePrevEdge, CurEdge;
TopoDS_Face PrevFace = theFirstFace, CurFace;
const TopTools_ListOfShape& ElistFirst = VEmapFirst.FindFromKey(theCommonVertex); for (;;)
const TopTools_ListOfShape& Elist = VEmap.FindFromKey(theCommonVertex);
TopTools_ListIteratorOfListOfShape itlfirst(ElistFirst);
for (; itlfirst.More(); itlfirst.Next())
{ {
const TopoDS_Shape& anEdge = itlfirst.Value(); TopTools_IndexedDataMapOfShapeListOfShape VEmap;
if (anEdge.IsSame(thePrevEdge)) TopExp::MapShapesAndAncestors(PrevFace, TopAbs_VERTEX, TopAbs_EDGE, VEmap);
continue; const TopTools_ListOfShape& Elist = VEmap.FindFromKey(theCommonVertex);
TopTools_ListIteratorOfListOfShape itl(Elist); if (PrevEdge.IsSame(Elist.First()))
for(; itl.More(); itl.Next()) CurEdge = TopoDS::Edge(Elist.Last());
if (anEdge.IsSame(itl.Value())) else
return; CurEdge = TopoDS::Edge(Elist.First());
const TopTools_ListOfShape& Flist = theEFmap.FindFromKey(CurEdge);
if (PrevFace.IsSame(Flist.First()))
CurFace = TopoDS::Face(Flist.Last());
else
CurFace = TopoDS::Face(Flist.First());
if (CurFace.IsSame(theF1))
break;
else if (CurFace.IsSame(theF2))
{
ToExchange = Standard_True;
break;
} }
PrevEdge = CurEdge;
PrevFace = CurFace;
}
if (ToExchange)
{
TopoDS_Face TmpFace = theF1; theF1 = theF2; theF2 = TmpFace; TopoDS_Face TmpFace = theF1; theF1 = theF2; theF2 = TmpFace;
}
} }
static void ConcatCurves(TColGeom_SequenceOfCurve& theCurves, static void ConcatCurves(TColGeom_SequenceOfCurve& theCurves,
@ -944,7 +962,7 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin
Spine->SetEdges(Ec); Spine->SetEdges(Ec);
TopoDS_Face CurF1, CurF2; TopoDS_Face CurF1, CurF2;
ChFi3d_conexfaces(Ec,CurF1,CurF2,myEFMap); ChFi3d_conexfaces(Ec,CurF1,CurF2,myEFMap);
ReorderFaces(CurF1, CurF2, FirstFace, PrevEdge, CommonVertex); ReorderFaces(CurF1, CurF2, FirstFace, PrevEdge, CommonVertex, myEFMap);
myEdgeFirstFace.Bind(Ec, CurF1); myEdgeFirstFace.Bind(Ec, CurF1);
if (Offset > 0) if (Offset > 0)
{ {
@ -1030,7 +1048,7 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin
Spine->PutInFirst(Ec); Spine->PutInFirst(Ec);
TopoDS_Face CurF1, CurF2; TopoDS_Face CurF1, CurF2;
ChFi3d_conexfaces(Ec,CurF1,CurF2,myEFMap); ChFi3d_conexfaces(Ec,CurF1,CurF2,myEFMap);
ReorderFaces(CurF1, CurF2, FirstFace, PrevEdge, CommonVertex); ReorderFaces(CurF1, CurF2, FirstFace, PrevEdge, CommonVertex, myEFMap);
myEdgeFirstFace.Bind(Ec, CurF1); myEdgeFirstFace.Bind(Ec, CurF1);
if (Offset > 0) if (Offset > 0)
{ {

View File

@ -0,0 +1,22 @@
puts "=================================================================="
puts "OCC31023: Fillet regression in OCCT 7.4 from 7.3"
puts "=================================================================="
puts ""
brestore [locate_data_file bug31023.brep] a
explode a e
blend result a 0.1 a_25 0.1 a_26
checkshape result
checknbshapes result -face 26 -wire 26 -edge 60 -vertex 34
set tolres [checkmaxtol result]
if { ${tolres} > 0.0001} {
puts "Error: bad tolerance of result"
}
checkprops result -v 27.1174