mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0033227: Modeling Algorithm - BOPAlgo_BuilderSolid generates incomplete result
Deleted outer loop for shells. Added additional check of edges orientation for RefineShell().
This commit is contained in:
parent
cbf6b87074
commit
bffd568302
@ -248,24 +248,18 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
|
|||||||
//
|
//
|
||||||
// Build the shells
|
// Build the shells
|
||||||
aItF.Initialize (aLFConnected);
|
aItF.Initialize (aLFConnected);
|
||||||
for (i = 1; aItF.More() && !bAllFacesTaken; aItF.Next(), ++i) {
|
for (i = 1; aItF.More() && !bAllFacesTaken; aItF.Next(), ++i)
|
||||||
|
{
|
||||||
const TopoDS_Shape& aFF = aItF.Value();
|
const TopoDS_Shape& aFF = aItF.Value();
|
||||||
if (!AddedFacesMap.Add(aFF)) {
|
if (!AddedFacesMap.Add(aFF)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// make a new shell
|
// make a new shell
|
||||||
TopoDS_Shell aShellStart;
|
TopoDS_Shell aShell;
|
||||||
aBB.MakeShell(aShellStart);
|
aBB.MakeShell(aShell);
|
||||||
aBB.Add(aShellStart, aFF);
|
aBB.Add(aShell, aFF);
|
||||||
//
|
|
||||||
TopTools_ListOfShape aLShells;
|
|
||||||
aLShells.Append(aShellStart);
|
|
||||||
//
|
|
||||||
TopTools_ListIteratorOfListOfShape aItLShells(aLShells);
|
|
||||||
for (; aItLShells.More(); aItLShells.Next()) {
|
|
||||||
TopoDS_Shell& aShell = TopoDS::Shell(aItLShells.ChangeValue());
|
|
||||||
//
|
|
||||||
aMEFP.Clear();
|
aMEFP.Clear();
|
||||||
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
||||||
//
|
//
|
||||||
@ -389,26 +383,43 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
Standard_Integer aNbShNC = aLShNC.Extent();
|
|
||||||
if (aNbShNC == 1) {
|
|
||||||
// try to complete the shell with other faces
|
|
||||||
aLShells.Append(aLShNC);
|
|
||||||
}
|
|
||||||
else if (aNbShNC > 1) {
|
|
||||||
// remove th faces of not closed shells from the map of processed faces
|
// remove th faces of not closed shells from the map of processed faces
|
||||||
// and try to rebuild the shells using all not processed faces,
|
// and try to rebuild the shells using all not processed faces,
|
||||||
// because faces of one shell might be needed for building the other
|
// because faces of one shell might be needed for building the other
|
||||||
TopTools_ListIteratorOfListOfShape aItLShNC(aLShNC);
|
TopTools_ListIteratorOfListOfShape aItLShNC(aLShNC);
|
||||||
for (; aItLShNC.More(); aItLShNC.Next()) {
|
for (; aItLShNC.More(); aItLShNC.Next())
|
||||||
|
{
|
||||||
TopoDS_Iterator aItNC(aItLShNC.Value());
|
TopoDS_Iterator aItNC(aItLShNC.Value());
|
||||||
for (; aItNC.More(); aItNC.Next()) {
|
for (; aItNC.More(); aItNC.Next())
|
||||||
|
{
|
||||||
AddedFacesMap.Remove(aItNC.Value());
|
AddedFacesMap.Remove(aItNC.Value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
} // for (; aItF.More(); aItF.Next()) {
|
} // for (; aItF.More(); aItF.Next()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : FindShape
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
TopoDS_Shape FindShape (const TopoDS_Shape& theShapeToFind,
|
||||||
|
const TopoDS_Shape& theShape)
|
||||||
|
{
|
||||||
|
TopoDS_Shape aRes;
|
||||||
|
TopExp_Explorer anExp(theShape, theShapeToFind.ShapeType());
|
||||||
|
for (; anExp.More(); anExp.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Shape& aShape = anExp.Current();
|
||||||
|
if (aShape.IsSame(theShapeToFind))
|
||||||
|
{
|
||||||
|
aRes = aShape;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return aRes;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : RefineShell
|
//function : RefineShell
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -434,6 +445,21 @@ void RefineShell(TopoDS_Shell& theShell,
|
|||||||
aMEStop.Add(aE);
|
aMEStop.Add(aE);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (aLF.Extent() == 2)
|
||||||
|
{
|
||||||
|
const TopoDS_Face& aF1 = TopoDS::Face(aLF.First());
|
||||||
|
const TopoDS_Face& aF2 = TopoDS::Face(aLF.Last());
|
||||||
|
|
||||||
|
TopoDS_Shape aE1 = FindShape(aE, aF1);
|
||||||
|
TopoDS_Shape aE2 = FindShape(aE, aF2);
|
||||||
|
|
||||||
|
if (aE1.Orientation() == aE2.Orientation())
|
||||||
|
{
|
||||||
|
aMEStop.Add(aE);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// check for internal edges - count faces, in which the edge
|
// check for internal edges - count faces, in which the edge
|
||||||
// is internal, twice
|
// is internal, twice
|
||||||
|
13
tests/bugs/modalg_8/bug33227
Normal file
13
tests/bugs/modalg_8/bug33227
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "0033227: Modeling Algorithm - BOPAlgo_BuilderSolid generates incomplete result"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug33227.brep] s
|
||||||
|
bopbsolid r s
|
||||||
|
compound r_2 r_3 res
|
||||||
|
|
||||||
|
checknbshapes res -shell 6 -solid 2
|
||||||
|
checkprops res -v 3.33117e+07
|
||||||
|
|
||||||
|
checkview -display res -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user