mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0029890: Data Exchange - Problem in Expand Compounds
XCAFDoc_ShapeTool::Expand method now avoids creation of subshapes under assemblies. XCAFDoc_ShapeTool::AddSubShape now avoids creation subshapes under all labels except for simple parts.
This commit is contained in:
19
tests/bugs/xde/bug29890_1
Normal file
19
tests/bugs/xde/bug29890_1
Normal file
@@ -0,0 +1,19 @@
|
||||
puts "=========="
|
||||
puts "OCC29890"
|
||||
puts "=========="
|
||||
puts ""
|
||||
##############################
|
||||
# Problem in Expand Compounds
|
||||
##############################
|
||||
pload ALL
|
||||
|
||||
# Open file and expand
|
||||
XOpen [locate_data_file bug29890.xbf] D
|
||||
XExpand D 1 0:1:1:1238
|
||||
|
||||
# Check
|
||||
set children [Children D 0:1:1:1239]
|
||||
if {$children != "0:1:1:1239:1 0:1:1:1239:3 "} {
|
||||
puts "Error: wrong expand compounds."
|
||||
}
|
||||
Close D
|
45
tests/bugs/xde/bug29890_2
Normal file
45
tests/bugs/xde/bug29890_2
Normal file
@@ -0,0 +1,45 @@
|
||||
puts "=========="
|
||||
puts "OCC29890"
|
||||
puts "=========="
|
||||
puts ""
|
||||
##############################
|
||||
# Problem in Expand Compounds
|
||||
##############################
|
||||
pload ALL
|
||||
|
||||
# Add subshape to assembly
|
||||
box b 1 1 1
|
||||
compound b comp
|
||||
XNewDoc D
|
||||
XAddShape D comp
|
||||
explode comp f
|
||||
set sub1 [XAddSubShape D comp_1 0:1:1:1]
|
||||
if {$sub1 != ""} {
|
||||
puts "Error: inconsistent model after add subshape to assembly."
|
||||
}
|
||||
Close D
|
||||
|
||||
# Add subshape to reference
|
||||
box b 1 1 1
|
||||
ttranslate b 1 0 0
|
||||
XNewDoc D
|
||||
XAddShape D b
|
||||
explode b f
|
||||
set sub2 [XAddSubShape D b_1 0:1:1:1]
|
||||
if {$sub2 != ""} {
|
||||
puts "Error: inconsistent model after add subshape to reference."
|
||||
}
|
||||
Close D
|
||||
|
||||
# Add subshape to subshape
|
||||
box b 1 1 1
|
||||
XNewDoc D
|
||||
XAddShape D b
|
||||
explode b f
|
||||
XAddSubShape D b_1 0:1:1:1
|
||||
explode b_1 e
|
||||
set sub3 [XAddSubShape D b_1_1 0:1:1:1:1]
|
||||
if {$sub3 != ""} {
|
||||
puts "Error: inconsistent model after add subshape to subshape."
|
||||
}
|
||||
Close D
|
Reference in New Issue
Block a user