1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

0026582: Wrong result obtained by Common operator

class BOPAlgo_WireSplitter
   - static function:
Standard_Real Angle2D (const TopoDS_Vertex& aV,
                         const TopoDS_Edge& anEdge,
                         const TopoDS_Face& myFace,
                         const GeomAdaptor_Surface& aGAS,
                         const Standard_Boolean bIsIN)
The treatment of circles has been chenged to prevent
the loss of accuracy due to small differences in large values.

Small correction of test case for issue CR26582

Test case for issue CR26582
This commit is contained in:
pkv 2015-09-03 15:02:06 +03:00 committed by bugmaster
parent a849d42d32
commit 876ca54f0a
3 changed files with 61 additions and 5 deletions

View File

@ -743,7 +743,8 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo)
GeomAbs_CurveType aType;
Geom2dAdaptor_Curve aGAC2D(aC2D);
aType=aGAC2D.GetType();
if (aType==GeomAbs_BSplineCurve || aType==GeomAbs_BezierCurve) {
if (aType==GeomAbs_BSplineCurve ||
aType==GeomAbs_BezierCurve) {
dt=1.1*dt;
}
if (fabs (aTV-aFirst) < fabs(aTV - aLast)) {
@ -753,10 +754,25 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo)
aTV1=aTV - dt;
}
//
if (aType==GeomAbs_Circle) {
Standard_Real aTM;
TopAbs_Orientation aOrE;
gp_Pnt2d aPM;
//
aTM=0.5*(aTV1+aTV);
//
aGAC2D.D1(aTM, aPM, aV2D);
aOrE=anEdge.Orientation();
if (aOrE==TopAbs_REVERSED) {
aV2D.Reverse();
}
}
else {
aGAC2D.D0 (aTV1, aPV1);
aGAC2D.D0 (aTV, aPV);
//
aV2D = bIsIN ? gp_Vec2d(aPV1, aPV) : gp_Vec2d(aPV, aPV1);
}
//
gp_Dir2d aDir2D(aV2D);
anAngle=Angle(aDir2D);

View File

@ -1,4 +1,5 @@
puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
puts "TODO OCC26582 ALL: Error : The square of result shape is"
puts "========="
puts " OCC497 "

39
tests/bugs/modalg_6/bug26582 Executable file
View File

@ -0,0 +1,39 @@
puts "============"
puts "OCC26582"
puts "============"
puts ""
###############################
## Wrong result obtained by Common operator.
###############################
restore [locate_data_file bug26582_bx.brep] bx
explode bx
copy bx_1 b1
copy bx_2 b2
bclearobjects
bcleartools
baddobjects b1
baddtools b2
bfillds
bbop result 0
set square 39.1778
set nbshapes_expected "
Number of shapes in shape
VERTEX : 5
EDGE : 7
WIRE : 3
FACE : 3
SHELL : 1
SOLID : 0
COMPSOLID : 0
COMPOUND : 1
SHAPE : 20
"
checknbshapes result -ref ${nbshapes_expected} -t -m "result obtained by Common operator"
set 3dviewer 1