1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0026955: Invalid result of General Fuse operation

Running Solid Classifier algorithm with correct tolerance for point. Patch for 6.9.1 version of OCCT.
This commit is contained in:
emv
2015-12-08 18:06:13 +03:00
parent 3b5f0ca372
commit f50d842418
2 changed files with 47 additions and 1 deletions

View File

@@ -17,6 +17,8 @@
#include <Standard_DefineHandle.hxx>
#include <MMgt_TShared.hxx>
//
#include <Precision.hxx>
//
#include <NCollection_Vector.hxx>
#include <NCollection_Map.hxx>
//
@@ -82,6 +84,7 @@ class BRepCheck_ToolSolid {
BRepCheck_ToolSolid() {
myIsHole=Standard_False;
myPntTol=Precision::Confusion();
myPnt.SetCoord(-1.,-1.,-1.);
};
@@ -104,6 +107,10 @@ class BRepCheck_ToolSolid {
return myPnt;
}
//
Standard_Real CheckTol() const {
return myPntTol;
};
//
// IsOut
Standard_Boolean IsOut(BRepCheck_ToolSolid& aOther) {
Standard_Boolean bFlag;
@@ -111,7 +118,7 @@ class BRepCheck_ToolSolid {
//
BRepClass3d_SolidClassifier& aSC=myHSC->SolidClassifier();
//
aSC.Perform(aOther.myPnt, ::RealSmall());
aSC.Perform(aOther.InnerPoint(), aOther.CheckTol());
aState=aSC.State();
bFlag=(aState==TopAbs_OUT);
//
@@ -143,6 +150,7 @@ class BRepCheck_ToolSolid {
Handle(Geom_Curve) aC3D=BRep_Tool::Curve(aE, aT1, aT2);
aT=(1.-aPAR_T)*aT1 + aPAR_T*aT2;
myPnt=aC3D->Value(aT);
myPntTol = BRep_Tool::Tolerance(aE);
break;
}
}
@@ -151,6 +159,7 @@ class BRepCheck_ToolSolid {
protected:
Standard_Boolean myIsHole;
gp_Pnt myPnt;
Standard_Real myPntTol;
TopoDS_Solid mySolid;
Handle(BRepCheck_HSC) myHSC;
};

View File

@@ -0,0 +1,37 @@
puts "========"
puts "OCC26955"
puts "========"
puts ""
#################################
# Invalid result of General Fuse operation
#################################
restore [locate_data_file bug26955_input0.brep] b1
restore [locate_data_file bug26955_input1.brep] b2
restore [locate_data_file bug26955_input2.brep] b3
bclearobjects
bcleartools
baddobjects b1 b2 b3
bfillds
bbuild result
set square 24516.1
set nbshapes_expected "
Number of shapes in shape
VERTEX : 14
EDGE : 22
WIRE : 14
FACE : 13
SHELL : 4
SOLID : 3
COMPSOLID : 0
COMPOUND : 1
SHAPE : 71
"
checknbshapes result -ref ${nbshapes_expected} -t
set 2dviewer 1