mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0027762: Incorrect result of General Fuse operation
The algorithm of finding of extrema solutions of a point and a torus in Extrema_ExtPElS has been corrected for the case of torus having major radius equal to zero. Test cases are added.
This commit is contained in:
parent
2ba9eb3059
commit
5a0fc7ce60
@ -341,9 +341,10 @@ void Extrema_ExtPElS::Perform(const gp_Pnt& P,
|
||||
if(O1.SquareDistance(P) < Tol) { return; }
|
||||
if(O2.SquareDistance(P) < Tol) { return; }
|
||||
|
||||
Standard_Real V1 = OO1.AngleWithRef(gp_Vec(O1,P),OO1.Crossed(OZ));
|
||||
Standard_Real V1 = OPp.AngleWithRef(gp_Vec(O1,P),OPp.Crossed(OZ));
|
||||
if (V1 > -ExtPElS_MyEps && V1 < ExtPElS_MyEps) { V1 = 0.; }
|
||||
Standard_Real V2 = OO2.AngleWithRef(gp_Vec(P,O2),OO2.Crossed(OZ));
|
||||
OPp.Reverse();
|
||||
Standard_Real V2 = OPp.AngleWithRef(gp_Vec(P,O2),OPp.Crossed(OZ));
|
||||
if (V2 > -ExtPElS_MyEps && V2 < ExtPElS_MyEps) { V2 = 0.; }
|
||||
|
||||
if (V1 < 0.) { V1 += 2. * M_PI; }
|
||||
|
24
tests/bugs/modalg_6/bug27762_1
Normal file
24
tests/bugs/modalg_6/bug27762_1
Normal file
@ -0,0 +1,24 @@
|
||||
puts "========"
|
||||
puts "OCC27762"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Incomplete result of SECTION operation
|
||||
#################################################
|
||||
|
||||
restore [locate_data_file bug27762.brep] a
|
||||
explode a
|
||||
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects a_1
|
||||
baddtools a_2 a_3 a_4
|
||||
bfillds
|
||||
bbuild result
|
||||
|
||||
checkshape result
|
||||
checknbshapes result -face 6 -edge 20
|
||||
view 1 +X+Y 728 450 400 400
|
||||
don result
|
||||
fit
|
||||
checkview -2d -screenshot -path ${imagedir}/${test_image}.png
|
14
tests/bugs/modalg_6/bug27762_2
Normal file
14
tests/bugs/modalg_6/bug27762_2
Normal file
@ -0,0 +1,14 @@
|
||||
puts "========"
|
||||
puts "OCC27762"
|
||||
puts "========"
|
||||
puts ""
|
||||
# This is the second script that tries to reproduce the source of the problem -
|
||||
# impossibility to project a point on a torus with major radius == 0
|
||||
|
||||
torus s 0 10
|
||||
set out [proj s 1 0 0]
|
||||
if {[llength $out] != 4} {
|
||||
puts "Error: projection failed"
|
||||
} else {
|
||||
puts "OK : projection passed"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user