mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0029333: Boolean Operations - Prevent modification of the input shapes in case their sub-shapes have not been modified
Prevent modification of the input shapes in destructive mode in case their sub-shapes have not been modified: 1. Prevent edge splitting for the pave blocks with old vertices if it is possible to use the existing edge (*BOPAlgo_PaveFiller::MakeSplitEdges*); 2. Prevent creation of the new containers (WIRES/SHELLS/COMPSOLIDS) if non of its parts have been modified (*BOPAlgo_Builder::FillImagesContainer*); 3. Prevent creation of the new face if non of its wires have been modified (*BOPAlgo_Builder::FillImagesFaces*); 4. If possible, use the original face to be the representative for the group of SD faces (*BOPAlgo_Builder::FillSameDomainFaces*). Cosmetic changes: 1. Documentation of the *BOPAlgo_Builder* class. 2. Making simple methods of the *BOPAlgo_Builder* class inline. 3. Getting rid of the *BOPAlgo_Builder::mySplits* field as it is excessive. *BOPAlgo_Builder::myImages* can be used instead. 3. Moving the Check Inverted option from *BOPAlgo_Options* to *BOPAlgo_Builder*. Test cases for the issue. Adjustment of the test case to their current behavior. Test case *blend/complex/H2* has been deleted as duplicate of the test case *blend/simple/Z1*.
This commit is contained in:
@@ -8,6 +8,6 @@ pcylinder c2 5 20
|
||||
ttranslate c2 4.9 0 10
|
||||
bfuse f c1b c2
|
||||
explode f E
|
||||
blend result f 4.9 f_5
|
||||
blend result f 4.9 f_4
|
||||
|
||||
checkprops result -s 2104.35
|
||||
|
@@ -1,16 +0,0 @@
|
||||
# ====================================
|
||||
## Grid : CFI900
|
||||
## Test : N1
|
||||
## Comment : from USA60109
|
||||
## ====================================
|
||||
|
||||
pcylinder c1 10 20
|
||||
pcylinder c2 5 20
|
||||
ttranslate c2 5 0 20
|
||||
bfuse f c1 c2
|
||||
explode f E
|
||||
blend result f 1 f_1
|
||||
explode result sh
|
||||
renamevar result_1 result
|
||||
|
||||
checkprops result -s 2485.86
|
@@ -5,6 +5,6 @@ pcylinder c 1 10
|
||||
ttranslate c 2.5 2.5 2.5
|
||||
bfuse s c b
|
||||
explode s E
|
||||
blend result s 1 s_3
|
||||
blend result s 1 s_2
|
||||
|
||||
checkprops result -s 192.343
|
||||
|
@@ -7,8 +7,8 @@ ttranslate c2 5 0 20
|
||||
|
||||
bfuse f c1 c2
|
||||
|
||||
explode f E
|
||||
explode c1 e
|
||||
|
||||
blend result f 1 f_1
|
||||
blend result f 1 c1_3
|
||||
|
||||
checkprops result -s 2485.86
|
||||
|
@@ -26,7 +26,7 @@ bop beam_1 cut_2
|
||||
bopcut result
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -solid 2 -shell 2 -face 32 -wire 39
|
||||
checknbshapes result -solid 2 -shell 2 -face 33 -wire 40 -t
|
||||
checkprops result -v 5.40325e+7
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
@@ -42,7 +42,7 @@ bop beam_2 cut_2
|
||||
bopcut result
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -solid 4 -shell 4 -face 64 -wire 73
|
||||
checknbshapes result -solid 4 -shell 4 -face 64 -wire 73 -t
|
||||
checkprops result -v 1.61677e+8
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
@@ -11,20 +11,15 @@ puts ""
|
||||
|
||||
smallview
|
||||
|
||||
box a -1.5 -1.5 0 3 3 3
|
||||
box b -3 -3 -3 6 6 3
|
||||
bfuse result a b
|
||||
set bug_info [string trim [checkshape result]]
|
||||
if {$bug_info != "This shape seems to be valid"} {
|
||||
puts "ERROR: Problem of test case functionality. Should be additionally investigated."
|
||||
}
|
||||
restore [locate_data_file bug27711.brep] s
|
||||
|
||||
clear
|
||||
display result
|
||||
display s
|
||||
fit
|
||||
xwd $imagedir/${casename}_step_0.png
|
||||
|
||||
explode result e
|
||||
blend result result 0.5 result_12 0.5 result_11
|
||||
explode s e
|
||||
blend result s 0.5 s_12 0.5 s_11
|
||||
set bug_info [string trim [checkshape result]]
|
||||
if {$bug_info != "This shape seems to be valid"} {
|
||||
puts "ERROR: Problem of test case functionality. Should be additionally investigated."
|
||||
|
65
tests/bugs/modalg_7/bug29333_1
Normal file
65
tests/bugs/modalg_7/bug29333_1
Normal file
@@ -0,0 +1,65 @@
|
||||
puts "========"
|
||||
puts "OCC29333"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Boolean Operations - Prevent modification of the input shapes in case their sub-shapes have not been modified
|
||||
#################################################
|
||||
|
||||
# create two touching faces
|
||||
plane p 0 0 0 0 0 1
|
||||
mkface f1 p -10 10 -10 10
|
||||
|
||||
copy f1 f2
|
||||
ttranslate f2 20 0 0
|
||||
|
||||
# fuse these faces
|
||||
bfuse s f1 f2
|
||||
|
||||
# split one of these faces
|
||||
explode s f
|
||||
|
||||
line l 0 0 0 1 0 0
|
||||
mkedge e l
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects s_1
|
||||
baddtools e
|
||||
bfillds
|
||||
bsplit s1_sp
|
||||
|
||||
|
||||
# fuse again
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects s1_sp
|
||||
baddtools s_2
|
||||
bfillds
|
||||
bbuild result
|
||||
|
||||
checkshape result
|
||||
checkprops result -s 800
|
||||
checknbshapes result -vertex 8 -edge 10 -wire 3 -face 3
|
||||
|
||||
|
||||
# check that non of the shapes from s1_sp is modified
|
||||
compound result s1_sp c
|
||||
checknbshapes c -vertex 8 -edge 10 -wire 3 -face 3
|
||||
|
||||
|
||||
# fuse with different order
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects s_2
|
||||
baddtools s1_sp
|
||||
bfillds
|
||||
bbuild result
|
||||
|
||||
checkshape result
|
||||
checkprops result -s 800
|
||||
checknbshapes result -vertex 8 -edge 10 -wire 3 -face 3
|
||||
|
||||
|
||||
# check that non of the shapes from s1_sp is modified
|
||||
compound result s1_sp c
|
||||
checknbshapes c -vertex 8 -edge 10 -wire 3 -face 3
|
62
tests/bugs/modalg_7/bug29333_2
Normal file
62
tests/bugs/modalg_7/bug29333_2
Normal file
@@ -0,0 +1,62 @@
|
||||
puts "========"
|
||||
puts "OCC29333"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Boolean Operations - Prevent modification of the input shapes in case their sub-shapes have not been modified
|
||||
#################################################
|
||||
|
||||
# create two touching boxes
|
||||
box b1 10 10 10
|
||||
box b2 10 0 0 10 10 10
|
||||
|
||||
# make them share the common face
|
||||
mkvolume s b1 b2
|
||||
|
||||
# split one of these solids
|
||||
explode s so
|
||||
|
||||
plane p 0 0 5 0 0 1
|
||||
mkface f p
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects s_1
|
||||
baddtools f
|
||||
bfillds
|
||||
bsplit s1_sp
|
||||
|
||||
|
||||
# fuse again
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects s1_sp
|
||||
baddtools s_2
|
||||
bfillds
|
||||
bbuild result
|
||||
|
||||
checkshape result
|
||||
checkprops result -s 1400 -v 2000
|
||||
checknbshapes result -vertex 16 -edge 28 -wire 16 -face 16 -shell 3 -solid 3
|
||||
|
||||
|
||||
# check that non of the shapes from s1_sp is modified
|
||||
compound result s1_sp c
|
||||
checknbshapes c -vertex 16 -edge 28 -wire 16 -face 16 -shell 3 -solid 3
|
||||
|
||||
|
||||
# fuse with different order
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects s_2
|
||||
baddtools s1_sp
|
||||
bfillds
|
||||
bbuild result
|
||||
|
||||
checkshape result
|
||||
checkprops result -s 1400 -v 2000
|
||||
checknbshapes result -vertex 16 -edge 28 -wire 16 -face 16 -shell 3 -solid 3
|
||||
|
||||
|
||||
# check that non of the shapes from s1_sp is modified
|
||||
compound result s1_sp c
|
||||
checknbshapes c -vertex 16 -edge 28 -wire 16 -face 16 -shell 3 -solid 3
|
@@ -9,7 +9,7 @@
|
||||
# 1. Create 3 boxes $B1, $B2, $B3
|
||||
# 2. $FS1 = Fuse ($B1, $B2)
|
||||
# 3. $FS2 = Fuse ($B1, $B3)
|
||||
# 4. Make selections of the face 'fuse2_23'
|
||||
# 4. Make selections of the face 'fuse2_19'
|
||||
# 5. Modify B2
|
||||
# 6. Recompute
|
||||
# ===============================================
|
||||
@@ -37,12 +37,12 @@ GetShape $doc $FS2:2 fuse2
|
||||
explode fuse2 f
|
||||
|
||||
|
||||
#4. select fuse2_23 (using SelectShape)
|
||||
set Sel1 0:2:23
|
||||
SelectShape $doc $Sel1 fuse2_23 fuse2
|
||||
GetShape $doc $Sel1 f23before
|
||||
#f23before is face
|
||||
set info1 [whatis f23before]
|
||||
#4. select fuse2_19 (using SelectShape)
|
||||
set Sel1 0:2:19
|
||||
SelectShape $doc $Sel1 fuse2_19 fuse2
|
||||
GetShape $doc $Sel1 f19before
|
||||
#f19before is face
|
||||
set info1 [whatis f19before]
|
||||
|
||||
|
||||
#5. Modify
|
||||
@@ -53,40 +53,40 @@ ComputeFun $doc $B2:1
|
||||
ComputeFun $doc $FS1
|
||||
ComputeFun $doc $FS2
|
||||
SolveSelection $doc $Sel1
|
||||
GetShape $doc $Sel1 f23after
|
||||
#f23after is face
|
||||
set info2 [whatis f23after]
|
||||
GetShape $doc $Sel1 f19after
|
||||
#f19after is face
|
||||
set info2 [whatis f19after]
|
||||
|
||||
if { [regexp "shape" $info1] != 1 } {
|
||||
puts "Error : There is not word shape in f23after"
|
||||
puts "Error : There is not word shape in f19after"
|
||||
}
|
||||
if { [regexp "FACE" $info1] != 1 } {
|
||||
puts "Error : There is not word FACE in f23after"
|
||||
puts "Error : There is not word FACE in f19after"
|
||||
}
|
||||
if { [regexp "REVERSED" $info1] != 1 } {
|
||||
puts "Error : There is not word REVERSED in f23after"
|
||||
puts "Error : There is not word REVERSED in f19after"
|
||||
}
|
||||
if { [regexp "Modified" $info1] != 1 } {
|
||||
puts "Error : There is not word Modified in f23after"
|
||||
puts "Error : There is not word Modified in f19after"
|
||||
}
|
||||
if { [regexp "Orientable" $info1] != 1 } {
|
||||
puts "Error : There is not word Orientable in f23after"
|
||||
puts "Error : There is not word Orientable in f19after"
|
||||
}
|
||||
|
||||
if { [regexp "shape" $info2] != 1 } {
|
||||
puts "Error : There is not word shape in f23before"
|
||||
puts "Error : There is not word shape in f19before"
|
||||
}
|
||||
if { [regexp "FACE" $info2] != 1 } {
|
||||
puts "Error : There is not word FACE in f23before"
|
||||
puts "Error : There is not word FACE in f19before"
|
||||
}
|
||||
if { [regexp "REVERSED" $info2] != 1 } {
|
||||
puts "Error : There is not word REVERSED in f23before"
|
||||
puts "Error : There is not word REVERSED in f19before"
|
||||
}
|
||||
if { [regexp "Modified" $info2] != 1 } {
|
||||
puts "Error : There is not word Modified in f23before"
|
||||
puts "Error : There is not word Modified in f19before"
|
||||
}
|
||||
if { [regexp "Orientable" $info2] != 1 } {
|
||||
puts "Error : There is not word Orientable in f23before"
|
||||
puts "Error : There is not word Orientable in f19before"
|
||||
}
|
||||
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
# 1. Create 3 boxes $B1, $B2, $B3
|
||||
# 2. $FS1 = Fuse ($B1, $B2)
|
||||
# 3. $FS2 = Fuse ($B1, $B3)
|
||||
# 4. Make selections of the face 'fuse2_23'
|
||||
# 4. Make selections of the face 'fuse2_19'
|
||||
# 5. Modify B2
|
||||
# 6. Recompute
|
||||
# ===============================================
|
||||
@@ -38,11 +38,11 @@ explode fuse2 f
|
||||
|
||||
|
||||
|
||||
#4. Select fuse2_23 using Attach
|
||||
set Sel2 [AttachShape $doc fuse2_23 $B1]
|
||||
GetShape $doc $Sel2:1:2 nf23before
|
||||
#nf23before is face
|
||||
set info1 [whatis nf23before]
|
||||
#4. Select fuse2_19 using Attach
|
||||
set Sel2 [AttachShape $doc fuse2_19 $B1]
|
||||
GetShape $doc $Sel2:1:2 nf19before
|
||||
#nf19before is face
|
||||
set info1 [whatis nf19before]
|
||||
|
||||
|
||||
#5. Modify
|
||||
@@ -56,38 +56,38 @@ ComputeFun $doc $B3:1
|
||||
ComputeFun $doc $FS1
|
||||
ComputeFun $doc $FS2
|
||||
ComputeFun $doc $Sel2:1
|
||||
GetShape $doc $Sel2:1:2 nf23after
|
||||
#nf23after is face
|
||||
set info2 [whatis nf23after]
|
||||
GetShape $doc $Sel2:1:2 nf19after
|
||||
#nf19after is face
|
||||
set info2 [whatis nf19after]
|
||||
|
||||
if { [regexp "shape" $info1] != 1 } {
|
||||
puts "Error : There is not word shape in nf23after"
|
||||
puts "Error : There is not word shape in nf19after"
|
||||
}
|
||||
if { [regexp "FACE" $info1] != 1 } {
|
||||
puts "Error : There is not word FACE in nf23after"
|
||||
puts "Error : There is not word FACE in nf19after"
|
||||
}
|
||||
if { [regexp "REVERSED" $info1] != 1 } {
|
||||
puts "Error : There is not word REVERSED in nf23after"
|
||||
puts "Error : There is not word REVERSED in nf19after"
|
||||
}
|
||||
if { [regexp "Modified" $info1] != 1 } {
|
||||
puts "Error : There is not word Modified in nf23after"
|
||||
puts "Error : There is not word Modified in nf19after"
|
||||
}
|
||||
if { [regexp "Orientable" $info1] != 1 } {
|
||||
puts "Error : There is not word Orientable in nf23after"
|
||||
puts "Error : There is not word Orientable in nf19after"
|
||||
}
|
||||
|
||||
if { [regexp "shape" $info2] != 1 } {
|
||||
puts "Error : There is not word shape in nf23before"
|
||||
puts "Error : There is not word shape in nf19before"
|
||||
}
|
||||
if { [regexp "FACE" $info2] != 1 } {
|
||||
puts "Error : There is not word FACE in nf23before"
|
||||
puts "Error : There is not word FACE in nf19before"
|
||||
}
|
||||
if { [regexp "REVERSED" $info2] != 1 } {
|
||||
puts "Error : There is not word REVERSED in nf23before"
|
||||
puts "Error : There is not word REVERSED in nf19before"
|
||||
}
|
||||
if { [regexp "Modified" $info2] != 1 } {
|
||||
puts "Error : There is not word Modified in nf23before"
|
||||
puts "Error : There is not word Modified in nf19before"
|
||||
}
|
||||
if { [regexp "Orientable" $info2] != 1 } {
|
||||
puts "Error : There is not word Orientable in nf23before"
|
||||
puts "Error : There is not word Orientable in nf19before"
|
||||
}
|
@@ -37,10 +37,10 @@ dchrono cpu stop counter OCC29237
|
||||
|
||||
# check the result of CUT
|
||||
checkshape rcut
|
||||
checknbshapes rcut -vertex 640 -edge 1760 -wire 842 -face 842 -shell 1 -solid 1
|
||||
checknbshapes rcut -vertex 1200 -edge 2040 -wire 842 -face 842 -shell 1 -solid 1 -t -m "CUT"
|
||||
checkprops rcut -s 3.4136e+006 -v 2.9712e+007
|
||||
|
||||
# check the result of COMMON
|
||||
checkshape rcommon
|
||||
checknbshapes rcommon -vertex 616 -edge 1484 -wire 882 -face 882 -shell 147 -solid 147
|
||||
checknbshapes rcommon -vertex 1176 -edge 1764 -wire 882 -face 882 -shell 147 -solid 147 -t -m "COMMON"
|
||||
checkprops rcommon -s 2.13392e+006 -v 1.6448e+007
|
||||
|
@@ -37,10 +37,10 @@ dchrono cpu stop counter OCC29237
|
||||
|
||||
# check the result of CUT
|
||||
checkshape rcut
|
||||
checknbshapes rcut -vertex 1294 -edge 3074 -wire 1842 -face 1842 -shell 301 -solid 301
|
||||
checknbshapes rcut -vertex 2488 -edge 3732 -wire 1846 -face 1846 -shell 301 -solid 301 -t -m "CUT"
|
||||
checkprops rcut -s 2.59678e+006 -v 1.5346e+007
|
||||
|
||||
# check the result of COMMON
|
||||
checkshape rcommon
|
||||
checknbshapes rcommon -vertex 0 -edge 0 -wire 0 -face 0 -shell 0 -solid 0
|
||||
checknbshapes rcommon -vertex 0 -edge 0 -wire 0 -face 0 -shell 0 -solid 0 -t -m "COMMON"
|
||||
checkprops rcommon -s empty -v empty
|
||||
|
Reference in New Issue
Block a user