1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027035: General fuse algorithm loses face

The main reason of the bug is incorrect check, if the edge is seam-edge or not.
In the fix it is determined with new methods in GeomLib class.

The bug is fixed.

Creation of test case for this fix

Small correction in the code
This commit is contained in:
nbv
2016-02-15 13:51:12 +03:00
committed by abv
parent aff5997de8
commit 3906794761
6 changed files with 491 additions and 40 deletions

View File

@@ -45,6 +45,9 @@
#include <BOPTools_MapOfSet.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomLib.hxx>
#include <Precision.hxx>
#include <IntTools_Context.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Compound.hxx>
@@ -284,6 +287,9 @@ void BOPAlgo_Builder::BuildSplitFaces()
}
//
const TopoDS_Face& aF=(*(TopoDS_Face*)(&aSI.Shape()));
Standard_Boolean isUClosed = Standard_False,
isVClosed = Standard_False,
isChecked = Standard_False;
//
bHasFaceInfo=myDS->HasFaceInfo(i);
if(!bHasFaceInfo) {
@@ -321,8 +327,6 @@ void BOPAlgo_Builder::BuildSplitFaces()
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current()));
anOriE=aE.Orientation();
bIsDegenerated=BRep_Tool::Degenerated(aE);
bIsClosed=BRep_Tool::IsClosed(aE, aF);
//
if (!myImages.IsBound(aE)) {
if (anOriE==TopAbs_INTERNAL) {
@@ -335,48 +339,71 @@ void BOPAlgo_Builder::BuildSplitFaces()
else {
aLE.Append(aE);
}
continue;
}
else {//else 1
const BOPCol_ListOfShape& aLIE=myImages.Find(aE);
aIt.Initialize(aLIE);
for (; aIt.More(); aIt.Next()) {
aSp=(*(TopoDS_Edge*)(&aIt.Value()));
if (bIsDegenerated) {
aSp.Orientation(anOriE);
aLE.Append(aSp);
continue;
}
if(!isChecked)
{
const Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aF);
GeomLib::IsClosed(aSurf, BRep_Tool::Tolerance(aE),
isUClosed, isVClosed);
isChecked = Standard_True;
}
bIsClosed = Standard_False;
if((isUClosed || isVClosed) && BRep_Tool::IsClosed(aE, aF))
{
Standard_Boolean isUIso = Standard_False, isVIso = Standard_False;
BOPTools_AlgoTools2D::IsEdgeIsoline(aE, aF, isUIso, isVIso);
bIsClosed = ((isUClosed && isUIso) || (isVClosed && isVIso));
}
bIsDegenerated=BRep_Tool::Degenerated(aE);
const BOPCol_ListOfShape& aLIE=myImages.Find(aE);
aIt.Initialize(aLIE);
for (; aIt.More(); aIt.Next()) {
aSp=(*(TopoDS_Edge*)(&aIt.Value()));
if (bIsDegenerated) {
aSp.Orientation(anOriE);
aLE.Append(aSp);
continue;
}
//
if (anOriE==TopAbs_INTERNAL) {
aSp.Orientation(TopAbs_FORWARD);
aLE.Append(aSp);
aSp.Orientation(TopAbs_REVERSED);
aLE.Append(aSp);
continue;
}
//
if (anOriE==TopAbs_INTERNAL) {
if (bIsClosed) {
if (aMFence.Add(aSp)) {
if (!BRep_Tool::IsClosed(aSp, aF)){
BOPTools_AlgoTools3D::DoSplitSEAMOnFace(aSp, aF);
}
//
aSp.Orientation(TopAbs_FORWARD);
aLE.Append(aSp);
aSp.Orientation(TopAbs_REVERSED);
aLE.Append(aSp);
continue;
}
//
if (bIsClosed) {
if (aMFence.Add(aSp)) {
if (!BRep_Tool::IsClosed(aSp, aF)){
BOPTools_AlgoTools3D::DoSplitSEAMOnFace(aSp, aF);
}
//
aSp.Orientation(TopAbs_FORWARD);
aLE.Append(aSp);
aSp.Orientation(TopAbs_REVERSED);
aLE.Append(aSp);
}// if (aMFence.Add(aSp))
continue;
}// if (bIsClosed){
//
aSp.Orientation(anOriE);
bToReverse=BOPTools_AlgoTools::IsSplitToReverse(aSp, aE, myContext);
if (bToReverse) {
aSp.Reverse();
}
aLE.Append(aSp);
}// for (; aIt.More(); aIt.Next()) {
}// else 1
}// if (aMFence.Add(aSp))
continue;
}// if (bIsClosed){
//
aSp.Orientation(anOriE);
bToReverse=BOPTools_AlgoTools::IsSplitToReverse(aSp, aE, myContext);
if (bToReverse) {
aSp.Reverse();
}
aLE.Append(aSp);
}// for (; aIt.More(); aIt.Next()) {
}// for (; aExp.More(); aExp.Next()) {
//
//