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

0026431: Can't cut a sphere from a cylinder

This branch contains fixes for 26675 and 26431 bugs.

1. Normalization has been eliminated.
2. Interfaces of AppDef_Compute::Parametrization(...) and BRepAlgo_BooleanOperations::SetApproxParameters() methods have been changed.
3. Overloaded methods for ApproxInt_Approx::SetParameters(...), TopOpeBRepTool_GeomTool::GetTolerances(...) and TopOpeBRepTool_GeomTool::SetTolerances(...) have been removed (because some fields of these classes are not used more).
4. Comments for some methods have been changed in BRepApprox_TheMultiLineOfApprox.hxx and GeomInt_TheMultiLineOfWLApprox.hxx files.
5. Some fields have been deleted from ApproxInt_MultiLine class. Kept members have become constant.
6. Interface of ksection DRAW-command has been changed.
7. Now, 2dintersect DRAW-command prints information about found segments.
8. Some code fragments have been rewritten to make them easier.
9. Algorithm of splitting WLine, which goes through pole of sphere has been improved.
10. Improve approximation algorithm in order to it will compute correct 2D- and 3D-tangent at the end of bezier constraints (including case when curve goes through or finishes on singular points).
11. Interface of IntPatch_WLine::Dump(...) method has been corrected.
12. Some methods for working with Walking-line are made more universal (available for both GeomInt and IntTools packages).
13. Problem in BRepLib::SameParameter(...) method has been fixed (see corresponding comment).
14. Small correction in Draft package.
15. Any outputs in IntPatch_Intersection::Dump(...) method have become disabled because they are useless. If anybody need in this outputs he/she will correct this method himself/herself.

Adjusting some test cases according to their new behavior.
Creation of new test cases.

----------------------------------------------------------------------------------------------------------------------------

Some explanation of new behavior of some test cases:

 1. Regressions:

a) blend simple X4
The problem is described in the issue #0026740. According to this description,  the result on the current MASTER seems to be wrong indeed.

b) boolean bcommon_complex C7 and boolean bcut_complex Q1
These test case use same shapes with different Boolean operation (COMMON and CUT). They are already BAD (on the MASTER). Now, some sub-shapes have become not-shared, simply. In my opinion, we shall apply new behavior of these tests.

c) boolean bsection M3
The problem described in the issue #0026777 exists even on the current MASTER.

d) boolean bsection M9
The problem is described in the message http://tracker.dev.opencascade.org/view.php?id=26815#c47546. Here, we have really regression in the picture.

e) boolean bsection N2

The problem is described in issue #0026814.

f) boolean volumemaker G1

The problem is described in issue #26020.

g) bugs modalg_1 bug1255 (and bug1255_1)

The problem is described in issue #26815.

h) bugs modalg_2 bug5805_18, bugs modalg_2 bug5805_42, bugs modalg_2 bug5805_46

The problem is described in issue #25925.

i) bugs modalg_3 bug602

The problem is describes in issue #602.

j) bugs modalg_5 bug24915

The problem is described in the message http://tracker.dev.opencascade.org/view.php?id=25929#c48565. It is not fixed by this issue.

k) bugs modalg_5 bug25838

The main reason is described in issue #0026816.

----------------------------------------------------------------------------
2. Improvements:

a) boolean volumemaker F9
b) bugs modalg_1 bug10160_3
c) bugs modalg_2 bug22557
d) bugs modalg_5 bug25319_1 (_2)
e) draft angle G2
f) offset shape A1
g) offset with_intersect_80 N7
This commit is contained in:
nbv
2015-11-10 10:31:19 +03:00
committed by bugmaster
parent f44aa19760
commit 4e14c88f77
81 changed files with 5716 additions and 3883 deletions

View File

@@ -11,4 +11,4 @@ mkevol result s
updatevol s_7 0 10 1 20 2 10
buildevol
set square 11500.5
set square 12023.4

View File

@@ -1,3 +1,5 @@
puts "TODO OCC26932 Linux: Faulty shapes in variables faulty_1 to faulty"
beziercurve w1 5 0 0 0 20 0 0 20 5 0 25 10 0 10 20 0
mkedge w1 w1
polyline w2 10 20 0 0 0 0

View File

@@ -4,6 +4,8 @@
## Comment : From CV tests serie page 25/26
## ===========================================
puts "TODO #OCC26740 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file CCV_1_h1_gsk.rle] s
explode s E
blend result s 30 s_14

View File

@@ -5,7 +5,7 @@ restore [locate_data_file buc60290b.rle] sol2
bcommon result sol2 sol1
set square 667287
set square 685602
if { [regexp {Windows} [dversion]] } {
if { [regexp {64} [dversion]] } {
#set square 804392

View File

@@ -1,3 +1,5 @@
puts "TODO #OCC26777 ALL: Error : The length of the resulting shape is"
restore [locate_data_file GEN758_nofog.rle] a
explode a
bsection result a_1 a_2

View File

@@ -1,3 +1,5 @@
puts "TODO #OCC26814 ALL: Error : The length of the resulting shape is"
restore [locate_data_file lh3d_px1.brep] a
plane p 0 0 0 1 0 0
mkface f p

View File

@@ -34,5 +34,5 @@ mkface f6 con_f6 0 6.2831853071795862 0 1000000
# make volume operation
mkvolume result f1 f2 f3 f4 f5 f6
set square 3.67285e+006
set square 5.1932e+006

View File

@@ -39,4 +39,4 @@ mkface f7 con_f7 0 6.2831853071795862 0 1000000
# make volume operation
mkvolume result f1 f2 f3 f4 f5 f6 f7
set square 4.20797e+006
set square 6.22995e+006

View File

@@ -1,8 +1,6 @@
# test script on make volume operation
# cone cylinder plane
puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
# planar face
plane pln_f1 2.3537565147188571e-015 -592.35294118000002 1.1044592656221142e-015 0.90529096719956037 4.7161388709779336e-017 0.42479202523927467
erase pln_f1
@@ -41,5 +39,5 @@ mkface f7 cyl_f7 0 6.2831853071795862 -1000000 1000000
# make volume operation
mkvolume result f1 f2 f3 f4 f5 f6 f7
set square 1.71122e+013
set square 9.42987e+007

View File

@@ -2,6 +2,8 @@
# cone cylinder plane
# Error status: 102
puts "TODO OCC26020 ALL: Error : is WRONG because number of "
# conical face
cone con_f1 -59.814698440000001 384.36473473000001 127 0.41716766026590824 -0.90882954575006414 -5.4874902763032048e-016 89.995898744693349 0
erase con_f1
@@ -24,3 +26,6 @@ mkface f4 cyl_f4 0 6.2831853071795862 -1000000 1000000
# make volume operation
mkvolume result f1 f2 f3 f4
checknbshapes result -vertex 6 -edge 11 -wire 11 -face 8 -shell 4 -solid 2 -compsolid 0 -compound 1 -shape 43

View File

@@ -66,5 +66,5 @@ copy r_1 result
# An exception was caught Standard_ConstructionError:
# ** Exception ** Standard_ConstructionError:
set square 1.59518e+07
set square 2.15333e+007
set 2dviewer 0

View File

@@ -33,5 +33,5 @@ if { $MaxFaceTolerance > 1 || $MaxEdgeTolerance > 1 || $MaxVertexTolerance > 1 }
puts "Tolerance of shape is less then 1.0"
}
set square 4.21741e+007
set square 3.87049e+007
set 2dviewer 0

View File

@@ -50,5 +50,5 @@ if { $MaxFaceTolerance > 1 || $MaxEdgeTolerance > 1 || $MaxVertexTolerance > 1 }
} else {
puts "Tolerance of shape is less then 1.0"
}
set square 4.03996e+007
set square 3.71909e+007
set 2dviewer 0

View File

@@ -66,5 +66,5 @@ if { $MaxFaceTolerance > 2 || $MaxEdgeTolerance > 2 || $MaxVertexTolerance > 2 }
} else {
puts "Tolerance of shape is less then 2.0"
}
set square 1.74934e+007
set square 1.341e+007
set 2dviewer 0

View File

@@ -1,5 +1,4 @@
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
puts "TODO OCC11111 ALL: Error : The square of result shape is"
puts "============"
puts "OCC10160"
puts "============"

View File

@@ -2,7 +2,11 @@ puts "================"
puts "OCC1255"
puts "================"
puts ""
# Exception in command 'section'
###############################################
## Exception in command 'section'
###############################################
puts "TODO #OCC26815 ALL: Error : The length of result shape is"
restore [locate_data_file OCC1255.brep] a
checkshape a

View File

@@ -7,6 +7,8 @@ puts ""
# (This script tests new topology)
###############################################
puts "TODO #OCC26815 ALL: Error : The length of result shape is"
restore [locate_data_file OCC1255.brep] a
checkshape a

View File

@@ -1,6 +1,3 @@
puts "TODO OCC21564 ALL: The square of result shape is"
puts "TODO OCC21564 ALL: Error : is WRONG because number of "
puts "============"
puts "OCC22557"
puts "============"
@@ -24,7 +21,7 @@ puts "Start boolean operation ..."
bopcut result
puts "Finish boolean operation ..."
set square 0.172993
set square 0.172994
checknbshapes result -vertex 192 -edge 288 -wire 98 -face 98 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 679

View File

@@ -1,4 +1,7 @@
puts "TODO OCC25925 ALL: Faulty shapes in variables faulty_1 to"
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
puts "TODO OCC25925 ALL: Faulty OCC5805 : result is not Closed shape"
puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
puts "============"
puts "OCC5805"

View File

@@ -1,5 +1,6 @@
puts "TODO OCC25925 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC25925 ALL: Error : is WRONG because number of"
puts "TODO OCC25925 ALL: ERROR. offsetperform operation not done."
puts "TODO OCC25925 ALL: Tcl Exception: Error : command \\\"nbshapes result\\\" gives an empty result"
puts "TODO OCC25925 ALL: TEST INCOMPLETE"
puts "============"
puts "OCC5805"

View File

@@ -30,7 +30,7 @@ set distance -0.1
catch { OFFSETSHAPE $distance {s_3} $calcul $type }
set square 1470.32
set square 1485.75
checknbshapes result -vertex 4 -edge 6 -wire 6 -face 5 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 23

View File

@@ -1,5 +1,6 @@
puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC12345 ALL: Error : The square of result shape is"
puts "TODO OCC00000 ALL: Faulty OCC602: function BLEND works wrongly"
puts "TODO OCC00000 ALL: Tcl Exception: result is not a topological shape!!!"
puts "TODO OCC00000 ALL: TEST INCOMPLETE"
puts "========================"
puts " OCC602 "

View File

@@ -5,7 +5,8 @@ puts ""
###########################################################
# Wrong pcurve of the section curve
###########################################################
set MaxTol 1.05e-6
set MaxTol 3.0e-5
set NbCurv_OK 1
restore [locate_data_file bug24585_b1.brep] b1
@@ -50,4 +51,18 @@ if {${delta_l} != 0} {
puts "Error: Bad value. U_end = [dval U_end], Ulast = [dval U1l_exp]."
} else {
puts "OK: Good value. U_end matches with Ulast of surface."
}
}
puts ""
puts "Check if tangents in first and last point of line have the same directions"
#See bug#26752
cvalue c_1 U1 xx yy zz dx1 dy1 dz1
cvalue c_1 U2 xx yy zz dx2 dy2 dz2
set DP [dval dx1*dx2+dy1*dy2+dz1*dz2]
if {${DP} < 0} {
puts "Error: Tangents are reversed. Bug 26752 is reproduced."
} else {
puts "OK: Tangents are not reversed."
}

View File

@@ -1,10 +1,4 @@
puts "TODO OCC25929 ALL: Error: Tolerance is too big!"
puts "TODO OCC21564 Linux: Error : T=0.464646\tD=0.000326627"
puts "TODO OCC21564 Linux: Error : T=0.464646\tD=0.00032747"
puts "TODO OCC21564 Windows: Error : T=0.464646\tD=0.000326671"
puts "TODO OCC21564 Windows: Error : T=0.464646\tD=0.000327516"
puts "TODO OCC26927 ALL: Error: Tolerance is too big!"
puts "========="
puts "CR24915"
@@ -30,8 +24,8 @@ bbuild r
checkshape r
# 2. geometry
set MaxTol 5.0e-7
set log [bopcurves b1 b2]
set MaxTol 1.0e-7
set log [bopcurves b1 b2 -2d]
if { ! [regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv] } {
puts "Error: Cannot find tolerance value in output of bopcurve command"
@@ -41,18 +35,6 @@ if {${Toler} > ${MaxTol}} {
puts "Error: Tolerance is too big!"
}
mksurface s1 b1
mksurface s2 b2
set Tolerance 2.0e-5
set WarnTol 1.0e-7
for {set i 1} {$i <= ${NbCurv}} {incr i} {
bounds c_$i U1 U2
xdistcs c_$i s1 U1 U2 100 $Tolerance $WarnTol
xdistcs c_$i s2 U1 U2 100 $Tolerance $WarnTol
}
smallview
donly b2 c_2
fit

View File

@@ -1,5 +1,3 @@
puts "TODO OCC26417 ALL: Faulty shapes in variables faulty_1"
puts "================"
puts "OCC25319"
puts "================"
@@ -15,5 +13,5 @@ bcommon result b1 b2
set square 1690.81
checknbshapes result -vertex 19 -edge 30 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 78
checknbshapes result -vertex 20 -edge 31 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 80
set 2dviewer 1

View File

@@ -1,5 +1,3 @@
puts "TODO OCC26417 ALL: Faulty shapes in variables faulty_1"
puts "================"
puts "OCC25319"
puts "================"
@@ -18,5 +16,5 @@ bcommon result b1 b2
set square 1690.81
checknbshapes result -vertex 19 -edge 30 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 78
checknbshapes result -vertex 20 -edge 31 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 80
set 2dviewer 1

View File

@@ -5,6 +5,8 @@ puts ""
###############################################
# Wrong result obtained by General Fuse operator.
###############################################
puts "TODO #OCC26816 ALL: Error : Result done by General Fuse operator is WRONG because number of"
puts "TODO #OCC26816 ALL: Faulty shapes in variables faulty_1 to faulty_"
restore [locate_data_file bug25715_p02c3s1.brep] b1
restore [locate_data_file bug25838_p02c3s2.brep] b2

View File

@@ -0,0 +1,21 @@
puts "============"
puts "OCC26431"
puts "============"
puts ""
###############################
## Can't cut a sphere from a cylinder
###############################
restore [locate_data_file bug26431_Body.brep] b1
restore [locate_data_file bug26431_Sphere.brep] b2
explode b1 f
explode b2 f
set log [bopcurves b1_3 b2_1 -2d]
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Tolerance_Reached NbCurv
set expected_Tolerance_Reached 6.1899285293702062e-006
set tol_abs_Tolerance_Reached 1.0e-7
set tol_rel_Tolerance_Reached 0.0
checkreal "Tolerance Reached" ${Tolerance_Reached} ${expected_Tolerance_Reached} ${tol_abs_Tolerance_Reached} ${tol_rel_Tolerance_Reached}

View File

@@ -0,0 +1,28 @@
puts "============"
puts "OCC26431"
puts "============"
puts ""
###############################
## Can't cut a sphere from a cylinder
###############################
restore [locate_data_file bug26431_Body.brep] b1
restore [locate_data_file bug26431_Sphere.brep] b2
explode b1 f
explode b2 f
bsection result b1_3 b2_1
set log [checksection result]
if { [string compare -nocase $log " nb alone Vertices : 0\n\n"] } {
puts "ERROR: the section is not closed"
} else {
puts "The section is OK"
}
smallview
donly result
fit
set only_screen_axo 1

View File

@@ -0,0 +1,68 @@
puts "============"
puts "OCC26431"
puts "============"
puts ""
###############################
## Can't cut a sphere from a cylinder
###############################
restore [locate_data_file bug26431_Body.brep] b1
restore [locate_data_file bug26431_Sphere.brep] b2
bop b1 b2
bopcut result
checkshape result
decho off
dlog reset
dlog on
bopargcheck result #F
set info [dlog get]
dlog reset
dlog off
decho on
set MessageList {
"Faulties for FIRST shape found : 9"
"Shapes are not suppotrted by BOP: NO"
"Self-Intersections : NO"
"Check for SI has been aborted : NO"
"Too small edges : NO"
"Bad faces : NO"
"Too close vertices : DISABLED"
"Too close edges : DISABLED"
"Shapes with Continuity C0 : YES Cases\\(9\\) Total shapes\\(9\\)"
"Invalid Curve on Surface : NO"
"Faulties for SECOND shape found : 0"
}
for {set i 1} {$i <= 11} {incr i} {
set str [ lindex ${MessageList} [expr $i - 1] ]
if { [regexp ${str} ${info}] == 1 } {
puts "OK : There is #$i message"
} else {
puts "Error : There is not #$i message"
puts $str
}
}
set square 14.4399
set nbshapes_expected "
Number of shapes in shape
VERTEX : 7
EDGE : 20
WIRE : 7
FACE : 6
SHELL : 1
SOLID : 1
COMPSOLID : 0
COMPOUND : 1
SHAPE : 43
"
checknbshapes result -ref ${nbshapes_expected} -t -m "solid construction"
set 3dviewer 1

View File

@@ -0,0 +1,58 @@
puts "============"
puts "OCC26675"
puts "============"
puts ""
###############################
## 0026675: Eliminate normalization of coordinates in ApproxInt package
###############################
set GoodNbCurv 1
pload QAcommands
OCC26675_1 ss
intersect res ss_1 ss_2
set che [whatis res]
set ind [string first "3d curve" $che]
if {${ind} >= 0} {
#Only variable "res" exists
renamevar res res_1
}
set ic 1
set AllowRepeate 1
while { $AllowRepeate != 0 } {
set che [whatis res_$ic]
set ind [string first "3d curve" $che]
if {${ind} < 0} {
set AllowRepeate 0
} else {
display res_$ic
bounds res_$ic U1 U2
dval U1
dval U2
if {[dval U2-U1] < 1.0e-20} {
puts "Error: Wrong curve's range!"
}
xdistcs res_$ic ss_1 U1 U2 10 4.6e-6
xdistcs res_$ic ss_2 U1 U2 10 4.3e-6
incr ic
}
}
if {[expr {$ic - 1}] == $GoodNbCurv} {
puts "OK: Curve Number is good!"
} else {
puts "Error: Curve Number is bad!"
}
smallview
fit
set only_screen_axo 1

View File

@@ -1,8 +1,4 @@
#E6----------------------------------------------
#puts "TODO OCC22803 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "TODO OCC26426 ALL: Error: The tolerance of the resulting shape is too big "
ptorus pt 25 24 90
profile pr o 20 18 5 p 0 -1 0 1 0 0 l 10 t 0 30 \
t -7 0
@@ -12,5 +8,4 @@ nexplode f f
depouille result f 0 0 1 f_5 3 0 0 35 0 0 1 \
f_6 3 0 0 35 0 0 1
# square is different according to issue 25111, the result is visually good but invalid (bad orientation of subshape), that's why the area may occur negative
set square 10782.8

View File

@@ -1,11 +1,13 @@
puts "TODO OCC23068 ALL: Error : The offset is not valid"
puts "TODO OCC26556 ALL: ERROR. offsetperform operation not done."
# Original bug : hkg60144
# Date : 17Juillet98
# Date : July, 17 1998
puts "TODO OCC23068 Linux: Error : The offset is not valid"
puts "TODO OCC23068 Linux: ERROR. offsetperform operation not done."
puts "TODO OCC23068 Linux: Error : The volume of the resulting shape is"
restore [locate_data_file CHE900_hkg60iob.rle] s
explode s f
offsetshape result s -5 s_1
set volume 0
set volume 2.12817e+006

View File

@@ -1,6 +1,5 @@
puts "TODO OCC26577 All: Error : is WRONG because number of EDGE entities in shape"
puts "TODO OCC26577 All: Error : is WRONG because number of SHELL entities in shape"
puts "TODO OCC26577 All: Faulty shapes in variables faulty_1 to faulty"
restore [locate_data_file bug26663_test_offset_L6.brep] s
OFFSETSHAPE ${off_param} {} ${calcul} ${type}
checknbshapes result -ref [lrange [nbshapes s] 8 19]