puts "================"
puts "0031587: Modeling Data - Remove internal sub-shapes from the shape"
puts "================"
puts ""

box b 10 10 10
box b1 2 2 -1 3 2 2
explode b1 f

bclearobjects
bcleartools
baddobjects b
baddtools b1_1 b1_2
bfillds
bsplit r

removeinternals r

checkshape r
checknbshapes r -vertex 8 -edge 12 -wire 6 -face 6 -shell 1 -solid 1

bbuild r
bbuild r1
removeinternals r1 0

checkshape r1
checknbshapes r1 -ref [nbshapes r]

removeinternals r1 1
checkshape r1
checknbshapes r1 -vertex 20 -edge 26 -wire 10 -face 10 -shell 1 -solid 1

explode r1 so
checknbshapes r1_1 -vertex 8 -edge 12 -wire 6 -face 6 -shell 1 -solid 1
