Archived issue #0033561
BRepAlgoAPI_Defeaturing never finishes
Description
When use BRepAlgoAPI_Defeaturing to remove a small face (created by BRepFilletAPI_MakeFillet) (the brep file is attahced), the BRepAlgoAPI_Defeaturing never finishes, it loops in IntTools_BeanFaceIntersector::ComputeLocalized with huge amount of surface ranges (20355, 40000+, ...), tested with 7.6.1, 7.7.0, 7.8.0
Steps to reproduce
Run below test code with attached brep file:
void test()
{
BRep_Builder bb;
TopoDS_Shape targetEntityShape;
const char* brepFile = "D:/tmp/Attachment 1 (BREP)";
if (!BRepTools::Read(targetEntityShape, brepFile, bb)) {
return;
}
bool isValid = BRepCheck_Analyzer(targetEntityShape).IsValid();
if (!isValid) {
return;
}
TopoDS_Face face;
int i = 0;
for (TopExp_Explorer faceExplorer(targetEntityShape, TopAbs_FACE); faceExplorer.More(); faceExplorer.Next()) {
if (i == 1) {
face = TopoDS::Face(faceExplorer.Current());
break;
}
i++;
}
TopTools_ListOfShape faceShapes;
faceShapes.Append(face);
BRepAlgoAPI_Defeaturing aDefeaturing;
aDefeaturing.SetShape(targetEntityShape);
aDefeaturing.AddFacesToRemove(faceShapes);
aDefeaturing.SetRunParallel(false);
aDefeaturing.SetToFillHistory(true);
// Perform.
aDefeaturing.Build();
if (!aDefeaturing.IsDone() || aDefeaturing.HasWarnings()) {
return;
}
TopoDS_Shape result = aDefeaturing.Shape();
return;
}
void test()
{
BRep_Builder bb;
TopoDS_Shape targetEntityShape;
const char* brepFile = "D:/tmp/Attachment 1 (BREP)";
if (!BRepTools::Read(targetEntityShape, brepFile, bb)) {
return;
}
bool isValid = BRepCheck_Analyzer(targetEntityShape).IsValid();
if (!isValid) {
return;
}
TopoDS_Face face;
int i = 0;
for (TopExp_Explorer faceExplorer(targetEntityShape, TopAbs_FACE); faceExplorer.More(); faceExplorer.Next()) {
if (i == 1) {
face = TopoDS::Face(faceExplorer.Current());
break;
}
i++;
}
TopTools_ListOfShape faceShapes;
faceShapes.Append(face);
BRepAlgoAPI_Defeaturing aDefeaturing;
aDefeaturing.SetShape(targetEntityShape);
aDefeaturing.AddFacesToRemove(faceShapes);
aDefeaturing.SetRunParallel(false);
aDefeaturing.SetToFillHistory(true);
// Perform.
aDefeaturing.Build();
if (!aDefeaturing.IsDone() || aDefeaturing.HasWarnings()) {
return;
}
TopoDS_Shape result = aDefeaturing.Shape();
return;
}
Additional information
the test file is attached along with a screen shot to indicate the small face to be removed
Public activity
1 archived note
Participants are labeled by their role within this record.
test files.
Attachment 1 (BREP) (130,482 bytes)
Attachment 2 (JPG) (271,772 bytes)